From b8580a70399dbfcd00dd2e2ce1ffa786cfb6d32f Mon Sep 17 00:00:00 2001 From: YoloMao Date: Fri, 2 Feb 2024 11:55:23 +0800 Subject: [PATCH 01/36] chore: add watchOS demo for test --- .../AppDelegate.swift | 32 ++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 13 + .../Assets.xcassets/Contents.json | 6 + .../ContentView.swift | 40 +++ .../Example_watchOSApp.swift | 31 ++ .../Preview Assets.xcassets/Contents.json | 6 + Example/Example.xcodeproj/project.pbxproj | 299 +++++++++++++++++- .../ClickEvent/GIOClickEventViewController.m | 4 + Example/Podfile | 5 + Example/Podfile.lock | 30 +- GrowingAnalytics.podspec | 5 +- Package.swift | 4 +- 13 files changed, 464 insertions(+), 22 deletions(-) create mode 100644 Example/Example-watchOS Watch App/AppDelegate.swift create mode 100644 Example/Example-watchOS Watch App/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Example/Example-watchOS Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/Example-watchOS Watch App/Assets.xcassets/Contents.json create mode 100644 Example/Example-watchOS Watch App/ContentView.swift create mode 100644 Example/Example-watchOS Watch App/Example_watchOSApp.swift create mode 100644 Example/Example-watchOS Watch App/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/Example/Example-watchOS Watch App/AppDelegate.swift b/Example/Example-watchOS Watch App/AppDelegate.swift new file mode 100644 index 000000000..1ad57d0ff --- /dev/null +++ b/Example/Example-watchOS Watch App/AppDelegate.swift @@ -0,0 +1,32 @@ +// +// AppDelegate.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/1/31. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import Foundation +import WatchKit +import GrowingAnalytics + +class AppDelegate: NSObject, WKApplicationDelegate { + func applicationDidFinishLaunching() { + let config = GrowingTrackConfiguration(accountId: "0a1b4118dd954ec3bcc69da5138bdb96") + config?.dataSourceId = "ab555003531e0fd1" + config?.urlScheme = "growing.bf30ad277eaae1aa" + config?.debugEnabled = true + GrowingTracker.start(with: config!) + } +} diff --git a/Example/Example-watchOS Watch App/Assets.xcassets/AccentColor.colorset/Contents.json b/Example/Example-watchOS Watch App/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..eb8789700 --- /dev/null +++ b/Example/Example-watchOS Watch App/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-watchOS Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Example-watchOS Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..49c81cd8c --- /dev/null +++ b/Example/Example-watchOS Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "watchos", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-watchOS Watch App/Assets.xcassets/Contents.json b/Example/Example-watchOS Watch App/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-watchOS Watch App/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-watchOS Watch App/ContentView.swift b/Example/Example-watchOS Watch App/ContentView.swift new file mode 100644 index 000000000..c1bb0b391 --- /dev/null +++ b/Example/Example-watchOS Watch App/ContentView.swift @@ -0,0 +1,40 @@ +// +// ContentView.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/1/31. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI +import GrowingAnalytics + +struct ContentView: View { + var body: some View { + VStack { + Image(systemName: "globe") + .imageScale(.large) + .foregroundStyle(.tint) + Text("Hello, world!") + Button("TrackCustomEvent") { + GrowingTracker.sharedInstance().trackCustomEvent("watchOS_custom_event", withAttributes: ["key": "value"]) + } + } + .padding() + } +} + +#Preview { + ContentView() +} diff --git a/Example/Example-watchOS Watch App/Example_watchOSApp.swift b/Example/Example-watchOS Watch App/Example_watchOSApp.swift new file mode 100644 index 000000000..d67000b5e --- /dev/null +++ b/Example/Example-watchOS Watch App/Example_watchOSApp.swift @@ -0,0 +1,31 @@ +// +// Example_watchOSApp.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/1/31. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI + +@main +struct Example_watchOS_Watch_AppApp: App { + @WKApplicationDelegateAdaptor(AppDelegate.self) var delegate + + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/Example/Example-watchOS Watch App/Preview Content/Preview Assets.xcassets/Contents.json b/Example/Example-watchOS Watch App/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-watchOS Watch App/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index bca2ee78f..45dc5bf4f 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -176,6 +176,12 @@ 34E785542B513FCC00CBCBA1 /* ShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 34ECD0FF2AE22F3A00DA3EBD /* GrowingAnalyticsStartTests2.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ECD0FE2AE22F3A00DA3EBD /* GrowingAnalyticsStartTests2.m */; }; 34ECFDBF2A5C082A0059F87C /* GrowingAutotrackPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34ECFDBE2A5C082A0059F87C /* GrowingAutotrackPageViewController.m */; }; + 34FBF18B2B6A2C1C008C7587 /* Example_watchOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34FBF18A2B6A2C1C008C7587 /* Example_watchOSApp.swift */; }; + 34FBF18D2B6A2C1C008C7587 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34FBF18C2B6A2C1C008C7587 /* ContentView.swift */; }; + 34FBF18F2B6A2C1C008C7587 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34FBF18E2B6A2C1C008C7587 /* Assets.xcassets */; }; + 34FBF1922B6A2C1C008C7587 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34FBF1912B6A2C1C008C7587 /* Preview Assets.xcassets */; }; + 34FBF1952B6A2C1C008C7587 /* Example-watchOS Watch App.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 34FBF1882B6A2C1C008C7587 /* Example-watchOS Watch App.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 34FBF19B2B6A3A15008C7587 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34FBF19A2B6A3A15008C7587 /* AppDelegate.swift */; }; 34FCF7E12A937ECA009611B3 /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34FCF7E02A937ECA009611B3 /* SwiftUIView.swift */; }; 34FCF7E42A937F4F009611B3 /* GIOSwiftUIContentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34FCF7E32A937F4F009611B3 /* GIOSwiftUIContentViewController.m */; }; 3B84E71F6A358D2D6AE629D7 /* Pods_ABTestingTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36E93290071EF480453E2196 /* Pods_ABTestingTests.framework */; }; @@ -190,6 +196,7 @@ 6F7A64B402BF8E5ED466E56A /* Pods_GrowingAnalyticsTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0257123D870B44A9FDA90A22 /* Pods_GrowingAnalyticsTests.framework */; }; 7E20527CFF34511EE464C33F /* Pods_GrowingAnalyticsStartTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1769255A062869A5D219F683 /* Pods_GrowingAnalyticsStartTests.framework */; }; 997DAC68973F1F4FAF34EA2E /* Pods_Example_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B524BD63EF3439946134E74 /* Pods_Example_macOS.framework */; }; + 9D43D2496D486AEB7DCFD460 /* Pods_Example_watchOS_Watch_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 358137F6293DF184E03C3572 /* Pods_Example_watchOS_Watch_App.framework */; }; A61E1E81175885070AAD10A9 /* Pods_ExampleiOS13.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7CCC2E00F858DC5B58D4FA6 /* Pods_ExampleiOS13.framework */; }; A9D21D06460258FAC4736A26 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90476D1583D0EE778FCBED5E /* Pods_Example.framework */; }; DC414ADEC8E1A738BA63089E /* Pods_AdvertisingTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5655CC09B9A2CE16091DB52F /* Pods_AdvertisingTests.framework */; }; @@ -224,6 +231,13 @@ remoteGlobalIDString = 34E785482B513FCC00CBCBA1; remoteInfo = ShareExtension; }; + 34FBF1932B6A2C1C008C7587 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6003F582195388D10070C39A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 34FBF1872B6A2C1C008C7587; + remoteInfo = "Example-watchOS Watch App"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -238,6 +252,17 @@ name = "Embed Foundation Extensions"; runOnlyForDeploymentPostprocessing = 0; }; + 34FBF1962B6A2C1D008C7587 /* Embed Watch Content */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "$(CONTENTS_FOLDER_PATH)/Watch"; + dstSubfolderSpec = 16; + files = ( + 34FBF1952B6A2C1C008C7587 /* Example-watchOS Watch App.app in Embed Watch Content */, + ); + name = "Embed Watch Content"; + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -333,6 +358,7 @@ 04F675652628293800077374 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; 0B3751A8D7A8C11CD50B544E /* Pods-GrowingAnalyticsStartTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GrowingAnalyticsStartTests.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-GrowingAnalyticsStartTests/Pods-GrowingAnalyticsStartTests.debug.xcconfig"; sourceTree = ""; }; 1769255A062869A5D219F683 /* Pods_GrowingAnalyticsStartTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GrowingAnalyticsStartTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2396F869C811CB392EA9F501 /* Pods-Example-watchOS Watch App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-watchOS Watch App.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-watchOS Watch App/Pods-Example-watchOS Watch App.release.xcconfig"; sourceTree = ""; }; 3406842A2A668EB700E25216 /* A3PageEventsTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = A3PageEventsTest.m; sourceTree = ""; }; 34106BB228FECB0D00E7DB01 /* Crasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crasher.h; sourceTree = ""; }; 34106BB328FECB0E00E7DB01 /* Crasher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Crasher.mm; sourceTree = ""; }; @@ -450,9 +476,16 @@ 34ECFDBD2A5C082A0059F87C /* GrowingAutotrackPageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GrowingAutotrackPageViewController.h; sourceTree = ""; }; 34ECFDBE2A5C082A0059F87C /* GrowingAutotrackPageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GrowingAutotrackPageViewController.m; sourceTree = ""; }; 34F94ED82A938725002CB9FC /* Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Example-Bridging-Header.h"; path = "Example/Example-Bridging-Header.h"; sourceTree = SOURCE_ROOT; }; + 34FBF1882B6A2C1C008C7587 /* Example-watchOS Watch App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-watchOS Watch App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 34FBF18A2B6A2C1C008C7587 /* Example_watchOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example_watchOSApp.swift; sourceTree = ""; }; + 34FBF18C2B6A2C1C008C7587 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 34FBF18E2B6A2C1C008C7587 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 34FBF1912B6A2C1C008C7587 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 34FBF19A2B6A3A15008C7587 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 34FCF7E02A937ECA009611B3 /* SwiftUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = ""; }; 34FCF7E22A937F4F009611B3 /* GIOSwiftUIContentViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GIOSwiftUIContentViewController.h; sourceTree = ""; }; 34FCF7E32A937F4F009611B3 /* GIOSwiftUIContentViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GIOSwiftUIContentViewController.m; sourceTree = ""; }; + 358137F6293DF184E03C3572 /* Pods_Example_watchOS_Watch_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_watchOS_Watch_App.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 36E93290071EF480453E2196 /* Pods_ABTestingTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ABTestingTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3D63F725A31AE372B485C361 /* Pods-HostApplicationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HostApplicationTests.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-HostApplicationTests/Pods-HostApplicationTests.debug.xcconfig"; sourceTree = ""; }; 42ADE26B250B292900CA7268 /* HybridTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HybridTest.m; sourceTree = ""; }; @@ -475,6 +508,7 @@ 68B97EA7A6285797FDDCE335 /* Pods-AdvertisingTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AdvertisingTests.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-AdvertisingTests/Pods-AdvertisingTests.debug.xcconfig"; sourceTree = ""; }; 6F9B4F11B90235A2D461CA2C /* Pods-GrowingAnalyticsTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GrowingAnalyticsTests.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-GrowingAnalyticsTests/Pods-GrowingAnalyticsTests.debug.xcconfig"; sourceTree = ""; }; 7B524BD63EF3439946134E74 /* Pods_Example_macOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_macOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 835401C6A4C9E2141838BE84 /* Pods-Example-watchOS Watch App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-watchOS Watch App.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-watchOS Watch App/Pods-Example-watchOS Watch App.debug.xcconfig"; sourceTree = ""; }; 8899A83F721CB9CFF4C9D7F9 /* Pods-ShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShareExtension.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-ShareExtension/Pods-ShareExtension.release.xcconfig"; sourceTree = ""; }; 90476D1583D0EE778FCBED5E /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 91EEE76F9E0E94DB389A9D21 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; @@ -584,6 +618,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34FBF1852B6A2C1C008C7587 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9D43D2496D486AEB7DCFD460 /* Pods_Example_watchOS_Watch_App.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6003F587195388D20070C39A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -803,6 +845,8 @@ 9FF2837F9C59D83A1A3F5D76 /* Pods-ABTestingTests.release.xcconfig */, 0344A9865CDD74AF1F8A6198 /* Pods-ShareExtension.debug.xcconfig */, 8899A83F721CB9CFF4C9D7F9 /* Pods-ShareExtension.release.xcconfig */, + 835401C6A4C9E2141838BE84 /* Pods-Example-watchOS Watch App.debug.xcconfig */, + 2396F869C811CB392EA9F501 /* Pods-Example-watchOS Watch App.release.xcconfig */, ); name = Pods; path = ../Pods; @@ -1398,6 +1442,26 @@ path = ShareExtension; sourceTree = ""; }; + 34FBF1892B6A2C1C008C7587 /* Example-watchOS Watch App */ = { + isa = PBXGroup; + children = ( + 34FBF18A2B6A2C1C008C7587 /* Example_watchOSApp.swift */, + 34FBF19A2B6A3A15008C7587 /* AppDelegate.swift */, + 34FBF18C2B6A2C1C008C7587 /* ContentView.swift */, + 34FBF18E2B6A2C1C008C7587 /* Assets.xcassets */, + 34FBF1902B6A2C1C008C7587 /* Preview Content */, + ); + path = "Example-watchOS Watch App"; + sourceTree = ""; + }; + 34FBF1902B6A2C1C008C7587 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 34FBF1912B6A2C1C008C7587 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; 4962652C24DA66B600032551 /* Helper */ = { isa = PBXGroup; children = ( @@ -1419,6 +1483,7 @@ 34BA7B18277C61250030AC21 /* GrowingAnalyticsTests */, 346E0B3929F2724400A12E4E /* Example-macOS */, 34E7854A2B513FCC00CBCBA1 /* ShareExtension */, + 34FBF1892B6A2C1C008C7587 /* Example-watchOS Watch App */, 6003F58C195388D20070C39A /* Frameworks */, 6003F58B195388D20070C39A /* Products */, 1172AEB47E26DD658BEEA1BB /* Pods */, @@ -1440,6 +1505,7 @@ 346E0B3829F2724300A12E4E /* Example-macOS.app */, 346521DF2ADD0E540091E815 /* ABTestingTests.xctest */, 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */, + 34FBF1882B6A2C1C008C7587 /* Example-watchOS Watch App.app */, ); name = Products; sourceTree = ""; @@ -1466,6 +1532,7 @@ 5655CC09B9A2CE16091DB52F /* Pods_AdvertisingTests.framework */, 36E93290071EF480453E2196 /* Pods_ABTestingTests.framework */, BDF26A896226E51F6DD6DA0E /* Pods_ShareExtension.framework */, + 358137F6293DF184E03C3572 /* Pods_Example_watchOS_Watch_App.framework */, ); name = Frameworks; sourceTree = ""; @@ -1680,6 +1747,25 @@ productReference = 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */; productType = "com.apple.product-type.app-extension"; }; + 34FBF1872B6A2C1C008C7587 /* Example-watchOS Watch App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 34FBF1992B6A2C1D008C7587 /* Build configuration list for PBXNativeTarget "Example-watchOS Watch App" */; + buildPhases = ( + CC36A1FF8FDD436D793BBEF1 /* [CP] Check Pods Manifest.lock */, + 34FBF1842B6A2C1C008C7587 /* Sources */, + 34FBF1852B6A2C1C008C7587 /* Frameworks */, + 34FBF1862B6A2C1C008C7587 /* Resources */, + 646F7235C6B6A31E8FA522B0 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Example-watchOS Watch App"; + productName = "Example-watchOS Watch App"; + productReference = 34FBF1882B6A2C1C008C7587 /* Example-watchOS Watch App.app */; + productType = "com.apple.product-type.application"; + }; 6003F589195388D20070C39A /* Example */ = { isa = PBXNativeTarget; buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "Example" */; @@ -1690,11 +1776,13 @@ 6003F588195388D20070C39A /* Resources */, 1C17EF8F048AC13906C270F0 /* [CP] Embed Pods Frameworks */, 34E785562B513FCC00CBCBA1 /* Embed Foundation Extensions */, + 34FBF1962B6A2C1D008C7587 /* Embed Watch Content */, ); buildRules = ( ); dependencies = ( 34E785532B513FCC00CBCBA1 /* PBXTargetDependency */, + 34FBF1942B6A2C1C008C7587 /* PBXTargetDependency */, ); name = Example; productName = GrowingIO; @@ -1708,7 +1796,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = Growing; - LastSwiftUpdateCheck = 1420; + LastSwiftUpdateCheck = 1520; LastUpgradeCheck = 0720; ORGANIZATIONNAME = GrowingIO; TargetAttributes = { @@ -1778,6 +1866,11 @@ DevelopmentTeam = SXBU677CPT; ProvisioningStyle = Automatic; }; + 34FBF1872B6A2C1C008C7587 = { + CreatedOnToolsVersion = 15.2; + DevelopmentTeam = SXBU677CPT; + ProvisioningStyle = Automatic; + }; 6003F589195388D20070C39A = { DevelopmentTeam = SXBU677CPT; LastSwiftMigration = 1430; @@ -1813,6 +1906,7 @@ 346E0B3729F2724300A12E4E /* Example-macOS */, 346521DE2ADD0E540091E815 /* ABTestingTests */, 34E785482B513FCC00CBCBA1 /* ShareExtension */, + 34FBF1872B6A2C1C008C7587 /* Example-watchOS Watch App */, ); }; /* End PBXProject section */ @@ -1901,6 +1995,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34FBF1862B6A2C1C008C7587 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34FBF1922B6A2C1C008C7587 /* Preview Assets.xcassets in Resources */, + 34FBF18F2B6A2C1C008C7587 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6003F588195388D20070C39A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2164,6 +2267,28 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 646F7235C6B6A31E8FA522B0 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example-watchOS Watch App/Pods-Example-watchOS Watch App-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-3edd9a5d/GrowingAnalytics.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-TrackerCore-watchOS/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/Protobuf-watchOS/Protobuf.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GrowingAnalytics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GrowingUtils.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-watchOS Watch App/Pods-Example-watchOS Watch App-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 6768756DF194F5DC75B6668C /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2304,6 +2429,28 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + CC36A1FF8FDD436D793BBEF1 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-watchOS Watch App-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; E01F7B70074470BAFFB515F5 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2355,8 +2502,8 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Example-macOS/Pods-Example-macOS-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-19c77ac5/GrowingAnalytics.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-9b78b9c4/GrowingAnalytics.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-TrackerCore-macOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-macOS/Protobuf.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -2543,6 +2690,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34FBF1842B6A2C1C008C7587 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34FBF19B2B6A3A15008C7587 /* AppDelegate.swift in Sources */, + 34FBF18D2B6A2C1C008C7587 /* ContentView.swift in Sources */, + 34FBF18B2B6A2C1C008C7587 /* Example_watchOSApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6003F586195388D20070C39A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2623,6 +2780,11 @@ target = 34E785482B513FCC00CBCBA1 /* ShareExtension */; targetProxy = 34E785522B513FCC00CBCBA1 /* PBXContainerItemProxy */; }; + 34FBF1942B6A2C1C008C7587 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 34FBF1872B6A2C1C008C7587 /* Example-watchOS Watch App */; + targetProxy = 34FBF1932B6A2C1C008C7587 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -3765,6 +3927,126 @@ }; name = Release; }; + 34FBF1972B6A2C1D008C7587 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 835401C6A4C9E2141838BE84 /* Pods-Example-watchOS Watch App.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_ASSET_PATHS = "\"Example-watchOS Watch App/Preview Content\""; + DEVELOPMENT_TEAM = SXBU677CPT; + ENABLE_PREVIEWS = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GENERATE_INFOPLIST_FILE = YES; + HEADER_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_KEY_CFBundleDisplayName = "Example-watchOS"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "GrowingIO.GrowingIOTest-"; + INFOPLIST_KEY_WKRunsIndependentlyOfCompanionApp = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-.watchkitapp"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 8.0; + }; + name = Debug; + }; + 34FBF1982B6A2C1D008C7587 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2396F869C811CB392EA9F501 /* Pods-Example-watchOS Watch App.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_ASSET_PATHS = "\"Example-watchOS Watch App/Preview Content\""; + DEVELOPMENT_TEAM = SXBU677CPT; + ENABLE_PREVIEWS = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GENERATE_INFOPLIST_FILE = YES; + HEADER_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_KEY_CFBundleDisplayName = "Example-watchOS"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "GrowingIO.GrowingIOTest-"; + INFOPLIST_KEY_WKRunsIndependentlyOfCompanionApp = YES; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-.watchkitapp"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 8.0; + }; + name = Release; + }; 6003F5BD195388D20070C39A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3842,6 +4124,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 91EEE76F9E0E94DB389A9D21 /* Pods-Example.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements; @@ -3880,6 +4163,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = DDE20EE0BB4E138A407A5D1C /* Pods-Example.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements; @@ -4033,6 +4317,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 34FBF1992B6A2C1D008C7587 /* Build configuration list for PBXNativeTarget "Example-watchOS Watch App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 34FBF1972B6A2C1D008C7587 /* Debug */, + 34FBF1982B6A2C1D008C7587 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 6003F585195388D10070C39A /* Build configuration list for PBXProject "Example" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Example/Example/MeasurementProtocol/ClickEvent/GIOClickEventViewController.m b/Example/Example/MeasurementProtocol/ClickEvent/GIOClickEventViewController.m index c34f60636..edb873824 100644 --- a/Example/Example/MeasurementProtocol/ClickEvent/GIOClickEventViewController.m +++ b/Example/Example/MeasurementProtocol/ClickEvent/GIOClickEventViewController.m @@ -8,7 +8,11 @@ #import "GIOClickEventViewController.h" #import "AppDelegate.h" +#if defined(AUTOTRACKER) +#if defined(SDK3rd) #import "UIView+GrowingImpression.h" +#endif +#endif @interface GIOClickEventViewController () diff --git a/Example/Podfile b/Example/Podfile index 1d3f1997a..e25126d05 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -87,6 +87,11 @@ target 'Example-macOS' do pod 'GrowingAnalytics/Tracker', :path => '../' end +target 'Example-watchOS Watch App' do + platform :watchos, '7.0' + pod 'GrowingAnalytics/Tracker', :path => '../' +end + post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 00f5a91fd..6905e5b7e 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -14,7 +14,7 @@ PODS: - GrowingAnalytics/WebCircle (= 4.1.0) - GrowingAnalytics/AutotrackerCore (4.1.0): - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingUtils/AutotrackerCore (~> 1.1.0) + - GrowingUtils/AutotrackerCore (~> 1.2.0) - GrowingAnalytics/Compression (4.1.0): - GrowingAnalytics/TrackerCore (= 4.1.0) - GrowingAnalytics/Database (4.1.0): @@ -53,7 +53,7 @@ PODS: - GrowingAnalytics/MobileDebugger (= 4.1.0) - GrowingAnalytics/TrackerCore (= 4.1.0) - GrowingAnalytics/TrackerCore (4.1.0): - - GrowingUtils/TrackerCore (~> 1.1.0) + - GrowingUtils/TrackerCore (~> 1.2.0) - GrowingAnalytics/WebCircle (4.1.0): - GrowingAnalytics/AutotrackerCore (= 4.1.0) - GrowingAnalytics/Hybrid (= 4.1.0) @@ -61,15 +61,15 @@ PODS: - GrowingAnalytics/WebSocket (= 4.1.0) - GrowingAnalytics/WebSocket (4.1.0): - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAPM (1.0.0): - - GrowingAPM/Core (= 1.0.0) - - GrowingAPM/CrashMonitor (= 1.0.0) - - GrowingAPM/UIMonitor (= 1.0.0) - - GrowingAPM/Core (1.0.0): + - GrowingAPM (1.0.1): + - GrowingAPM/Core (= 1.0.1) + - GrowingAPM/CrashMonitor (= 1.0.1) + - GrowingAPM/UIMonitor (= 1.0.1) + - GrowingAPM/Core (1.0.1): - GrowingUtils/TrackerCore - - GrowingAPM/CrashMonitor (1.0.0): + - GrowingAPM/CrashMonitor (1.0.1): - GrowingAPM/Core - - GrowingAPM/UIMonitor (1.0.0): + - GrowingAPM/UIMonitor (1.0.1): - GrowingAPM/Core - GrowingToolsKit (2.0.0): - GrowingToolsKit/Default (= 2.0.0) @@ -105,9 +105,9 @@ PODS: - GrowingToolsKit/Core - GrowingToolsKit/XPathTrack (2.0.0): - GrowingToolsKit/Core - - GrowingUtils/AutotrackerCore (1.1.0): + - GrowingUtils/AutotrackerCore (1.2.0): - GrowingUtils/TrackerCore - - GrowingUtils/TrackerCore (1.1.0) + - GrowingUtils/TrackerCore (1.2.0) - KIF (3.8.9): - KIF/Core (= 3.8.9) - KIF/Core (3.8.9) @@ -160,16 +160,16 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - GrowingAnalytics: eee62f07f9d946ab49cf59d1be9fa030361827be - GrowingAPM: 6750d66ca6876c2c7d22c1c087625bc9ccc3430c + GrowingAnalytics: a6faa98c98bfb2d8a6fee8998f3e4f5344651437 + GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b GrowingToolsKit: edc93c96e47bd6ad1ff3deffe72fe276ae0a1fa8 - GrowingUtils: fde73d23911104a3dd2afc403335c8472c660a30 + GrowingUtils: 67f39629888d597a120b904213a128617ddcae25 KIF: 7660c626b0f2d4562533590960db70a36d640558 OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 Protobuf: 34db13339da0d02d64fa8a2ac6a124cfcc603703 SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf SDWebImage: fc8f2d48bbfd72ef39d70e981bd24a3f3be53fec -PODFILE CHECKSUM: 4ed607c8a4387bb56d7f914196a78a0d7964e17e +PODFILE CHECKSUM: 7593dc7c8438d93063cc565450ab2ccffc609ac5 COCOAPODS: 1.14.3 diff --git a/GrowingAnalytics.podspec b/GrowingAnalytics.podspec index 125dcfa14..e5ed3695e 100644 --- a/GrowingAnalytics.podspec +++ b/GrowingAnalytics.podspec @@ -11,6 +11,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.source = { :git => 'https://github.com/growingio/growingio-sdk-ios-autotracker.git', :tag => s.version.to_s } s.ios.deployment_target = '10.0' s.osx.deployment_target = '10.12' + s.watchos.deployment_target = '7.0' s.ios.framework = 'WebKit' s.requires_arc = true s.default_subspec = "Autotracker" @@ -40,7 +41,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 end s.subspec 'TrackerCore' do |trackerCore| - trackerCore.dependency 'GrowingUtils/TrackerCore', '~> 1.1.0' + trackerCore.dependency 'GrowingUtils/TrackerCore', '~> 1.2.0' trackerCore.source_files = 'GrowingTrackerCore/**/*{.h,.m,.c,.cpp,.mm}' trackerCore.public_header_files = 'GrowingTrackerCore/Public/*.h' trackerCore.ios.resource_bundles = {'GrowingAnalytics' => ['Resources/iOS/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy']} @@ -50,7 +51,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.subspec 'AutotrackerCore' do |autotrackerCore| autotrackerCore.ios.deployment_target = '10.0' - autotrackerCore.dependency 'GrowingUtils/AutotrackerCore', '~> 1.1.0' + autotrackerCore.dependency 'GrowingUtils/AutotrackerCore', '~> 1.2.0' autotrackerCore.source_files = 'GrowingAutotrackerCore/**/*{.h,.m,.c,.cpp,.mm}' autotrackerCore.public_header_files = 'GrowingAutotrackerCore/Public/*.h' autotrackerCore.dependency 'GrowingAnalytics/TrackerCore', s.version.to_s diff --git a/Package.swift b/Package.swift index a30aafb90..a905ca7ab 100644 --- a/Package.swift +++ b/Package.swift @@ -24,7 +24,7 @@ import PackageDescription let package = Package( name: "GrowingAnalytics", - platforms: [.iOS(.v10), .macCatalyst(.v13), .macOS(.v10_12)], + platforms: [.iOS(.v10), .macCatalyst(.v13), .macOS(.v10_12), .watchOS(.v7)], products: [ .autotracker, .tracker, @@ -37,7 +37,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/growingio/growingio-sdk-ios-utilities.git", - "1.1.0" ..< "1.2.0" + "1.2.0" ..< "1.3.0" ), .package( url: "https://github.com/growingio/growingio-sdk-ios-performance-ext.git", From 99ac1b9af5899f071a9448cd2335a7690417b3f2 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Fri, 2 Feb 2024 18:58:08 +0800 Subject: [PATCH 02/36] feat: watchOS/tvOS/visionOS support --- Example/Podfile.lock | 2 +- GrowingAnalytics.podspec | 4 + .../UIApplication+GrowingAutotracker.m | 16 +- .../GrowingNode/GrowingNodeHelper.m | 6 +- .../DeepLink/GrowingAppDelegateAutotracker.h | 4 +- .../DeepLink/GrowingAppDelegateAutotracker.m | 5 +- .../GrowingSceneDelegateAutotracker.h | 4 +- .../GrowingSceneDelegateAutotracker.m | 5 +- .../Tools/GrowingPersistenceDataProvider.m | 3 +- .../FileStorage/GrowingFileStorage.m | 3 +- GrowingTrackerCore/GrowingRealTracker.m | 3 +- GrowingTrackerCore/GrowingWindow.h | 4 +- GrowingTrackerCore/GrowingWindow.m | 4 +- .../UIKit/UIApplication+GrowingHelper.h | 4 +- .../UIKit/UIApplication+GrowingHelper.m | 4 +- .../Helpers/UIKit/UIImage+GrowingHelper.h | 4 +- .../Helpers/UIKit/UIImage+GrowingHelper.m | 4 +- .../Helpers/UIKit/UIView+GrowingHelper.h | 4 +- .../Helpers/UIKit/UIView+GrowingHelper.m | 4 +- .../Helpers/UIKit/UIWindow+GrowingHelper.h | 4 +- .../Helpers/UIKit/UIWindow+GrowingHelper.m | 4 +- GrowingTrackerCore/Menu/GrowingAlert.h | 4 +- GrowingTrackerCore/Menu/GrowingAlert.m | 4 +- GrowingTrackerCore/Menu/GrowingStatusBar.h | 5 +- GrowingTrackerCore/Menu/GrowingStatusBar.m | 4 +- .../Network/GrowingNetworkInterfaceManager.m | 9 +- .../Reachability/GrowingReachability.h | 4 +- .../Reachability/GrowingReachability.m | 18 +- GrowingTrackerCore/Utils/GrowingDeviceInfo.m | 69 +-- .../Utils/GrowingInternalMacros.h | 2 +- .../UserIdentifier/GrowingUserIdentifier.m | 32 +- Package.swift | 16 +- Package@swift-5.9.swift | 427 ++++++++++++++++++ 33 files changed, 583 insertions(+), 106 deletions(-) create mode 100644 Package@swift-5.9.swift diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 6905e5b7e..2991b1979 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -160,7 +160,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - GrowingAnalytics: a6faa98c98bfb2d8a6fee8998f3e4f5344651437 + GrowingAnalytics: 46a017057f145c19651a669ba79d97b36a1d8ce2 GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b GrowingToolsKit: edc93c96e47bd6ad1ff3deffe72fe276ae0a1fa8 GrowingUtils: 67f39629888d597a120b904213a128617ddcae25 diff --git a/GrowingAnalytics.podspec b/GrowingAnalytics.podspec index e5ed3695e..41a292327 100644 --- a/GrowingAnalytics.podspec +++ b/GrowingAnalytics.podspec @@ -12,6 +12,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.ios.deployment_target = '10.0' s.osx.deployment_target = '10.12' s.watchos.deployment_target = '7.0' + s.tvos.deployment_target = '10.0' s.ios.framework = 'WebKit' s.requires_arc = true s.default_subspec = "Autotracker" @@ -19,6 +20,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.subspec 'Autotracker' do |autotracker| autotracker.ios.deployment_target = '10.0' + autotracker.tvos.deployment_target = '10.0' autotracker.source_files = 'GrowingAutotracker/**/*{.h,.m,.c,.cpp,.mm}' autotracker.public_header_files = 'GrowingAutotracker/*.h' autotracker.dependency 'GrowingAnalytics/AutotrackerCore', s.version.to_s @@ -51,6 +53,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.subspec 'AutotrackerCore' do |autotrackerCore| autotrackerCore.ios.deployment_target = '10.0' + autotrackerCore.tvos.deployment_target = '10.0' autotrackerCore.dependency 'GrowingUtils/AutotrackerCore', '~> 1.2.0' autotrackerCore.source_files = 'GrowingAutotrackerCore/**/*{.h,.m,.c,.cpp,.mm}' autotrackerCore.public_header_files = 'GrowingAutotrackerCore/Public/*.h' @@ -90,6 +93,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 end s.subspec 'WebSocket' do |service| + service.ios.deployment_target = '10.0' service.source_files = 'Services/WebSocket/**/*{.h,.m,.c,.cpp,.mm}' service.public_header_files = 'Services/WebSocket/include/*.h' service.dependency 'GrowingAnalytics/TrackerCore', s.version.to_s diff --git a/GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.m b/GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.m index 1a9e94606..66be80f28 100644 --- a/GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.m +++ b/GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.m @@ -22,6 +22,7 @@ #import "GrowingAutotrackerCore/GrowingNode/GrowingViewClickProvider.h" #import "GrowingTrackerCore/Event/GrowingNodeProtocol.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" +#import "GrowingTargetConditionals.h" @implementation UIApplication (GrowingAutotracker) @@ -54,18 +55,23 @@ - (void)growing_trackAction:(SEL)action to:(id)target from:(id)sender forEvent:( [sender isKindOfClass:UISegmentedControl.class]) { return; } - + NSObject *node = (NSObject *)sender; - if ([sender isKindOfClass:UIStepper.class] || [sender isKindOfClass:UIPageControl.class] || - [sender isKindOfClass:UISwitch.class]) { + if ([sender isKindOfClass:UIPageControl.class]) { + [GrowingViewClickProvider viewOnClick:(UIView *)node]; +#if Growing_OS_IOS || Growing_OS_MACCATALYST || Growing_OS_VISION + } else if ([sender isKindOfClass:UIStepper.class] || [sender isKindOfClass:UISwitch.class]) { [GrowingViewClickProvider viewOnClick:(UIView *)node]; +#endif } else if ([event isKindOfClass:[UIEvent class]] && event.type == UIEventTypeTouches && [[[event allTouches] anyObject] phase] == UITouchPhaseEnded) { +#if Growing_OS_IOS || Growing_OS_MACCATALYST || Growing_OS_VISION if ([sender isKindOfClass:UISlider.class]) { [GrowingViewChangeProvider viewOnChange:(UIView *)node]; - } else { - [GrowingViewClickProvider viewOnClick:(UIView *)node]; + return; } +#endif + [GrowingViewClickProvider viewOnClick:(UIView *)node]; } } diff --git a/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m b/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m index ee7d5a5ae..87dcdee93 100644 --- a/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m +++ b/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m @@ -135,8 +135,12 @@ + (NSString *)getViewNodeType:(UIView *)view { [view isKindOfClass:NSClassFromString(@"_UIModernBarButton")]) { nodetype = kGrowingViewNodeButton; } else if ([view isKindOfClass:[UITextField class]] || [view isKindOfClass:[UISearchBar class]] || - [view isKindOfClass:[UITextView class]] || [view isKindOfClass:[UISlider class]]) { + [view isKindOfClass:[UITextView class]]) { nodetype = kGrowingViewNodeInput; +#if Growing_OS_IOS || Growing_OS_MACCATALYST || Growing_OS_VISION + } else if ([view isKindOfClass:[UISlider class]]) { + nodetype = kGrowingViewNodeInput; +#endif } else if ([view isKindOfClass:[UICollectionViewCell class]] || [view isKindOfClass:[UITableViewCell class]]) { nodetype = kGrowingViewNodeList; } else if ([view isKindOfClass:NSClassFromString(@"WKWebView")]) { diff --git a/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h b/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h index ee497fd25..9bc7b3764 100644 --- a/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h +++ b/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h @@ -17,9 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" +#if Growing_USE_UIKIT NS_ASSUME_NONNULL_BEGIN @interface GrowingAppDelegateAutotracker : NSObject diff --git a/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m b/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m index ad6adbebb..466c6ea4e 100644 --- a/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m +++ b/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m @@ -17,9 +17,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h" -#import #import #import #import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" diff --git a/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h b/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h index 40c68d176..4af62eeef 100644 --- a/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h +++ b/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h @@ -17,9 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" +#if Growing_USE_UIKIT NS_ASSUME_NONNULL_BEGIN @interface GrowingSceneDelegateAutotracker : NSObject diff --git a/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m b/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m index 864da49f0..54226e3e2 100644 --- a/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m +++ b/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m @@ -17,9 +17,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h" -#import #import #import #import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" diff --git a/GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.m b/GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.m index fb8a87a21..0397ddf9e 100644 --- a/GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.m +++ b/GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.m @@ -19,6 +19,7 @@ #import "GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.h" #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" +#import "GrowingTargetConditionals.h" static NSString *kGrowingUserdefault_file = @"growingio.userdefault"; static NSString *kGrowingUserdefault_loginUserId = @"growingio.userdefault.loginUserId"; @@ -47,7 +48,7 @@ + (instancetype)sharedInstance { - (instancetype)init { if (self = [super init]) { NSString *suiteName = kGrowingUserdefault_file; -#if TARGET_OS_OSX +#if Growing_OS_OSX // 兼容非沙盒MacApp NSString *bundleId = [GrowingDeviceInfo currentDeviceInfo].bundleID; suiteName = [suiteName stringByAppendingFormat:@".%@", bundleId]; diff --git a/GrowingTrackerCore/FileStorage/GrowingFileStorage.m b/GrowingTrackerCore/FileStorage/GrowingFileStorage.m index 64bdb4853..7dc4c13cc 100644 --- a/GrowingTrackerCore/FileStorage/GrowingFileStorage.m +++ b/GrowingTrackerCore/FileStorage/GrowingFileStorage.m @@ -22,6 +22,7 @@ #import "GrowingTrackerCore/Public/GrowingServiceManager.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" +#import "GrowingTargetConditionals.h" NSString *const kGrowingResidentDirName = @"com.growingio.core"; NSString *const kGrowingDirCommonPrefix = @"com.growingio."; @@ -105,7 +106,7 @@ + (NSURL *)userDirectoryURL:(GrowingUserDirectory)directory { + (NSString *)fullPathWithName:(NSString *)dirName append:(NSString *_Nullable)lastPathComponent { NSString *fullPath = [NSString stringWithFormat:@"%@/%@%@", kGrowingResidentDirName, kGrowingDirCommonPrefix, dirName]; -#if TARGET_OS_OSX +#if Growing_OS_OSX // 兼容非沙盒MacApp NSString *bundleId = [GrowingDeviceInfo currentDeviceInfo].bundleID; fullPath = [fullPath stringByAppendingFormat:@"/%@", bundleId]; diff --git a/GrowingTrackerCore/GrowingRealTracker.m b/GrowingTrackerCore/GrowingRealTracker.m index 399bc6aee..56dc60622 100644 --- a/GrowingTrackerCore/GrowingRealTracker.m +++ b/GrowingTrackerCore/GrowingRealTracker.m @@ -37,6 +37,7 @@ #import "GrowingTrackerCore/Utils/GrowingArgumentChecker.h" #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" #import "GrowingULAppLifecycle.h" +#import "GrowingTargetConditionals.h" NSString *const GrowingTrackerVersionName = @"4.2.0"; const int GrowingTrackerVersionCode = 40200; @@ -64,7 +65,7 @@ - (instancetype)initWithConfiguration:(GrowingTrackConfiguration *)configuration [self loggerSetting]; [GrowingULAppLifecycle setup]; [GrowingSession startSession]; -#if TARGET_OS_IOS +#if Growing_OS_IOS [GrowingAppDelegateAutotracker track]; #endif [[GrowingModuleManager sharedInstance] registerAllModules]; diff --git a/GrowingTrackerCore/GrowingWindow.h b/GrowingTrackerCore/GrowingWindow.h index a834a587e..3dfc63a55 100644 --- a/GrowingTrackerCore/GrowingWindow.h +++ b/GrowingTrackerCore/GrowingWindow.h @@ -17,9 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" +#if Growing_USE_UIKIT @interface GrowingWindowView : UIView @property (nonatomic, assign) CGFloat growingViewLevel; diff --git a/GrowingTrackerCore/GrowingWindow.m b/GrowingTrackerCore/GrowingWindow.m index 032f137ab..c9fb1ab15 100644 --- a/GrowingTrackerCore/GrowingWindow.m +++ b/GrowingTrackerCore/GrowingWindow.m @@ -17,7 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/GrowingWindow.h" #import "GrowingULApplication.h" diff --git a/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h b/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h index d84f6120a..5b92cc1e0 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h +++ b/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h @@ -17,9 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" +#if Growing_USE_UIKIT @interface UIApplication (GrowingHelper) - (NSArray *)growingHelper_allWindowsWithoutGrowingWindow; diff --git a/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.m b/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.m index 196c42fa6..80e72ed92 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.m +++ b/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.m @@ -17,7 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/GrowingWindow.h" #import "GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h" #import "GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h" diff --git a/GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.h b/GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.h index 4626e0f42..3050ab84c 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.h +++ b/GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.h @@ -17,9 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" +#if Growing_USE_UIKIT @interface UIImage (GrowingHelper) - (NSData *)growingHelper_JPEG:(CGFloat)compress; diff --git a/GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.m b/GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.m index d164fe843..66c9d5896 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.m +++ b/GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.m @@ -17,7 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.h" @implementation UIImage (GrowingHelper) diff --git a/GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.h b/GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.h index 66a82d1b6..a644183de 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.h +++ b/GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.h @@ -17,9 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" +#if Growing_USE_UIKIT @interface UIView (GrowingHelper) - (UIViewController *)growingHelper_viewController; diff --git a/GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.m b/GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.m index 9a4f01517..314f63c05 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.m +++ b/GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.m @@ -17,7 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.h" @implementation UIView (GrowingHelper) diff --git a/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h b/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h index c2931746b..c0c47a8dc 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h +++ b/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h @@ -17,9 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" +#if Growing_USE_UIKIT @interface UIWindow (GrowingHelper) + (UIImage *)growingHelper_screenshotWithWindows:(NSArray *)windows andMaxScale:(CGFloat)maxScale; diff --git a/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.m b/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.m index b777fd5d5..3185b586b 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.m +++ b/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.m @@ -17,7 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.h" #import "GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h" diff --git a/GrowingTrackerCore/Menu/GrowingAlert.h b/GrowingTrackerCore/Menu/GrowingAlert.h index 448ebf3df..1e4f55dad 100644 --- a/GrowingTrackerCore/Menu/GrowingAlert.h +++ b/GrowingTrackerCore/Menu/GrowingAlert.h @@ -16,9 +16,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" +#if Growing_USE_UIKIT NS_ASSUME_NONNULL_BEGIN @interface GrowingAlert : NSObject diff --git a/GrowingTrackerCore/Menu/GrowingAlert.m b/GrowingTrackerCore/Menu/GrowingAlert.m index a66cf16e0..c49ce7e07 100644 --- a/GrowingTrackerCore/Menu/GrowingAlert.m +++ b/GrowingTrackerCore/Menu/GrowingAlert.m @@ -16,7 +16,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/Menu/GrowingAlert.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" #import "GrowingULApplication.h" diff --git a/GrowingTrackerCore/Menu/GrowingStatusBar.h b/GrowingTrackerCore/Menu/GrowingStatusBar.h index 5df19a902..bbaff78cc 100644 --- a/GrowingTrackerCore/Menu/GrowingStatusBar.h +++ b/GrowingTrackerCore/Menu/GrowingStatusBar.h @@ -17,8 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() -#import +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/GrowingWindow.h" @interface GrowingStatusBar : GrowingWindowView diff --git a/GrowingTrackerCore/Menu/GrowingStatusBar.m b/GrowingTrackerCore/Menu/GrowingStatusBar.m index 91dd7e71f..836cf0437 100644 --- a/GrowingTrackerCore/Menu/GrowingStatusBar.m +++ b/GrowingTrackerCore/Menu/GrowingStatusBar.m @@ -17,7 +17,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if __has_include() +#import "GrowingTargetConditionals.h" + +#if Growing_USE_UIKIT #import "GrowingTrackerCore/Menu/GrowingStatusBar.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" #import "GrowingULApplication.h" diff --git a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m index d5cca49f2..53f254610 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m +++ b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m @@ -19,8 +19,9 @@ #import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" #import "GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h" +#import "GrowingTargetConditionals.h" -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST +#if Growing_OS_PURE_IOS #import #endif @@ -31,7 +32,7 @@ @interface GrowingNetworkInterfaceManager () @property (nonatomic, assign, readwrite) BOOL WiFiValid; @property (nonatomic, assign, readwrite) BOOL isReachable; -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST +#if Growing_OS_PURE_IOS @property (nonatomic, strong) CTTelephonyNetworkInfo *teleInfo; #endif @@ -54,7 +55,7 @@ - (instancetype)init { _internetReachability = [GrowingReachability reachabilityForInternetConnection]; [_internetReachability startNotifier]; -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST +#if Growing_OS_PURE_IOS _teleInfo = [[CTTelephonyNetworkInfo alloc] init]; #endif } @@ -72,7 +73,7 @@ - (NSString *)networkType { GrowingNetworkStatus netStatus = self.internetReachability.networkStatus; if (netStatus == GrowingReachabilityViaWiFi) { return @"WIFI"; -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST +#if Growing_OS_PURE_IOS } else if (netStatus == GrowingReachabilityViaWWAN) { NSArray *typeStrings4G = @[CTRadioAccessTechnologyLTE]; NSString *accessString = CTRadioAccessTechnologyLTE; // default 4G diff --git a/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h b/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h index f246fd089..9ded84a82 100644 --- a/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h +++ b/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h @@ -6,8 +6,8 @@ Basic demonstration of how to use the SystemConfiguration Reachablity APIs. */ -#import -#if !TARGET_OS_WATCH +#import "GrowingTargetConditionals.h" +#if !Growing_OS_WATCH #import #endif diff --git a/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.m b/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.m index 88ea351e3..76e36da4a 100644 --- a/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.m +++ b/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.m @@ -19,7 +19,7 @@ #import "GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h" #import -#if !TARGET_OS_WATCH +#if !Growing_OS_WATCH static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *info); @@ -28,7 +28,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, @interface GrowingReachability () @property (nonatomic, assign, readwrite) GrowingNetworkStatus networkStatus; -#if !TARGET_OS_WATCH +#if !Growing_OS_WATCH @property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; #endif @@ -39,7 +39,7 @@ @implementation GrowingReachability - (instancetype)initWithAddress:(const struct sockaddr *)hostAddress { if (self = [super init]) { _networkStatus = GrowingReachabilityUnknown; -#if !TARGET_OS_WATCH +#if !Growing_OS_WATCH SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, hostAddress); if (reachability) { @@ -66,7 +66,7 @@ + (instancetype)reachabilityForInternetConnection { #pragma mark - Start and stop notifier - (BOOL)startNotifier { -#if TARGET_OS_WATCH +#if Growing_OS_WATCH return NO; #else if (!_reachabilityRef) { @@ -93,7 +93,7 @@ - (BOOL)startNotifier { } - (void)stopNotifier { -#if !TARGET_OS_WATCH +#if !Growing_OS_WATCH if (!_reachabilityRef) { return; } @@ -106,15 +106,17 @@ - (void)stopNotifier { - (void)dealloc { [self stopNotifier]; +#if !Growing_OS_WATCH if (_reachabilityRef) { CFRelease(_reachabilityRef); _reachabilityRef = nil; } +#endif } #pragma mark - Network Flag Handling -#if !TARGET_OS_WATCH +#if !Growing_OS_WATCH - (GrowingNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags { if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) { // The target host is not reachable. @@ -136,7 +138,7 @@ - (GrowingNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags } } -#if TARGET_OS_IOS || TARGET_OS_TV || (defined(TARGET_OS_VISION) && TARGET_OS_VISION) +#if Growing_OS_IOS || Growing_OS_TV || Growing_OS_VISION if (returnValue == GrowingReachabilityViaWiFi) { // is reachable... if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) { @@ -159,7 +161,7 @@ - (void)reachabilityFlagsChanged:(SCNetworkReachabilityFlags)flags { @end -#if !TARGET_OS_WATCH +#if !Growing_OS_WATCH static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void *info) { diff --git a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m index c8fea790f..e4e69f09a 100644 --- a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m +++ b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m @@ -18,17 +18,7 @@ // limitations under the License. #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" - -#if __has_include() -#import -#endif - -#if __has_include() -#import -#endif - -#import -#import +#import "GrowingTargetConditionals.h" #import #import @@ -85,21 +75,24 @@ - (instancetype)init { _appState = 0; _timezoneOffset = -([[NSTimeZone defaultTimeZone] secondsFromGMT] / 60); -#if TARGET_OS_OSX +#if Growing_USE_APPKIT _screenWidth = NSScreen.mainScreen.frame.size.width; _screenHeight = NSScreen.mainScreen.frame.size.height; -#elif TARGET_OS_IOS || TARGET_OS_MACCATALYST +#elif Growing_USE_UIKIT UIScreen *screen = [UIScreen mainScreen]; CGFloat width = screen.bounds.size.width * screen.scale; CGFloat height = screen.bounds.size.height * screen.scale; // make sure the size is in portrait to keep consistency _screenWidth = MIN(width, height); _screenHeight = MAX(width, height); +#elif Growing_USE_WATCHKIT + _screenWidth = WKInterfaceDevice.currentDevice.screenBounds.size.width; + _screenHeight = WKInterfaceDevice.currentDevice.screenBounds.size.height; #endif [[GrowingULAppLifecycle sharedInstance] addAppLifecycleDelegate:self]; -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST +#if Growing_OS_PURE_IOS [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleStatusBarOrientationChange:) name:UIApplicationDidChangeStatusBarOrientationNotification @@ -139,7 +132,8 @@ - (NSString *)getCurrentUrlScheme { } - (NSString *)getDeviceIdString { -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST + // TODO: tvOS/visionOS support +#if Growing_OS_PURE_IOS || Growing_OS_WATCH NSString *deviceIdString = [GrowingKeyChainWrapper keyChainObjectForKey:kGrowingKeychainUserIdKey]; if ([deviceIdString growingHelper_isValidU]) { return deviceIdString; @@ -147,7 +141,7 @@ - (NSString *)getDeviceIdString { #endif NSString *uuid = [GrowingUserIdentifier getUserIdentifier]; -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST +#if Growing_OS_PURE_IOS || Growing_OS_WATCH [GrowingKeyChainWrapper setKeychainObject:uuid forKey:kGrowingKeychainUserIdKey]; #endif return uuid; @@ -166,7 +160,7 @@ + (NSString *)getSysInfoByName:(char *)name { return results ?: @""; } -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST +#if Growing_OS_PURE_IOS - (void)handleStatusBarOrientationChange:(NSNotification *)notification { UIInterfaceOrientation orientation = [[GrowingULApplication sharedApplication] statusBarOrientation]; if (orientation != UIInterfaceOrientationUnknown) { @@ -177,15 +171,17 @@ - (void)handleStatusBarOrientationChange:(NSNotification *)notification { - (void)updateAppState { dispatch_block_t block = ^{ -#if TARGET_OS_OSX +#if Growing_USE_APPKIT self->_appState = [[GrowingULApplication sharedApplication] isActive] ? 0 : 1; -#elif TARGET_OS_IOS || TARGET_OS_MACCATALYST +#elif Growing_USE_UIKIT self->_appState = [[GrowingULApplication sharedApplication] applicationState] == UIApplicationStateActive ? 0 : 1; +#elif Growing_USE_WATCHKIT + self->_appState = [WKApplication sharedApplication].applicationState == WKApplicationStateActive ? 0 : 1; #endif }; -#if !TARGET_OS_OSX +#if !Growing_OS_OSX if (@available(iOS 13.0, *)) { // iOS 13当收到UISceneWillDeactivateNotification/UISceneDidActivateNotification时,applicationState并未转换 NSDictionary *sceneManifestDict = _infoDictionary[@"UIApplicationSceneManifest"]; @@ -251,12 +247,14 @@ - (NSString *)language { - (NSString *)deviceModel { if (!_deviceModel) { -#if TARGET_OS_OSX || TARGET_OS_MACCATALYST +#if Growing_USE_APPKIT || Growing_OS_MACCATALYST _deviceModel = [GrowingDeviceInfo getSysInfoByName:(char *)"hw.model"]; -#elif TARGET_OS_IOS +#elif Growing_USE_UIKIT struct utsname systemInfo; uname(&systemInfo); _deviceModel = @(systemInfo.machine); +#elif Growing_USE_WATCHKIT + _deviceModel = [GrowingDeviceInfo getSysInfoByName:(char *)"hw.machine"]; #endif } return _deviceModel; @@ -264,10 +262,12 @@ - (NSString *)deviceModel { - (NSString *)deviceType { if (!_deviceType) { -#if TARGET_OS_OSX || TARGET_OS_MACCATALYST +#if Growing_USE_APPKIT || Growing_OS_MACCATALYST _deviceType = @"Mac"; -#elif TARGET_OS_IOS +#elif Growing_USE_UIKIT _deviceType = [UIDevice currentDevice].model; +#elif Growing_USE_WATCHKIT + _deviceType = [WKInterfaceDevice currentDevice].model; #endif } return _deviceType; @@ -275,12 +275,18 @@ - (NSString *)deviceType { - (NSString *)platform { if (!_platform) { -#if TARGET_OS_OSX +#if Growing_OS_OSX _platform = @"macOS"; -#elif TARGET_OS_MACCATALYST +#elif Growing_OS_MACCATALYST _platform = @"MacCatalyst"; -#elif TARGET_OS_IOS +#elif Growing_OS_PURE_IOS _platform = @"iOS"; +#elif Growing_OS_WATCH + _platform = @"watchOS"; +#elif Growing_OS_TV + _platform = @"tvOS"; +#elif Growing_OS_VISION + _platform = @"visionOS"; #endif } return _platform; @@ -288,12 +294,14 @@ - (NSString *)platform { - (NSString *)platformVersion { if (!_platformVersion) { -#if TARGET_OS_OSX || TARGET_OS_MACCATALYST +#if Growing_USE_APPKIT || Growing_OS_MACCATALYST NSDictionary *dic = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; _platformVersion = dic[@"ProductVersion"]; -#elif TARGET_OS_IOS +#elif Growing_USE_UIKIT _platformVersion = [UIDevice currentDevice].systemVersion; +#elif Growing_USE_WATCHKIT + _platformVersion = [WKInterfaceDevice currentDevice].systemVersion; #endif } return _platformVersion; @@ -322,9 +330,8 @@ - (NSString *)urlScheme { - (NSString *)deviceOrientation { if (!_deviceOrientation) { -#if TARGET_OS_OSX || TARGET_OS_MACCATALYST _deviceOrientation = @"PORTRAIT"; -#elif TARGET_OS_IOS +#if Growing_OS_PURE_IOS dispatch_block_t block = ^{ UIInterfaceOrientation orientation = [[GrowingULApplication sharedApplication] statusBarOrientation]; if (orientation != UIInterfaceOrientationUnknown) { diff --git a/GrowingTrackerCore/Utils/GrowingInternalMacros.h b/GrowingTrackerCore/Utils/GrowingInternalMacros.h index a003673ea..37a86d6b2 100644 --- a/GrowingTrackerCore/Utils/GrowingInternalMacros.h +++ b/GrowingTrackerCore/Utils/GrowingInternalMacros.h @@ -42,7 +42,7 @@ #import #define GROWING_USE_OS_UNFAIR_LOCK \ - TARGET_OS_MACCATALYST || (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0) || \ + Growing_OS_MACCATALYST || (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0) || \ (__MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12) || (__TV_OS_VERSION_MIN_REQUIRED >= __TVOS_10_0) || \ (__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0) diff --git a/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m b/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m index 640afc5b0..d0e316c3e 100644 --- a/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m +++ b/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m @@ -19,24 +19,21 @@ #import "GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" - -#if __has_include() -#import -#endif +#import "GrowingTargetConditionals.h" @implementation GrowingUserIdentifier + (NSString *)getUserIdentifier { NSString *uuid = nil; -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST - NSString *idfaString = [self idfa]; - if (!idfaString.growingHelper_isValidU) { - idfaString = [self idfv]; - } - uuid = idfaString; -#else +#if Growing_OS_OSX || Growing_OS_MACCATALYST uuid = [self platformUUID]; +#elif Growing_USE_UIKIT || Growing_USE_WATCHKIT + uuid = [self idfa]; + if (!uuid.growingHelper_isValidU) { + uuid = [self idfv]; + } #endif + // 失败了随机生成 UUID if (!uuid.length || !uuid.growingHelper_isValidU) { uuid = [[NSUUID UUID] UUIDString]; @@ -45,15 +42,18 @@ + (NSString *)getUserIdentifier { } + (nullable NSString *)idfv { -#if TARGET_OS_IOS +#if Growing_USE_UIKIT return [[UIDevice currentDevice].identifierForVendor UUIDString]; -#endif +#elif Growing_USE_WATCHKIT + return [[WKInterfaceDevice currentDevice].identifierForVendor UUIDString]; +#else return @""; +#endif } + (NSString *)idfa { NSString *idfa = @""; -#if TARGET_OS_IOS +#if Growing_OS_PURE_IOS #ifndef GROWING_ANALYSIS_DISABLE_IDFA Class class = NSClassFromString([@"ASIden" stringByAppendingString:@"tifierManager"]); if (!class) { @@ -77,8 +77,8 @@ + (NSString *)idfa { return idfa; } -#if TARGET_OS_OSX || TARGET_OS_MACCATALYST + (nullable NSString *)platformUUID { +#if Growing_OS_OSX || Growing_OS_MACCATALYST io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); if (service) { @@ -90,8 +90,8 @@ + (nullable NSString *)platformUUID { return string; } } +#endif return nil; } -#endif @end diff --git a/Package.swift b/Package.swift index a905ca7ab..47378f0b2 100644 --- a/Package.swift +++ b/Package.swift @@ -24,7 +24,13 @@ import PackageDescription let package = Package( name: "GrowingAnalytics", - platforms: [.iOS(.v10), .macCatalyst(.v13), .macOS(.v10_12), .watchOS(.v7)], + platforms: [ + .iOS(.v10), + .macCatalyst(.v13), + .macOS(.v10_12), + .tvOS(.v10), + .watchOS(.v7) + ], products: [ .autotracker, .tracker, @@ -295,12 +301,12 @@ extension Target { } extension Target.Dependency { - static let autotracker_objc = byName(name: .autotracker_objc, condition: .when(platforms: [.iOS, .macCatalyst])) + static let autotracker_objc = byName(name: .autotracker_objc, condition: .when(platforms: [.iOS, .macCatalyst, .tvOS])) static let tracker_objc = byName(name: .tracker_objc) static let autotrackerUtils = product(name: "GrowingUtilsAutotrackerCore", package: "growingio-sdk-ios-utilities") static let trackerUtils = product(name: "GrowingUtilsTrackerCore", package: "growingio-sdk-ios-utilities") - static let apm = product(name: "GrowingAPM", package: "growingio-sdk-ios-performance-ext") + static let apm = product(name: "GrowingAPM", package: "growingio-sdk-ios-performance-ext", condition: .when(platforms: [.iOS])) static let protobuf = product(name: "SwiftProtobuf", package: "swift-protobuf") enum Resources { @@ -309,7 +315,7 @@ extension Target.Dependency { } enum Core { - static let autotrackerCore = byName(name: .autotrackerCore, condition: .when(platforms: [.iOS, .macCatalyst])) + static let autotrackerCore = byName(name: .autotrackerCore, condition: .when(platforms: [.iOS, .macCatalyst, .tvOS])) static let trackerCore = byName(name: .trackerCore) } @@ -326,7 +332,7 @@ extension Target.Dependency { static let protobuf = byName(name: .protobuf) static let swiftProtobuf = byName(name: .swiftProtobuf) static let network = byName(name: .network) - static let webSocket = byName(name: .webSocket) + static let webSocket = byName(name: .webSocket, condition: .when(platforms: [.iOS])) static let compress = byName(name: .compress) static let encrypt = byName(name: .encrypt) static let screenshot = byName(name: .screenshot, condition: .when(platforms: [.iOS])) diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift new file mode 100644 index 000000000..b12d0c19d --- /dev/null +++ b/Package@swift-5.9.swift @@ -0,0 +1,427 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// +// Package.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/2. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import PackageDescription + +let package = Package( + name: "GrowingAnalytics", + platforms: [ + .iOS(.v12), + .macCatalyst(.v13), + .macOS(.v10_14), + .tvOS(.v12), + .watchOS(.v7), + .visionOS(.v1) + ], + products: [ + .autotracker, + .tracker, + .Module.imp, + .Module.hybrid, + .Module.ads, + .Module.apm, + .Module.abTesting, + ], + dependencies: [ + .package( + url: "https://github.com/growingio/growingio-sdk-ios-utilities.git", + "1.2.0" ..< "1.3.0" + ), + .package( + url: "https://github.com/growingio/growingio-sdk-ios-performance-ext.git", + "1.0.0" ..< "1.1.0" + ), + .package( + url: "https://github.com/apple/swift-protobuf.git", + from: "1.21.0" + ), + ], + targets: [ + // MARK: - Objc Headers + + .autotracker_objc, + .tracker_objc, + + // MARK: - Swift Wrapper + + .autotracker, + .tracker, + + // MARK: - Resources + + .Resources.privacy, + .Resources.privacy_macos, + + // MARK: - Core + + .Core.trackerCore, + .Core.autotrackerCore, + + // MARK: - Modules + + .Module.coreServices, + .Module.mobileDebugger, + .Module.webCircle, + .Module.imp, + .Module.hybrid, + .Module.ads, + .Module.apm, + .Module.abTesting, + + // MARK: - Services + + .Service.database, + .Service.JSON, + .Service.protobuf, + .Service.swiftProtobuf, + .Service.network, + .Service.webSocket, + .Service.compress, + .Service.encrypt, + .Service.screenshot, + ] +) + +extension Product { + static let autotracker = library(name: .autotracker, targets: [.autotracker]) + static let tracker = library(name: .tracker, targets: [.tracker]) + + enum Module { + static let imp = library(name: .imp, targets: [.imp]) + static let hybrid = library(name: .hybrid, targets: [.hybrid]) + static let ads = library(name: .ads, targets: [.ads]) + static let apm = library(name: .apm, targets: [.apm]) + static let abTesting = library(name: .abTesting, targets: [.abTesting]) + } +} + +extension Target { + static let autotracker = target(name: .autotracker, + dependencies: [ + .autotracker_objc, + .Module.coreServices, + .Module.hybrid, + .Module.mobileDebugger, + .Module.webCircle, + ], + path: .Path.autotracker) + + static let tracker = target(name: .tracker, + dependencies: [ + .tracker_objc, + .Module.coreServices, + .Module.mobileDebugger, + ], + path: .Path.tracker) + + static let autotracker_objc = target(name: .autotracker_objc, + dependencies: [.Core.autotrackerCore], + path: .Path.autotracker_objc, + publicHeadersPath: ".", + cSettings: [.hspFor(.Path.autotracker_objc)]) + + static let tracker_objc = target(name: .tracker_objc, + dependencies: [.Core.trackerCore], + path: .Path.tracker_objc, + publicHeadersPath: ".", + cSettings: [.hspFor(.Path.tracker_objc)]) + + enum Resources { + static let privacy = target(name: .privacy, + path: .Path.privacy, + resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) + + static let privacy_macos = target(name: .privacy_macos, + path: .Path.privacy_macos, + resources: [.copy("Resources/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy")]) + } + + enum Core { + static let autotrackerCore = target(name: .autotrackerCore, + dependencies: [ + .Core.trackerCore, + .autotrackerUtils, + ], + path: .Path.autotrackerCore, + publicHeadersPath: .Path.publicHeaders, + cSettings: [.hspFor(.Path.autotrackerCore)]) + + static let trackerCore = target(name: .trackerCore, + dependencies: [ + .trackerUtils, + .Resources.privacy, + .Resources.privacy_macos, + ], + path: .Path.trackerCore, + publicHeadersPath: .Path.publicHeaders, + cSettings: [.hspFor(.Path.trackerCore)], + linkerSettings: [ + .cPlusPlusLibrary, + .UIKit, + ]) + } + + enum Module { + static let coreServices = target(name: .coreServices, + dependencies: [ + .Core.trackerCore, + .Service.JSON, + .Service.protobuf, + .Service.network, + .Service.encrypt, + .Service.compress, + ], + path: .Path.coreServices, + cSettings: [.hspFor(.Path.coreServices)]) + + static let mobileDebugger = target(name: .mobileDebugger, + dependencies: [ + .Core.trackerCore, + .Service.webSocket, + .Service.screenshot, + ], + path: .Path.mobileDebugger, + cSettings: [.hspFor(.Path.mobileDebugger)]) + + static let webCircle = target(name: .webCircle, + dependencies: [ + .Core.autotrackerCore, + .Service.webSocket, + .Service.screenshot, + .Module.hybrid, + ], + path: .Path.webCircle, + cSettings: [.hspFor(.Path.webCircle)]) + + static let imp = target(name: .imp, + dependencies: [.Core.autotrackerCore], + path: .Path.imp, + publicHeadersPath: .Path.publicHeaders, + cSettings: [.hspFor(.Path.imp)]) + + static let hybrid = target(name: .hybrid, + dependencies: [.Core.trackerCore], + path: .Path.hybrid, + publicHeadersPath: .Path.publicHeaders, + cSettings: [.hspFor(.Path.hybrid)], + linkerSettings: [.WebKit]) + + static let ads = target(name: .ads, + dependencies: [.Core.trackerCore], + path: .Path.ads, + publicHeadersPath: .Path.publicHeaders, + cSettings: [.hspFor(.Path.ads)]) + + static let apm = target(name: .apm, + dependencies: [ + .Core.trackerCore, + .apm, + ], + path: .Path.apm, + publicHeadersPath: .Path.publicHeaders, + cSettings: [.hspFor(.Path.apm)]) + + static let abTesting = target(name: .abTesting, + dependencies: [.Core.trackerCore], + path: .Path.abTesting, + publicHeadersPath: .Path.publicHeaders, + cSettings: [.hspFor(.Path.abTesting)]) + } + + enum Service { + static let database = target(name: .database, + dependencies: [.Core.trackerCore], + path: .Path.database, + cSettings: [.hspFor(.Path.database)]) + + static let JSON = target(name: .JSON, + dependencies: [.Service.database], + path: .Path.JSON, + cSettings: [.hspFor(.Path.JSON)]) + + static let protobuf = target(name: .protobuf, + dependencies: [ + .Service.database, + .Service.swiftProtobuf, + ], + path: .Path.protobuf, + exclude: ["Proto", "Catagory"], + cSettings: [.hspFor(.Path.protobuf)]) + + static let swiftProtobuf = target(name: .swiftProtobuf, + dependencies: [ + .Core.trackerCore, + .protobuf, + ], + path: .Path.swiftProtobuf) + + static let network = target(name: .network, + dependencies: [.Core.trackerCore], + path: .Path.network, + cSettings: [.hspFor(.Path.network)]) + + static let webSocket = target(name: .webSocket, + dependencies: [.Core.trackerCore], + path: .Path.webSocket, + cSettings: [.hspFor(.Path.webSocket)]) + + static let compress = target(name: .compress, + dependencies: [.Core.trackerCore], + path: .Path.compress, + cSettings: [.hspFor(.Path.compress)]) + + static let encrypt = target(name: .encrypt, + dependencies: [.Core.trackerCore], + path: .Path.encrypt, + cSettings: [.hspFor(.Path.encrypt)]) + + static let screenshot = target(name: .screenshot, + dependencies: [.Core.trackerCore], + path: .Path.screenshot, + cSettings: [.hspFor(.Path.screenshot)]) + } +} + +extension Target.Dependency { + static let autotracker_objc = byName(name: .autotracker_objc, condition: .when(platforms: [.iOS, .macCatalyst, .tvOS])) + static let tracker_objc = byName(name: .tracker_objc) + + static let autotrackerUtils = product(name: "GrowingUtilsAutotrackerCore", package: "growingio-sdk-ios-utilities") + static let trackerUtils = product(name: "GrowingUtilsTrackerCore", package: "growingio-sdk-ios-utilities") + static let apm = product(name: "GrowingAPM", package: "growingio-sdk-ios-performance-ext", condition: .when(platforms: [.iOS])) + static let protobuf = product(name: "SwiftProtobuf", package: "swift-protobuf") + + enum Resources { + static let privacy = byName(name: .privacy, condition: .when(platforms: [.iOS, .macCatalyst])) + static let privacy_macos = byName(name: .privacy_macos, condition: .when(platforms: [.macOS])) + } + + enum Core { + static let autotrackerCore = byName(name: .autotrackerCore, condition: .when(platforms: [.iOS, .macCatalyst, .tvOS])) + static let trackerCore = byName(name: .trackerCore) + } + + enum Module { + static let coreServices = byName(name: .coreServices) + static let mobileDebugger = byName(name: .mobileDebugger, condition: .when(platforms: [.iOS])) + static let webCircle = byName(name: .webCircle, condition: .when(platforms: [.iOS])) + static let hybrid = byName(name: .hybrid, condition: .when(platforms: [.iOS, .macCatalyst])) + } + + enum Service { + static let database = byName(name: .database) + static let JSON = byName(name: .JSON) + static let protobuf = byName(name: .protobuf) + static let swiftProtobuf = byName(name: .swiftProtobuf) + static let network = byName(name: .network) + static let webSocket = byName(name: .webSocket, condition: .when(platforms: [.iOS])) + static let compress = byName(name: .compress) + static let encrypt = byName(name: .encrypt) + static let screenshot = byName(name: .screenshot, condition: .when(platforms: [.iOS])) + } +} + +extension CSetting { + static func hspFor(_ path: String) -> PackageDescription.CSetting { + let count = path.filter { $0 == "/" }.count + return count == 0 ? headerSearchPath("..") : headerSearchPath("../..") + } +} + +extension LinkerSetting { + static let cPlusPlusLibrary = linkedLibrary("c++") + static let UIKit = linkedFramework("UIKit", .when(platforms: [.iOS, .macCatalyst])) + static let WebKit = linkedFramework("WebKit", .when(platforms: [.iOS, .macCatalyst])) +} + +extension String { + static let autotracker = "GrowingAutotracker" + static let tracker = "GrowingTracker" + static let autotracker_objc = "GrowingAutotracker_Objc" + static let tracker_objc = "GrowingTracker_Objc" + + // Resources + static let privacy = "GrowingPrivacy" + static let privacy_macos = "GrowingPrivacy_macOS" + + // Core + static let autotrackerCore = "GrowingAutotrackerCore" + static let trackerCore = "GrowingTrackerCore" + + // Modules + static let coreServices = "GrowingModule_DefaultServices" + static let mobileDebugger = "GrowingModule_MobileDebugger" + static let webCircle = "GrowingModule_WebCircle" + static let imp = "GrowingModule_ImpressionTrack" + static let hybrid = "GrowingModule_Hybrid" + static let ads = "GrowingModule_Ads" + static let apm = "GrowingModule_APM" + static let abTesting = "GrowingModule_ABTesting" + + // Services + static let database = "GrowingService_Database" + static let JSON = "GrowingService_JSON" + static let protobuf = "GrowingService_Protobuf" + static let swiftProtobuf = "GrowingService_SwiftProtobuf" + static let network = "GrowingService_Network" + static let webSocket = "GrowingService_WebSocket" + static let compress = "GrowingService_Compression" + static let encrypt = "GrowingService_Encryption" + static let screenshot = "GrowingService_Screenshot" + + enum Path { + static let publicHeaders = "Public" + static let autotracker = "SwiftPM-Wrap/GrowingAutotracker" + static let tracker = "SwiftPM-Wrap/GrowingTracker" + static let autotracker_objc = "GrowingAutotracker" + static let tracker_objc = "GrowingTracker" + + // Resources + static let privacy = "SwiftPM-Wrap/GrowingPrivacy-Wrapper" + static let privacy_macos = "SwiftPM-Wrap/GrowingPrivacy-macOS-Wrapper" + + // Core + static let autotrackerCore = "GrowingAutotrackerCore" + static let trackerCore = "GrowingTrackerCore" + + // Modules + static let mobileDebugger = "Modules/MobileDebugger" + static let webCircle = "Modules/WebCircle" + static let imp = "Modules/ImpressionTrack" + static let hybrid = "Modules/Hybrid" + static let ads = "Modules/Advertising" + static let apm = "Modules/APM" + static let abTesting = "Modules/ABTesting" + static let coreServices = "Modules/DefaultServices" + + // Services + static let database = "Services/Database" + static let JSON = "Services/JSON" + static let protobuf = "Services/Protobuf" + static let swiftProtobuf = "Services/SwiftProtobuf" + static let network = "Services/Network" + static let webSocket = "Services/WebSocket" + static let compress = "Services/Compression" + static let encrypt = "Services/Encryption" + static let screenshot = "Services/Screenshot" + } +} From 6513ea4877d8dd06b49e20d34448727bdbe759eb Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Fri, 2 Feb 2024 11:04:11 +0000 Subject: [PATCH 03/36] style: code format --- .../Autotrack/UIApplication+GrowingAutotracker.m | 4 ++-- GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m | 2 +- GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m | 2 +- .../Event/Tools/GrowingPersistenceDataProvider.m | 2 +- GrowingTrackerCore/FileStorage/GrowingFileStorage.m | 2 +- GrowingTrackerCore/GrowingRealTracker.m | 2 +- GrowingTrackerCore/Menu/GrowingStatusBar.m | 2 +- GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m | 2 +- GrowingTrackerCore/Utils/GrowingInternalMacros.h | 2 +- .../Utils/UserIdentifier/GrowingUserIdentifier.m | 4 ++-- Package.swift | 2 +- Package@swift-5.9.swift | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.m b/GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.m index 66be80f28..20cb113f7 100644 --- a/GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.m +++ b/GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.m @@ -20,9 +20,9 @@ #import "GrowingAutotrackerCore/Autotrack/UIApplication+GrowingAutotracker.h" #import "GrowingAutotrackerCore/GrowingNode/GrowingViewChangeProvider.h" #import "GrowingAutotrackerCore/GrowingNode/GrowingViewClickProvider.h" +#import "GrowingTargetConditionals.h" #import "GrowingTrackerCore/Event/GrowingNodeProtocol.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" -#import "GrowingTargetConditionals.h" @implementation UIApplication (GrowingAutotracker) @@ -55,7 +55,7 @@ - (void)growing_trackAction:(SEL)action to:(id)target from:(id)sender forEvent:( [sender isKindOfClass:UISegmentedControl.class]) { return; } - + NSObject *node = (NSObject *)sender; if ([sender isKindOfClass:UIPageControl.class]) { [GrowingViewClickProvider viewOnClick:(UIView *)node]; diff --git a/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m b/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m index 466c6ea4e..9f0e17d91 100644 --- a/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m +++ b/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m @@ -20,9 +20,9 @@ #import "GrowingTargetConditionals.h" #if Growing_USE_UIKIT -#import "GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h" #import #import +#import "GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h" #import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" #import "GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" diff --git a/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m b/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m index 54226e3e2..c73b8336e 100644 --- a/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m +++ b/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m @@ -20,10 +20,10 @@ #import "GrowingTargetConditionals.h" #if Growing_USE_UIKIT -#import "GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h" #import #import #import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" @implementation GrowingSceneDelegateAutotracker diff --git a/GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.m b/GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.m index 0397ddf9e..8aceb645a 100644 --- a/GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.m +++ b/GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.m @@ -18,8 +18,8 @@ // limitations under the License. #import "GrowingTrackerCore/Event/Tools/GrowingPersistenceDataProvider.h" -#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" #import "GrowingTargetConditionals.h" +#import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" static NSString *kGrowingUserdefault_file = @"growingio.userdefault"; static NSString *kGrowingUserdefault_loginUserId = @"growingio.userdefault.loginUserId"; diff --git a/GrowingTrackerCore/FileStorage/GrowingFileStorage.m b/GrowingTrackerCore/FileStorage/GrowingFileStorage.m index 7dc4c13cc..acec948f5 100644 --- a/GrowingTrackerCore/FileStorage/GrowingFileStorage.m +++ b/GrowingTrackerCore/FileStorage/GrowingFileStorage.m @@ -18,11 +18,11 @@ // limitations under the License. #import "GrowingTrackerCore/FileStorage/GrowingFileStorage.h" +#import "GrowingTargetConditionals.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" #import "GrowingTrackerCore/Public/GrowingServiceManager.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" -#import "GrowingTargetConditionals.h" NSString *const kGrowingResidentDirName = @"com.growingio.core"; NSString *const kGrowingDirCommonPrefix = @"com.growingio."; diff --git a/GrowingTrackerCore/GrowingRealTracker.m b/GrowingTrackerCore/GrowingRealTracker.m index 56dc60622..9bf7196d7 100644 --- a/GrowingTrackerCore/GrowingRealTracker.m +++ b/GrowingTrackerCore/GrowingRealTracker.m @@ -18,6 +18,7 @@ // limitations under the License. #import "GrowingTrackerCore/GrowingRealTracker.h" +#import "GrowingTargetConditionals.h" #import "GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h" #import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" #import "GrowingTrackerCore/Event/GrowingEventGenerator.h" @@ -37,7 +38,6 @@ #import "GrowingTrackerCore/Utils/GrowingArgumentChecker.h" #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" #import "GrowingULAppLifecycle.h" -#import "GrowingTargetConditionals.h" NSString *const GrowingTrackerVersionName = @"4.2.0"; const int GrowingTrackerVersionCode = 40200; diff --git a/GrowingTrackerCore/Menu/GrowingStatusBar.m b/GrowingTrackerCore/Menu/GrowingStatusBar.m index 836cf0437..b3fd2ce4b 100644 --- a/GrowingTrackerCore/Menu/GrowingStatusBar.m +++ b/GrowingTrackerCore/Menu/GrowingStatusBar.m @@ -20,8 +20,8 @@ #import "GrowingTargetConditionals.h" #if Growing_USE_UIKIT -#import "GrowingTrackerCore/Menu/GrowingStatusBar.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" +#import "GrowingTrackerCore/Menu/GrowingStatusBar.h" #import "GrowingULApplication.h" @interface GrowingStatusBar () diff --git a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m index 53f254610..a2d8d897b 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m +++ b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m @@ -18,8 +18,8 @@ // limitations under the License. #import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" -#import "GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h" #import "GrowingTargetConditionals.h" +#import "GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h" #if Growing_OS_PURE_IOS #import diff --git a/GrowingTrackerCore/Utils/GrowingInternalMacros.h b/GrowingTrackerCore/Utils/GrowingInternalMacros.h index 37a86d6b2..fe7aaf7dd 100644 --- a/GrowingTrackerCore/Utils/GrowingInternalMacros.h +++ b/GrowingTrackerCore/Utils/GrowingInternalMacros.h @@ -42,7 +42,7 @@ #import #define GROWING_USE_OS_UNFAIR_LOCK \ - Growing_OS_MACCATALYST || (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0) || \ + Growing_OS_MACCATALYST || (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0) || \ (__MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12) || (__TV_OS_VERSION_MIN_REQUIRED >= __TVOS_10_0) || \ (__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0) diff --git a/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m b/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m index d0e316c3e..b79dc9bcd 100644 --- a/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m +++ b/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m @@ -18,8 +18,8 @@ // limitations under the License. #import "GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.h" -#import "GrowingTrackerCore/Helpers/GrowingHelpers.h" #import "GrowingTargetConditionals.h" +#import "GrowingTrackerCore/Helpers/GrowingHelpers.h" @implementation GrowingUserIdentifier @@ -33,7 +33,7 @@ + (NSString *)getUserIdentifier { uuid = [self idfv]; } #endif - + // 失败了随机生成 UUID if (!uuid.length || !uuid.growingHelper_isValidU) { uuid = [[NSUUID UUID] UUIDString]; diff --git a/Package.swift b/Package.swift index 47378f0b2..269b58990 100644 --- a/Package.swift +++ b/Package.swift @@ -29,7 +29,7 @@ let package = Package( .macCatalyst(.v13), .macOS(.v10_12), .tvOS(.v10), - .watchOS(.v7) + .watchOS(.v7), ], products: [ .autotracker, diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift index b12d0c19d..a159237a0 100644 --- a/Package@swift-5.9.swift +++ b/Package@swift-5.9.swift @@ -30,7 +30,7 @@ let package = Package( .macOS(.v10_14), .tvOS(.v12), .watchOS(.v7), - .visionOS(.v1) + .visionOS(.v1), ], products: [ .autotracker, From ef129992a0da4fae18466cd534e9d571ec53c745 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Sun, 4 Feb 2024 10:25:37 +0800 Subject: [PATCH 04/36] fix: add default value to device info in order to prevent new platform in future --- .../GrowingNode/GrowingNodeHelper.m | 1 + GrowingTrackerCore/Utils/GrowingDeviceInfo.m | 11 +++++++++++ .../Utils/UserIdentifier/GrowingUserIdentifier.m | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m b/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m index 87dcdee93..ee1729aa3 100644 --- a/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m +++ b/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m @@ -22,6 +22,7 @@ #import "GrowingAutotrackerCore/GrowingNode/Category/UIView+GrowingNode.h" #import "GrowingAutotrackerCore/Page/GrowingPageManager.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" +#import "GrowingTargetConditionals.h" static NSString *const kGrowingNodeRootPage = @"Page"; static NSString *const kGrowingNodeRootIgnore = @"IgnorePage"; diff --git a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m index e4e69f09a..52bf70ee7 100644 --- a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m +++ b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m @@ -88,6 +88,9 @@ - (instancetype)init { #elif Growing_USE_WATCHKIT _screenWidth = WKInterfaceDevice.currentDevice.screenBounds.size.width; _screenHeight = WKInterfaceDevice.currentDevice.screenBounds.size.height; +#else + _screenWidth = 1; + _screenHeight = 1; #endif [[GrowingULAppLifecycle sharedInstance] addAppLifecycleDelegate:self]; @@ -255,6 +258,8 @@ - (NSString *)deviceModel { _deviceModel = @(systemInfo.machine); #elif Growing_USE_WATCHKIT _deviceModel = [GrowingDeviceInfo getSysInfoByName:(char *)"hw.machine"]; +#else + _deviceModel = @"Undefined"; #endif } return _deviceModel; @@ -268,6 +273,8 @@ - (NSString *)deviceType { _deviceType = [UIDevice currentDevice].model; #elif Growing_USE_WATCHKIT _deviceType = [WKInterfaceDevice currentDevice].model; +#else + _deviceType = @"Undefined"; #endif } return _deviceType; @@ -287,6 +294,8 @@ - (NSString *)platform { _platform = @"tvOS"; #elif Growing_OS_VISION _platform = @"visionOS"; +#else + _platform = @"Undefined"; #endif } return _platform; @@ -302,6 +311,8 @@ - (NSString *)platformVersion { _platformVersion = [UIDevice currentDevice].systemVersion; #elif Growing_USE_WATCHKIT _platformVersion = [WKInterfaceDevice currentDevice].systemVersion; +#else + _platformVersion = @"1.0"; #endif } return _platformVersion; diff --git a/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m b/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m index b79dc9bcd..0b36f6901 100644 --- a/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m +++ b/GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.m @@ -35,7 +35,7 @@ + (NSString *)getUserIdentifier { #endif // 失败了随机生成 UUID - if (!uuid.length || !uuid.growingHelper_isValidU) { + if (!uuid.growingHelper_isValidU) { uuid = [[NSUUID UUID] UUIDString]; } return uuid; From d09782572bfc8b855ac2d075f2ada0b77069cfe3 Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Sun, 4 Feb 2024 02:26:09 +0000 Subject: [PATCH 05/36] style: code format --- GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m b/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m index ee1729aa3..66aad0893 100644 --- a/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m +++ b/GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.m @@ -21,8 +21,8 @@ #import "GrowingAutotrackerCore/Autotrack/UIViewController+GrowingAutotracker.h" #import "GrowingAutotrackerCore/GrowingNode/Category/UIView+GrowingNode.h" #import "GrowingAutotrackerCore/Page/GrowingPageManager.h" -#import "GrowingTrackerCore/Helpers/GrowingHelpers.h" #import "GrowingTargetConditionals.h" +#import "GrowingTrackerCore/Helpers/GrowingHelpers.h" static NSString *const kGrowingNodeRootPage = @"Page"; static NSString *const kGrowingNodeRootIgnore = @"IgnorePage"; From 7d0dce53cf79f4ad4451f8a63db75714bc2bed30 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Sun, 4 Feb 2024 17:26:31 +0800 Subject: [PATCH 06/36] fix: some UIKit-based class and categories are only used on iOS platform --- .../HelpersTests/GrowingUIKitHelpersTest.m | 4 -- Example/Podfile.lock | 6 +- GrowingAnalytics.podspec | 4 +- GrowingTrackerCore/GrowingWindow.h | 2 +- GrowingTrackerCore/GrowingWindow.m | 2 +- GrowingTrackerCore/Helpers/GrowingHelpers.h | 1 - .../UIKit/UIApplication+GrowingHelper.h | 2 +- .../UIKit/UIApplication+GrowingHelper.m | 3 +- .../Helpers/UIKit/UIWindow+GrowingHelper.h | 28 --------- .../Helpers/UIKit/UIWindow+GrowingHelper.m | 63 ------------------- GrowingTrackerCore/Menu/GrowingAlert.h | 2 +- GrowingTrackerCore/Menu/GrowingAlert.m | 2 +- GrowingTrackerCore/Menu/GrowingStatusBar.h | 2 +- GrowingTrackerCore/Menu/GrowingStatusBar.m | 2 +- GrowingTrackerCore/Utils/GrowingDeviceInfo.m | 7 +-- Package.swift | 2 +- .../Screenshot/GrowingScreenshotProvider.m | 38 ++++++++++- 17 files changed, 54 insertions(+), 116 deletions(-) delete mode 100644 GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h delete mode 100644 GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.m diff --git a/Example/GrowingAnalyticsTests/TrackerCoreTests/HelpersTests/GrowingUIKitHelpersTest.m b/Example/GrowingAnalyticsTests/TrackerCoreTests/HelpersTests/GrowingUIKitHelpersTest.m index 345113e00..da2c7b329 100644 --- a/Example/GrowingAnalyticsTests/TrackerCoreTests/HelpersTests/GrowingUIKitHelpersTest.m +++ b/Example/GrowingAnalyticsTests/TrackerCoreTests/HelpersTests/GrowingUIKitHelpersTest.m @@ -46,10 +46,6 @@ - (void)testImageHelper { [image growingHelper_JPEG:0.8]; } -- (void)testUIWindowHelper { - [UIWindow growingHelper_screenshotWithWindows:nil andMaxScale:0.8]; -} - - (void)testUIViewHelper { UIView *view = [[UIView alloc] init]; [view growingHelper_viewController]; diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 2991b1979..9fa50c5fd 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -160,7 +160,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - GrowingAnalytics: 46a017057f145c19651a669ba79d97b36a1d8ce2 + GrowingAnalytics: 183d75b3221b5becdeaca8954280a5d034febb66 GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b GrowingToolsKit: edc93c96e47bd6ad1ff3deffe72fe276ae0a1fa8 GrowingUtils: 67f39629888d597a120b904213a128617ddcae25 @@ -170,6 +170,6 @@ SPEC CHECKSUMS: SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf SDWebImage: fc8f2d48bbfd72ef39d70e981bd24a3f3be53fec -PODFILE CHECKSUM: 7593dc7c8438d93063cc565450ab2ccffc609ac5 +PODFILE CHECKSUM: 04f75853a34f62d286d1953abbc3995558c3b15e -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.0 diff --git a/GrowingAnalytics.podspec b/GrowingAnalytics.podspec index 41a292327..0058940dc 100644 --- a/GrowingAnalytics.podspec +++ b/GrowingAnalytics.podspec @@ -12,7 +12,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.ios.deployment_target = '10.0' s.osx.deployment_target = '10.12' s.watchos.deployment_target = '7.0' - s.tvos.deployment_target = '10.0' + s.tvos.deployment_target = '12.0' s.ios.framework = 'WebKit' s.requires_arc = true s.default_subspec = "Autotracker" @@ -212,4 +212,4 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 config.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'GROWING_ANALYSIS_DISABLE_IDFA=1'} config.dependency 'GrowingAnalytics/TrackerCore', s.version.to_s end -end \ No newline at end of file +end diff --git a/GrowingTrackerCore/GrowingWindow.h b/GrowingTrackerCore/GrowingWindow.h index 3dfc63a55..0d8a791e2 100644 --- a/GrowingTrackerCore/GrowingWindow.h +++ b/GrowingTrackerCore/GrowingWindow.h @@ -19,7 +19,7 @@ #import "GrowingTargetConditionals.h" -#if Growing_USE_UIKIT +#if Growing_OS_IOS @interface GrowingWindowView : UIView @property (nonatomic, assign) CGFloat growingViewLevel; diff --git a/GrowingTrackerCore/GrowingWindow.m b/GrowingTrackerCore/GrowingWindow.m index c9fb1ab15..3aadf0afe 100644 --- a/GrowingTrackerCore/GrowingWindow.m +++ b/GrowingTrackerCore/GrowingWindow.m @@ -19,7 +19,7 @@ #import "GrowingTargetConditionals.h" -#if Growing_USE_UIKIT +#if Growing_OS_IOS #import "GrowingTrackerCore/GrowingWindow.h" #import "GrowingULApplication.h" diff --git a/GrowingTrackerCore/Helpers/GrowingHelpers.h b/GrowingTrackerCore/Helpers/GrowingHelpers.h index bdb2c36cb..65d2a095d 100644 --- a/GrowingTrackerCore/Helpers/GrowingHelpers.h +++ b/GrowingTrackerCore/Helpers/GrowingHelpers.h @@ -29,5 +29,4 @@ #import "GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h" #import "GrowingTrackerCore/Helpers/UIKit/UIImage+GrowingHelper.h" #import "GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.h" -#import "GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h" #endif diff --git a/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h b/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h index 5b92cc1e0..b52936bf8 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h +++ b/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h @@ -19,7 +19,7 @@ #import "GrowingTargetConditionals.h" -#if Growing_USE_UIKIT +#if Growing_OS_IOS @interface UIApplication (GrowingHelper) - (NSArray *)growingHelper_allWindowsWithoutGrowingWindow; diff --git a/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.m b/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.m index 80e72ed92..f5449fcea 100644 --- a/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.m +++ b/GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.m @@ -19,10 +19,9 @@ #import "GrowingTargetConditionals.h" -#if Growing_USE_UIKIT +#if Growing_OS_IOS #import "GrowingTrackerCore/GrowingWindow.h" #import "GrowingTrackerCore/Helpers/UIKit/UIApplication+GrowingHelper.h" -#import "GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h" @implementation UIApplication (GrowingHelper) diff --git a/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h b/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h deleted file mode 100644 index c0c47a8dc..000000000 --- a/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// UIWindow+GrowingHelper.h -// GrowingAnalytics -// -// Created by GrowingIO on 2/17/16. -// Copyright (C) 2020 Beijing Yishu Technology Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "GrowingTargetConditionals.h" - -#if Growing_USE_UIKIT -@interface UIWindow (GrowingHelper) - -+ (UIImage *)growingHelper_screenshotWithWindows:(NSArray *)windows andMaxScale:(CGFloat)maxScale; - -@end -#endif diff --git a/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.m b/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.m deleted file mode 100644 index 3185b586b..000000000 --- a/GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.m +++ /dev/null @@ -1,63 +0,0 @@ -// -// UIWindow+GrowingHelper.m -// GrowingAnalytics -// -// Created by GrowingIO on 2/17/16. -// Copyright (C) 2020 Beijing Yishu Technology Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "GrowingTargetConditionals.h" - -#if Growing_USE_UIKIT -#import "GrowingTrackerCore/Helpers/UIKit/UIView+GrowingHelper.h" -#import "GrowingTrackerCore/Helpers/UIKit/UIWindow+GrowingHelper.h" - -@implementation UIWindow (GrowingHelper) - -+ (UIImage *)growingHelper_screenshotWithWindows:(NSArray *)windows andMaxScale:(CGFloat)maxScale { - CGFloat scale = [UIScreen mainScreen].scale; - if (maxScale != 0 && maxScale < scale) { - scale = maxScale; - } - - // SDK support version >= iOS 8.0 - // the orientation is correct so we don't have to adjust it - CGSize imageSize = [UIScreen mainScreen].bounds.size; - UIGraphicsBeginImageContextWithOptions(imageSize, NO, scale); - CGContextRef context = UIGraphicsGetCurrentContext(); - - for (UIWindow *window in windows) { - CGContextSaveGState(context); - CGContextTranslateCTM(context, window.center.x, window.center.y); - CGContextConcatCTM(context, window.transform); - CGContextTranslateCTM(context, - -window.bounds.size.width * window.layer.anchorPoint.x, - -window.bounds.size.height * window.layer.anchorPoint.y); - if ([window respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { - [window drawViewHierarchyInRect:window.bounds afterScreenUpdates:NO]; - } else { - if (context) { - [window.layer renderInContext:context]; - } - } - CGContextRestoreGState(context); - } - - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - return image; -} - -@end -#endif diff --git a/GrowingTrackerCore/Menu/GrowingAlert.h b/GrowingTrackerCore/Menu/GrowingAlert.h index 1e4f55dad..bfea5e996 100644 --- a/GrowingTrackerCore/Menu/GrowingAlert.h +++ b/GrowingTrackerCore/Menu/GrowingAlert.h @@ -18,7 +18,7 @@ #import "GrowingTargetConditionals.h" -#if Growing_USE_UIKIT +#if Growing_OS_IOS NS_ASSUME_NONNULL_BEGIN @interface GrowingAlert : NSObject diff --git a/GrowingTrackerCore/Menu/GrowingAlert.m b/GrowingTrackerCore/Menu/GrowingAlert.m index c49ce7e07..b69a0d7dc 100644 --- a/GrowingTrackerCore/Menu/GrowingAlert.m +++ b/GrowingTrackerCore/Menu/GrowingAlert.m @@ -18,7 +18,7 @@ #import "GrowingTargetConditionals.h" -#if Growing_USE_UIKIT +#if Growing_OS_IOS #import "GrowingTrackerCore/Menu/GrowingAlert.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" #import "GrowingULApplication.h" diff --git a/GrowingTrackerCore/Menu/GrowingStatusBar.h b/GrowingTrackerCore/Menu/GrowingStatusBar.h index bbaff78cc..5bf8b75c1 100644 --- a/GrowingTrackerCore/Menu/GrowingStatusBar.h +++ b/GrowingTrackerCore/Menu/GrowingStatusBar.h @@ -19,7 +19,7 @@ #import "GrowingTargetConditionals.h" -#if Growing_USE_UIKIT +#if Growing_OS_IOS #import "GrowingTrackerCore/GrowingWindow.h" @interface GrowingStatusBar : GrowingWindowView diff --git a/GrowingTrackerCore/Menu/GrowingStatusBar.m b/GrowingTrackerCore/Menu/GrowingStatusBar.m index b3fd2ce4b..36ee3e998 100644 --- a/GrowingTrackerCore/Menu/GrowingStatusBar.m +++ b/GrowingTrackerCore/Menu/GrowingStatusBar.m @@ -19,7 +19,7 @@ #import "GrowingTargetConditionals.h" -#if Growing_USE_UIKIT +#if Growing_OS_IOS #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" #import "GrowingTrackerCore/Menu/GrowingStatusBar.h" #import "GrowingULApplication.h" diff --git a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m index 52bf70ee7..735038af7 100644 --- a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m +++ b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m @@ -78,7 +78,7 @@ - (instancetype)init { #if Growing_USE_APPKIT _screenWidth = NSScreen.mainScreen.frame.size.width; _screenHeight = NSScreen.mainScreen.frame.size.height; -#elif Growing_USE_UIKIT +#elif Growing_OS_IOS || Growing_OS_MACCATALYST || Growing_OS_TV UIScreen *screen = [UIScreen mainScreen]; CGFloat width = screen.bounds.size.width * screen.scale; CGFloat height = screen.bounds.size.height * screen.scale; @@ -135,8 +135,7 @@ - (NSString *)getCurrentUrlScheme { } - (NSString *)getDeviceIdString { - // TODO: tvOS/visionOS support -#if Growing_OS_PURE_IOS || Growing_OS_WATCH +#if Growing_OS_PURE_IOS || Growing_OS_WATCH || Growing_OS_VISION || Growing_OS_TV NSString *deviceIdString = [GrowingKeyChainWrapper keyChainObjectForKey:kGrowingKeychainUserIdKey]; if ([deviceIdString growingHelper_isValidU]) { return deviceIdString; @@ -144,7 +143,7 @@ - (NSString *)getDeviceIdString { #endif NSString *uuid = [GrowingUserIdentifier getUserIdentifier]; -#if Growing_OS_PURE_IOS || Growing_OS_WATCH +#if Growing_OS_PURE_IOS || Growing_OS_WATCH || Growing_OS_VISION || Growing_OS_TV [GrowingKeyChainWrapper setKeychainObject:uuid forKey:kGrowingKeychainUserIdKey]; #endif return uuid; diff --git a/Package.swift b/Package.swift index 269b58990..95a0aa976 100644 --- a/Package.swift +++ b/Package.swift @@ -28,7 +28,7 @@ let package = Package( .iOS(.v10), .macCatalyst(.v13), .macOS(.v10_12), - .tvOS(.v10), + .tvOS(.v12), .watchOS(.v7), ], products: [ diff --git a/Services/Screenshot/GrowingScreenshotProvider.m b/Services/Screenshot/GrowingScreenshotProvider.m index af538cf95..4dd6887aa 100644 --- a/Services/Screenshot/GrowingScreenshotProvider.m +++ b/Services/Screenshot/GrowingScreenshotProvider.m @@ -27,6 +27,42 @@ GrowingService(GrowingScreenshotService, GrowingScreenshotProvider) +@implementation UIWindow (GrowingScreenshot) + ++ (UIImage *)growing_screenshotWithWindows:(NSArray *)windows maxScale:(CGFloat)maxScale { + CGFloat scale = [UIScreen mainScreen].scale; + if (maxScale != 0 && maxScale < scale) { + scale = maxScale; + } + + CGSize imageSize = [UIScreen mainScreen].bounds.size; + UIGraphicsBeginImageContextWithOptions(imageSize, NO, scale); + CGContextRef context = UIGraphicsGetCurrentContext(); + + for (UIWindow *window in windows) { + CGContextSaveGState(context); + CGContextTranslateCTM(context, window.center.x, window.center.y); + CGContextConcatCTM(context, window.transform); + CGContextTranslateCTM(context, + -window.bounds.size.width * window.layer.anchorPoint.x, + -window.bounds.size.height * window.layer.anchorPoint.y); + if ([window respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) { + [window drawViewHierarchyInRect:window.bounds afterScreenUpdates:NO]; + } else { + if (context) { + [window.layer renderInContext:context]; + } + } + CGContextRestoreGState(context); + } + + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return image; +} + +@end + @interface GrowingScreenshotProvider () @property (strong, nonatomic, readonly) NSPointerArray *observers; @@ -112,7 +148,7 @@ - (UIImage *)screenshot { } }]; - UIImage *image = [UIWindow growingHelper_screenshotWithWindows:windows andMaxScale:scale]; + UIImage *image = [UIWindow growing_screenshotWithWindows:windows maxScale:scale]; return image; } From ddda3ae3e5a212a1668a2339b02b43d9afbcbfcd Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Sun, 4 Feb 2024 09:27:06 +0000 Subject: [PATCH 07/36] style: code format --- Services/Screenshot/GrowingScreenshotProvider.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/Screenshot/GrowingScreenshotProvider.m b/Services/Screenshot/GrowingScreenshotProvider.m index 4dd6887aa..190fefaab 100644 --- a/Services/Screenshot/GrowingScreenshotProvider.m +++ b/Services/Screenshot/GrowingScreenshotProvider.m @@ -34,7 +34,7 @@ + (UIImage *)growing_screenshotWithWindows:(NSArray *)windows maxSca if (maxScale != 0 && maxScale < scale) { scale = maxScale; } - + CGSize imageSize = [UIScreen mainScreen].bounds.size; UIGraphicsBeginImageContextWithOptions(imageSize, NO, scale); CGContextRef context = UIGraphicsGetCurrentContext(); From 26127eaaee26c43722b1676a2aee7550228f47d2 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Sun, 4 Feb 2024 17:45:46 +0800 Subject: [PATCH 08/36] chore: add visionOS demo for test --- .../Content.imageset/Contents.json | 12 + .../Back.solidimagestacklayer/Contents.json | 6 + .../AppIcon.solidimagestack/Contents.json | 17 + .../Content.imageset/Contents.json | 12 + .../Front.solidimagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 12 + .../Middle.solidimagestacklayer/Contents.json | 6 + .../Assets.xcassets/Contents.json | 6 + Example/Example-visionOS/ContentView.swift | 42 ++ .../Example_visionOSApp.swift | 38 ++ Example/Example-visionOS/Info.plist | 15 + .../Preview Assets.xcassets/Contents.json | 6 + Example/Example.xcodeproj/project.pbxproj | 362 ++++++++++++++++-- .../ProjectData/main.json | 11 + .../WorkspaceData/SceneMetadataList.json | 209 ++++++++++ .../WorkspaceData/Settings.rcprojectdata | 17 + .../Packages/RealityKitContent/Package.swift | 25 ++ Example/Packages/RealityKitContent/README.md | 3 + .../Materials/GridMaterial.usda | 216 +++++++++++ .../RealityKitContent.rkassets/Scene.usda | 59 +++ .../RealityKitContent/RealityKitContent.swift | 4 + Example/Podfile | 5 + GrowingAnalytics.podspec | 1 + 23 files changed, 1064 insertions(+), 26 deletions(-) create mode 100644 Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json create mode 100644 Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Contents.json create mode 100644 Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json create mode 100644 Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json create mode 100644 Example/Example-visionOS/Assets.xcassets/Contents.json create mode 100644 Example/Example-visionOS/ContentView.swift create mode 100644 Example/Example-visionOS/Example_visionOSApp.swift create mode 100644 Example/Example-visionOS/Info.plist create mode 100644 Example/Example-visionOS/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json create mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json create mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata create mode 100644 Example/Packages/RealityKitContent/Package.swift create mode 100644 Example/Packages/RealityKitContent/README.md create mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda create mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda create mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift diff --git a/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..04056a547 --- /dev/null +++ b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "vision", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Contents.json b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Contents.json new file mode 100644 index 000000000..950af4d85 --- /dev/null +++ b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.solidimagestacklayer" + }, + { + "filename" : "Middle.solidimagestacklayer" + }, + { + "filename" : "Back.solidimagestacklayer" + } + ] +} diff --git a/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..04056a547 --- /dev/null +++ b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "vision", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..04056a547 --- /dev/null +++ b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "vision", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-visionOS/Assets.xcassets/Contents.json b/Example/Example-visionOS/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/Example/Example-visionOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example-visionOS/ContentView.swift b/Example/Example-visionOS/ContentView.swift new file mode 100644 index 000000000..b35df84e9 --- /dev/null +++ b/Example/Example-visionOS/ContentView.swift @@ -0,0 +1,42 @@ +// +// ContentView.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/4. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI +import RealityKit +import RealityKitContent +import GrowingAnalytics + +struct ContentView: View { + var body: some View { + VStack { + Model3D(named: "Scene", bundle: realityKitContentBundle) + .padding(.bottom, 50) + + Text("Hello, world!") + Button("TrackCustomEvent") { + GrowingTracker.sharedInstance().trackCustomEvent("visionOS_custom_event", + withAttributes: ["key": "value"]) + } } + .padding() + } +} + +#Preview(windowStyle: .automatic) { + ContentView() +} diff --git a/Example/Example-visionOS/Example_visionOSApp.swift b/Example/Example-visionOS/Example_visionOSApp.swift new file mode 100644 index 000000000..897326b9b --- /dev/null +++ b/Example/Example-visionOS/Example_visionOSApp.swift @@ -0,0 +1,38 @@ +// +// Example_visionOSApp.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/4. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI +import GrowingAnalytics + +@main +struct Example_visionOSApp: App { + init() { + let config = GrowingTrackConfiguration(accountId: "0a1b4118dd954ec3bcc69da5138bdb96") + config?.dataSourceId = "ab555003531e0fd1" + config?.urlScheme = "growing.bf30ad277eaae1aa" + config?.debugEnabled = true + GrowingTracker.start(with: config!) + } + + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/Example/Example-visionOS/Info.plist b/Example/Example-visionOS/Info.plist new file mode 100644 index 000000000..20f75e2af --- /dev/null +++ b/Example/Example-visionOS/Info.plist @@ -0,0 +1,15 @@ + + + + + UIApplicationSceneManifest + + UIApplicationPreferredDefaultSceneSessionRole + UIWindowSceneSessionRoleApplication + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + + + diff --git a/Example/Example-visionOS/Preview Content/Preview Assets.xcassets/Contents.json b/Example/Example-visionOS/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-visionOS/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 45dc5bf4f..ab677bd7e 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -171,6 +171,11 @@ 34BF77C92795571000CA18BA /* MockEventQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4962653324DA66B600032551 /* MockEventQueue.m */; }; 34BF77CB279562AC00CA18BA /* ManualTrackHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4962653224DA66B600032551 /* ManualTrackHelper.m */; }; 34C0BF3A277EA7C90047ADC4 /* DataTrafficTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 34C0BF39277EA7C90047ADC4 /* DataTrafficTest.m */; }; + 34DAD99D2B6F919E00760A9C /* RealityKitContent in Frameworks */ = {isa = PBXBuildFile; productRef = 34DAD99C2B6F919E00760A9C /* RealityKitContent */; }; + 34DAD99F2B6F919E00760A9C /* Example_visionOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DAD99E2B6F919E00760A9C /* Example_visionOSApp.swift */; }; + 34DAD9A12B6F919E00760A9C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DAD9A02B6F919E00760A9C /* ContentView.swift */; }; + 34DAD9A32B6F919F00760A9C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9A22B6F919F00760A9C /* Assets.xcassets */; }; + 34DAD9A62B6F919F00760A9C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9A52B6F919F00760A9C /* Preview Assets.xcassets */; }; 34E7854D2B513FCC00CBCBA1 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E7854C2B513FCC00CBCBA1 /* ShareViewController.m */; }; 34E785502B513FCC00CBCBA1 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34E7854E2B513FCC00CBCBA1 /* MainInterface.storyboard */; }; 34E785542B513FCC00CBCBA1 /* ShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -466,6 +471,13 @@ 34BF77C52795568B00CA18BA /* GrowingKeyChainTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrowingKeyChainTest.m; sourceTree = ""; }; 34C0BF39277EA7C90047ADC4 /* DataTrafficTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DataTrafficTest.m; sourceTree = ""; }; 34C0BF3C277EA9BA0047ADC4 /* MobileDebuggerTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MobileDebuggerTest.m; sourceTree = ""; }; + 34DAD9982B6F919E00760A9C /* Example-visionOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-visionOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 34DAD99B2B6F919E00760A9C /* RealityKitContent */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = RealityKitContent; sourceTree = ""; }; + 34DAD99E2B6F919E00760A9C /* Example_visionOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example_visionOSApp.swift; sourceTree = ""; }; + 34DAD9A02B6F919E00760A9C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 34DAD9A22B6F919F00760A9C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 34DAD9A52B6F919F00760A9C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 34DAD9A72B6F919F00760A9C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 34E7854B2B513FCC00CBCBA1 /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = ""; }; 34E7854C2B513FCC00CBCBA1 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = ""; }; @@ -610,6 +622,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34DAD9952B6F919E00760A9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 34DAD99D2B6F919E00760A9C /* RealityKitContent in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 34E785462B513FCC00CBCBA1 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1430,6 +1450,34 @@ path = MobileDebuggerTests; sourceTree = ""; }; + 34DAD9992B6F919E00760A9C /* Example-visionOS */ = { + isa = PBXGroup; + children = ( + 34DAD99E2B6F919E00760A9C /* Example_visionOSApp.swift */, + 34DAD9A02B6F919E00760A9C /* ContentView.swift */, + 34DAD9A22B6F919F00760A9C /* Assets.xcassets */, + 34DAD9A72B6F919F00760A9C /* Info.plist */, + 34DAD9A42B6F919F00760A9C /* Preview Content */, + ); + path = "Example-visionOS"; + sourceTree = ""; + }; + 34DAD99A2B6F919E00760A9C /* Packages */ = { + isa = PBXGroup; + children = ( + 34DAD99B2B6F919E00760A9C /* RealityKitContent */, + ); + path = Packages; + sourceTree = ""; + }; + 34DAD9A42B6F919F00760A9C /* Preview Content */ = { + isa = PBXGroup; + children = ( + 34DAD9A52B6F919F00760A9C /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; 34E7854A2B513FCC00CBCBA1 /* ShareExtension */ = { isa = PBXGroup; children = ( @@ -1484,7 +1532,9 @@ 346E0B3929F2724400A12E4E /* Example-macOS */, 34E7854A2B513FCC00CBCBA1 /* ShareExtension */, 34FBF1892B6A2C1C008C7587 /* Example-watchOS Watch App */, + 34DAD9992B6F919E00760A9C /* Example-visionOS */, 6003F58C195388D20070C39A /* Frameworks */, + 34DAD99A2B6F919E00760A9C /* Packages */, 6003F58B195388D20070C39A /* Products */, 1172AEB47E26DD658BEEA1BB /* Pods */, ); @@ -1506,6 +1556,7 @@ 346521DF2ADD0E540091E815 /* ABTestingTests.xctest */, 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */, 34FBF1882B6A2C1C008C7587 /* Example-watchOS Watch App.app */, + 34DAD9982B6F919E00760A9C /* Example-visionOS.app */, ); name = Products; sourceTree = ""; @@ -1729,6 +1780,26 @@ productReference = 34BF77B82795561300CA18BA /* HostApplicationTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 34DAD9972B6F919E00760A9C /* Example-visionOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 34DAD9AA2B6F919F00760A9C /* Build configuration list for PBXNativeTarget "Example-visionOS" */; + buildPhases = ( + 34DAD9942B6F919E00760A9C /* Sources */, + 34DAD9952B6F919E00760A9C /* Frameworks */, + 34DAD9962B6F919E00760A9C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Example-visionOS"; + packageProductDependencies = ( + 34DAD99C2B6F919E00760A9C /* RealityKitContent */, + ); + productName = "Example-visionOS"; + productReference = 34DAD9982B6F919E00760A9C /* Example-visionOS.app */; + productType = "com.apple.product-type.application"; + }; 34E785482B513FCC00CBCBA1 /* ShareExtension */ = { isa = PBXNativeTarget; buildConfigurationList = 34E785592B513FCC00CBCBA1 /* Build configuration list for PBXNativeTarget "ShareExtension" */; @@ -1861,6 +1932,9 @@ ProvisioningStyle = Automatic; TestTargetID = 6003F589195388D20070C39A; }; + 34DAD9972B6F919E00760A9C = { + CreatedOnToolsVersion = 15.2; + }; 34E785482B513FCC00CBCBA1 = { CreatedOnToolsVersion = 15.1; DevelopmentTeam = SXBU677CPT; @@ -1907,6 +1981,7 @@ 346521DE2ADD0E540091E815 /* ABTestingTests */, 34E785482B513FCC00CBCBA1 /* ShareExtension */, 34FBF1872B6A2C1C008C7587 /* Example-watchOS Watch App */, + 34DAD9972B6F919E00760A9C /* Example-visionOS */, ); }; /* End PBXProject section */ @@ -1987,6 +2062,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34DAD9962B6F919E00760A9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34DAD9A62B6F919F00760A9C /* Preview Assets.xcassets in Resources */, + 34DAD9A32B6F919F00760A9C /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 34E785472B513FCC00CBCBA1 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2682,6 +2766,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34DAD9942B6F919E00760A9C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34DAD9A12B6F919E00760A9C /* ContentView.swift in Sources */, + 34DAD99F2B6F919E00760A9C /* Example_visionOSApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 34E785452B513FCC00CBCBA1 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2998,7 +3091,10 @@ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 GrowingIO. All rights reserved."; INFOPLIST_KEY_NSMainStoryboardFile = Main; INFOPLIST_KEY_NSPrincipalClass = NSApplication; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -3052,7 +3148,10 @@ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 GrowingIO. All rights reserved."; INFOPLIST_KEY_NSMainStoryboardFile = Main; INFOPLIST_KEY_NSPrincipalClass = NSApplication; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -3060,8 +3159,9 @@ PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; }; name = Release; @@ -3100,7 +3200,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3147,7 +3251,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3204,7 +3312,10 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3261,7 +3372,10 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3305,7 +3419,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3351,7 +3469,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3397,7 +3519,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3443,7 +3569,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3488,7 +3618,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3534,7 +3668,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3579,7 +3717,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3625,7 +3767,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3670,7 +3816,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3716,7 +3866,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3763,7 +3917,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3812,7 +3970,11 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3824,6 +3986,118 @@ }; name = Release; }; + 34DAD9A82B6F919F00760A9C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_ASSET_PATHS = "\"Example-visionOS/Preview Content\""; + DEVELOPMENT_TEAM = SXBU677CPT; + ENABLE_PREVIEWS = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "$(TARGET_NAME)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-.Example-visionOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = xros; + SUPPORTED_PLATFORMS = "xros xrsimulator"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 1.0; + }; + name = Debug; + }; + 34DAD9A92B6F919F00760A9C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_ASSET_PATHS = "\"Example-visionOS/Preview Content\""; + DEVELOPMENT_TEAM = SXBU677CPT; + ENABLE_PREVIEWS = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "$(TARGET_NAME)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-.Example-visionOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = xros; + SUPPORTED_PLATFORMS = "xros xrsimulator"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 1.0; + }; + name = Release; + }; 34E785572B513FCC00CBCBA1 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 0344A9865CDD74AF1F8A6198 /* Pods-ShareExtension.debug.xcconfig */; @@ -3861,7 +4135,11 @@ INFOPLIST_KEY_CFBundleDisplayName = ShareExtension; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 GrowingIO. All rights reserved."; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -3913,7 +4191,11 @@ INFOPLIST_KEY_CFBundleDisplayName = ShareExtension; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 GrowingIO. All rights reserved."; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -3969,7 +4251,10 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "GrowingIO.GrowingIOTest-"; INFOPLIST_KEY_WKRunsIndependentlyOfCompanionApp = YES; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -4030,7 +4315,10 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "GrowingIO.GrowingIOTest-"; INFOPLIST_KEY_WKRunsIndependentlyOfCompanionApp = YES; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -4139,7 +4427,10 @@ ); INFOPLIST_FILE = "Example/GrowingIO-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MODULE_NAME = ExampleApp; OTHER_LDFLAGS = ( "$(inherited)", @@ -4178,7 +4469,10 @@ ); INFOPLIST_FILE = "Example/GrowingIO-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MODULE_NAME = ExampleApp; OTHER_LDFLAGS = ( "$(inherited)", @@ -4308,6 +4602,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 34DAD9AA2B6F919F00760A9C /* Build configuration list for PBXNativeTarget "Example-visionOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 34DAD9A82B6F919F00760A9C /* Debug */, + 34DAD9A92B6F919F00760A9C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 34E785592B513FCC00CBCBA1 /* Build configuration list for PBXNativeTarget "ShareExtension" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -4345,6 +4648,13 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCSwiftPackageProductDependency section */ + 34DAD99C2B6F919E00760A9C /* RealityKitContent */ = { + isa = XCSwiftPackageProductDependency; + productName = RealityKitContent; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 6003F582195388D10070C39A /* Project object */; } diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json b/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json new file mode 100644 index 000000000..4a8c74bf3 --- /dev/null +++ b/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json @@ -0,0 +1,11 @@ +{ + "pathsToIds" : { + "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/GridMaterial.usda" : "440DE5B4-E4E4-459B-AABF-9ACE96319272", + "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/procedural_sphere_grid.usda" : "34C460AE-CA1B-4348-BD05-621ACBDFFE97", + "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Scene.usda" : "0A9B4653-B11E-4D6A-850E-C6FCB621626C", + "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Untitled Scene.usda" : "03E02005-EFA6-48D6-8A76-05B2822A74E9", + "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/GridMaterial.usda" : "FBD8436F-6B8B-4B82-99B5-995D538B4704", + "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/procedural_sphere_grid.usda" : "1CBF3893-ABFD-408C-8B91-045BFD257808", + "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Scene.usda" : "26DBAE76-5DD8-47B6-A085-1B4ADA111097" + } +} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json new file mode 100644 index 000000000..1d84a750e --- /dev/null +++ b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json @@ -0,0 +1,209 @@ +{ + "0A9B4653-B11E-4D6A-850E-C6FCB621626C" : { + "cameraTransform" : [ + 0.9807314, + -1.9820146e-10, + -0.195361, + 0, + -0.10051192, + 0.85749435, + -0.5045798, + 0, + 0.16752096, + 0.51449335, + 0.84097165, + 0, + 0.09084191, + 0.05849296, + 0.13903293, + 1 + ], + "objectMetadataList" : [ + [ + "0A9B4653-B11E-4D6A-850E-C6FCB621626C", + "Root" + ], + { + "isExpanded" : true, + "isLocked" : false + }, + [ + "0A9B4653-B11E-4D6A-850E-C6FCB621626C", + "Root", + "GridMaterial" + ], + { + "isExpanded" : true, + "isLocked" : false + }, + [ + "0A9B4653-B11E-4D6A-850E-C6FCB621626C", + "Root", + "Sphere" + ], + { + "isExpanded" : true, + "isLocked" : false + } + ] + }, + "1CBF3893-ABFD-408C-8B91-045BFD257808" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660255, + -0.49999988, + 0, + 0, + 0.49999988, + 0.8660255, + 0, + 0, + 0.27093542, + 0.46927398, + 1 + ], + "objectMetadataList" : [ + + ] + }, + "03E02005-EFA6-48D6-8A76-05B2822A74E9" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660254, + -0.49999994, + 0, + 0, + 0.49999994, + 0.8660254, + 0, + 0, + 0.5981957, + 1.0361054, + 1 + ], + "objectMetadataList" : [ + + ] + }, + "26DBAE76-5DD8-47B6-A085-1B4ADA111097" : { + "cameraTransform" : [ + 1, + 0, + -0, + 0, + -0, + 0.7071069, + -0.7071067, + 0, + 0, + 0.7071067, + 0.7071069, + 0, + 0, + 0.2681068, + 0.26850593, + 1 + ], + "objectMetadataList" : [ + [ + "26DBAE76-5DD8-47B6-A085-1B4ADA111097", + "Root" + ], + { + "isExpanded" : true, + "isLocked" : false + } + ] + }, + "34C460AE-CA1B-4348-BD05-621ACBDFFE97" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660255, + -0.49999988, + 0, + 0, + 0.49999988, + 0.8660255, + 0, + 0, + 0.27093542, + 0.46927398, + 1 + ], + "objectMetadataList" : [ + + ] + }, + "440DE5B4-E4E4-459B-AABF-9ACE96319272" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660254, + -0.49999994, + 0, + 0, + 0.49999994, + 0.8660254, + 0, + 0, + 0.5981957, + 1.0361054, + 1 + ], + "objectMetadataList" : [ + [ + "440DE5B4-E4E4-459B-AABF-9ACE96319272", + "Root" + ], + { + "isExpanded" : true, + "isLocked" : false + } + ] + }, + "FBD8436F-6B8B-4B82-99B5-995D538B4704" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660254, + -0.49999994, + 0, + 0, + 0.49999994, + 0.8660254, + 0, + 0, + 0.5981957, + 1.0361054, + 1 + ], + "objectMetadataList" : [ + [ + "FBD8436F-6B8B-4B82-99B5-995D538B4704", + "Root" + ], + { + "isExpanded" : true, + "isLocked" : false + } + ] + } +} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata new file mode 100644 index 000000000..6dea95c8d --- /dev/null +++ b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata @@ -0,0 +1,17 @@ +{ + "cameraPresets" : { + + }, + "secondaryToolbarData" : { + "isGridVisible" : true, + "sceneReverbPreset" : -1 + }, + "unitDefaults" : { + "°" : "°", + "kg" : "g", + "m" : "cm", + "m\/s" : "m\/s", + "m\/s²" : "m\/s²", + "s" : "s" + } +} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.swift b/Example/Packages/RealityKitContent/Package.swift new file mode 100644 index 000000000..d043ae1ad --- /dev/null +++ b/Example/Packages/RealityKitContent/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "RealityKitContent", + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "RealityKitContent", + targets: ["RealityKitContent"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "RealityKitContent", + dependencies: []), + ] +) \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/README.md b/Example/Packages/RealityKitContent/README.md new file mode 100644 index 000000000..486b5755e --- /dev/null +++ b/Example/Packages/RealityKitContent/README.md @@ -0,0 +1,3 @@ +# RealityKitContent + +A description of this package. \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda new file mode 100644 index 000000000..b7afd0240 --- /dev/null +++ b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda @@ -0,0 +1,216 @@ +#usda 1.0 +( + defaultPrim = "Root" + metersPerUnit = 1 + upAxis = "Y" +) + +def Xform "Root" +{ + def Material "GridMaterial" + { + reorder nameChildren = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "DefaultSurfaceShader", "MaterialXPreviewSurface", "Texcoord", "Add", "Multiply", "Fractional", "LineCounts", "Multiply_1", "Separate2", "Separate2_1", "Ifgreater", "Ifgreater_1", "Max", "Background_Color"] + token outputs:mtlx:surface.connect = + token outputs:realitykit:vertex + token outputs:surface + float2 ui:nodegraph:realitykit:subgraphOutputs:pos = (2222, 300.5) + float2 ui:nodegraph:realitykit:subgraphOutputs:size = (182, 89) + int ui:nodegraph:realitykit:subgraphOutputs:stackingOrder = 749 + + def Shader "DefaultSurfaceShader" + { + uniform token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:roughness = 0.75 + token outputs:surface + } + + def Shader "MaterialXPreviewSurface" + { + uniform token info:id = "ND_UsdPreviewSurface_surfaceshader" + float inputs:clearcoat + float inputs:clearcoatRoughness + color3f inputs:diffuseColor.connect = + color3f inputs:emissiveColor + float inputs:ior + float inputs:metallic = 0.15 + float3 inputs:normal + float inputs:occlusion + float inputs:opacity + float inputs:opacityThreshold + float inputs:roughness = 0.5 + token outputs:out + float2 ui:nodegraph:node:pos = (1967, 300.5) + float2 ui:nodegraph:node:size = (208, 297) + int ui:nodegraph:node:stackingOrder = 870 + string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["Advanced"] + } + + def Shader "Texcoord" + { + uniform token info:id = "ND_texcoord_vector2" + float2 outputs:out + float2 ui:nodegraph:node:pos = (94.14453, 35.29297) + float2 ui:nodegraph:node:size = (182, 43) + int ui:nodegraph:node:stackingOrder = 1358 + } + + def Shader "Multiply" + { + uniform token info:id = "ND_multiply_vector2" + float2 inputs:in1.connect = + float2 inputs:in2 = (32, 15) + float2 inputs:in2.connect = + float2 outputs:out + float2 ui:nodegraph:node:pos = (275.64453, 47.29297) + float2 ui:nodegraph:node:size = (61, 36) + int ui:nodegraph:node:stackingOrder = 1348 + string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["inputs:in2"] + } + + def Shader "Fractional" + { + uniform token info:id = "ND_realitykit_fractional_vector2" + float2 inputs:in.connect = + float2 outputs:out + float2 ui:nodegraph:node:pos = (440.5, 49.5) + float2 ui:nodegraph:node:size = (155, 99) + int ui:nodegraph:node:stackingOrder = 1345 + } + + def Shader "BaseColor" + { + uniform token info:id = "ND_constant_color3" + color3f inputs:value = (0.89737034, 0.89737034, 0.89737034) ( + colorSpace = "Input - Texture - sRGB - sRGB" + ) + color3f inputs:value.connect = None + color3f outputs:out + float2 ui:nodegraph:node:pos = (1537.5977, 363.07812) + float2 ui:nodegraph:node:size = (150, 43) + int ui:nodegraph:node:stackingOrder = 1353 + } + + def Shader "LineColor" + { + uniform token info:id = "ND_constant_color3" + color3f inputs:value = (0.55945957, 0.55945957, 0.55945957) ( + colorSpace = "Input - Texture - sRGB - sRGB" + ) + color3f inputs:value.connect = None + color3f outputs:out + float2 ui:nodegraph:node:pos = (1536.9844, 287.86328) + float2 ui:nodegraph:node:size = (146, 43) + int ui:nodegraph:node:stackingOrder = 1355 + } + + def Shader "LineWidths" + { + uniform token info:id = "ND_combine2_vector2" + float inputs:in1 = 0.1 + float inputs:in2 = 0.1 + float2 outputs:out + float2 ui:nodegraph:node:pos = (443.64453, 233.79297) + float2 ui:nodegraph:node:size = (151, 43) + int ui:nodegraph:node:stackingOrder = 1361 + } + + def Shader "LineCounts" + { + uniform token info:id = "ND_combine2_vector2" + float inputs:in1 = 24 + float inputs:in2 = 12 + float2 outputs:out + float2 ui:nodegraph:node:pos = (94.14453, 138.29297) + float2 ui:nodegraph:node:size = (153, 43) + int ui:nodegraph:node:stackingOrder = 1359 + } + + def Shader "Remap" + { + uniform token info:id = "ND_remap_color3" + color3f inputs:in.connect = + color3f inputs:inhigh.connect = None + color3f inputs:inlow.connect = None + color3f inputs:outhigh.connect = + color3f inputs:outlow.connect = + color3f outputs:out + float2 ui:nodegraph:node:pos = (1755.5, 300.5) + float2 ui:nodegraph:node:size = (95, 171) + int ui:nodegraph:node:stackingOrder = 1282 + string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["inputs:outlow"] + } + + def Shader "Separate2" + { + uniform token info:id = "ND_separate2_vector2" + float2 inputs:in.connect = + float outputs:outx + float outputs:outy + float2 ui:nodegraph:node:pos = (1212.6445, 128.91797) + float2 ui:nodegraph:node:size = (116, 117) + int ui:nodegraph:node:stackingOrder = 1363 + } + + def Shader "Combine3" + { + uniform token info:id = "ND_combine3_color3" + float inputs:in1.connect = + float inputs:in2.connect = + float inputs:in3.connect = + color3f outputs:out + float2 ui:nodegraph:node:pos = (1578.1445, 128.91797) + float2 ui:nodegraph:node:size = (146, 54) + int ui:nodegraph:node:stackingOrder = 1348 + } + + def Shader "Range" + { + uniform token info:id = "ND_range_vector2" + bool inputs:doclamp = 1 + float2 inputs:gamma = (2, 2) + float2 inputs:in.connect = + float2 inputs:inhigh.connect = + float2 inputs:inlow = (0.02, 0.02) + float2 inputs:outhigh + float2 inputs:outlow + float2 outputs:out + float2 ui:nodegraph:node:pos = (990.64453, 128.91797) + float2 ui:nodegraph:node:size = (98, 207) + int ui:nodegraph:node:stackingOrder = 1364 + } + + def Shader "Subtract" + { + uniform token info:id = "ND_subtract_vector2" + float2 inputs:in1.connect = + float2 inputs:in2.connect = + float2 outputs:out + float2 ui:nodegraph:node:pos = (612.64453, 87.04297) + float2 ui:nodegraph:node:size = (63, 36) + int ui:nodegraph:node:stackingOrder = 1348 + } + + def Shader "Absval" + { + uniform token info:id = "ND_absval_vector2" + float2 inputs:in.connect = + float2 outputs:out + float2 ui:nodegraph:node:pos = (765.64453, 87.04297) + float2 ui:nodegraph:node:size = (123, 43) + int ui:nodegraph:node:stackingOrder = 1348 + } + + def Shader "Min" + { + uniform token info:id = "ND_min_float" + float inputs:in1.connect = + float inputs:in2.connect = + float outputs:out + float2 ui:nodegraph:node:pos = (1388.1445, 128.91797) + float2 ui:nodegraph:node:size = (114, 36) + int ui:nodegraph:node:stackingOrder = 1363 + } + } +} + diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda new file mode 100644 index 000000000..4cb070bf4 --- /dev/null +++ b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda @@ -0,0 +1,59 @@ +#usda 1.0 +( + defaultPrim = "Root" + metersPerUnit = 1 + upAxis = "Y" +) + +def Xform "Root" +{ + reorder nameChildren = ["GridMaterial", "Sphere"] + rel material:binding = None ( + bindMaterialAs = "weakerThanDescendants" + ) + + def Sphere "Sphere" ( + active = true + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + double radius = 0.05 + quatf xformOp:orient = (1, 0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + float3 xformOp:translate = (0, 0, 0.0004) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def RealityKitComponent "Collider" + { + uint group = 1 + uniform token info:id = "RealityKit.Collider" + uint mask = 4294967295 + token type = "Default" + + def RealityKitStruct "Shape" + { + float3 extent = (0.2, 0.2, 0.2) + float radius = 0.05 + token shapeType = "Sphere" + } + } + + def RealityKitComponent "InputTarget" + { + uniform token info:id = "RealityKit.InputTarget" + } + } + + def "GridMaterial" ( + active = true + prepend references = @Materials/GridMaterial.usda@ + ) + { + float3 xformOp:scale = (1, 1, 1) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } +} + diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift new file mode 100644 index 000000000..5caba4e3d --- /dev/null +++ b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift @@ -0,0 +1,4 @@ +import Foundation + +/// Bundle for the RealityKitContent project +public let realityKitContentBundle = Bundle.module diff --git a/Example/Podfile b/Example/Podfile index e25126d05..4d1469094 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -92,6 +92,11 @@ target 'Example-watchOS Watch App' do pod 'GrowingAnalytics/Tracker', :path => '../' end +# target 'Example-visionOS' do +# platform :visionos, '1.0' +# pod 'GrowingAnalytics/Tracker', :path => '../' +# end + post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| diff --git a/GrowingAnalytics.podspec b/GrowingAnalytics.podspec index 0058940dc..749fc71f0 100644 --- a/GrowingAnalytics.podspec +++ b/GrowingAnalytics.podspec @@ -13,6 +13,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.osx.deployment_target = '10.12' s.watchos.deployment_target = '7.0' s.tvos.deployment_target = '12.0' + # s.visionos.deployment_target = '1.0' s.ios.framework = 'WebKit' s.requires_arc = true s.default_subspec = "Autotracker" From e46c55f0cb0c733d906382ad147f227a51aa539a Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Sun, 4 Feb 2024 09:46:14 +0000 Subject: [PATCH 09/36] style: code format --- Example/Packages/RealityKitContent/Package.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Example/Packages/RealityKitContent/Package.swift b/Example/Packages/RealityKitContent/Package.swift index d043ae1ad..7c7a403f5 100644 --- a/Example/Packages/RealityKitContent/Package.swift +++ b/Example/Packages/RealityKitContent/Package.swift @@ -9,7 +9,8 @@ let package = Package( // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "RealityKitContent", - targets: ["RealityKitContent"]), + targets: ["RealityKitContent"] + ), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -20,6 +21,7 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "RealityKitContent", - dependencies: []), + dependencies: [] + ), ] -) \ No newline at end of file +) From ae54651393f389c32016a4ab0cfbeffbe69f3d17 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Mon, 5 Feb 2024 09:45:46 +0800 Subject: [PATCH 10/36] chore: add tvOS demo for test --- Example/Example-tvOS/AppDelegate.swift | 66 +++++ .../AccentColor.colorset/Contents.json | 11 + .../Content.imageset/Contents.json | 11 + .../Back.imagestacklayer/Contents.json | 6 + .../Contents.json | 17 ++ .../Content.imageset/Contents.json | 11 + .../Front.imagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 11 + .../Middle.imagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 16 + .../Back.imagestacklayer/Contents.json | 6 + .../App Icon.imagestack/Contents.json | 17 ++ .../Content.imageset/Contents.json | 16 + .../Front.imagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 16 + .../Middle.imagestacklayer/Contents.json | 6 + .../Contents.json | 32 ++ .../Contents.json | 16 + .../Top Shelf Image.imageset/Contents.json | 16 + .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 24 ++ .../Example-tvOS/Base.lproj/Main.storyboard | 49 +++ Example/Example-tvOS/ViewController.swift | 37 +++ Example/Example.xcodeproj/project.pbxproj | 279 +++++++++++++++++- Example/Podfile | 5 + Example/Podfile.lock | 8 +- 26 files changed, 688 insertions(+), 12 deletions(-) create mode 100644 Example/Example-tvOS/AppDelegate.swift create mode 100644 Example/Example-tvOS/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json create mode 100644 Example/Example-tvOS/Assets.xcassets/Contents.json create mode 100644 Example/Example-tvOS/Base.lproj/LaunchScreen.storyboard create mode 100644 Example/Example-tvOS/Base.lproj/Main.storyboard create mode 100644 Example/Example-tvOS/ViewController.swift diff --git a/Example/Example-tvOS/AppDelegate.swift b/Example/Example-tvOS/AppDelegate.swift new file mode 100644 index 000000000..f7b107fe5 --- /dev/null +++ b/Example/Example-tvOS/AppDelegate.swift @@ -0,0 +1,66 @@ +// +// AppDelegate.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/4. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import UIKit +import GrowingAnalytics + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + let config = GrowingAutotrackConfiguration(accountId: "0a1b4118dd954ec3bcc69da5138bdb96") + config?.dataSourceId = "ab555003531e0fd1" + config?.urlScheme = "growing.bf30ad277eaae1aa" + config?.debugEnabled = true + GrowingAutotracker.start(with: config!, launchOptions: launchOptions ?? [:]) + + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { + return true + } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + return true + } + +} + diff --git a/Example/Example-tvOS/Assets.xcassets/AccentColor.colorset/Contents.json b/Example/Example-tvOS/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..eb8789700 --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..2e003356c --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json new file mode 100644 index 000000000..de59d885a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..2e003356c --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..2e003356c --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..795cce172 --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json new file mode 100644 index 000000000..de59d885a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..795cce172 --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..795cce172 --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json new file mode 100644 index 000000000..f47ba43da --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "filename" : "App Icon - App Store.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "1280x768" + }, + { + "filename" : "App Icon.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "400x240" + }, + { + "filename" : "Top Shelf Image Wide.imageset", + "idiom" : "tv", + "role" : "top-shelf-image-wide", + "size" : "2320x720" + }, + { + "filename" : "Top Shelf Image.imageset", + "idiom" : "tv", + "role" : "top-shelf-image", + "size" : "1920x720" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 000000000..795cce172 --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 000000000..795cce172 --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Assets.xcassets/Contents.json b/Example/Example-tvOS/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-tvOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-tvOS/Base.lproj/LaunchScreen.storyboard b/Example/Example-tvOS/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..660ba53de --- /dev/null +++ b/Example/Example-tvOS/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example-tvOS/Base.lproj/Main.storyboard b/Example/Example-tvOS/Base.lproj/Main.storyboard new file mode 100644 index 000000000..7ed6c4455 --- /dev/null +++ b/Example/Example-tvOS/Base.lproj/Main.storyboard @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example-tvOS/ViewController.swift b/Example/Example-tvOS/ViewController.swift new file mode 100644 index 000000000..26e96dc83 --- /dev/null +++ b/Example/Example-tvOS/ViewController.swift @@ -0,0 +1,37 @@ +// +// ViewController.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/4. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import UIKit +import GrowingAnalytics + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + + GrowingAutotracker.sharedInstance().autotrackPage(self, alias: "tvOSViewController", attributes: ["key1": "value"]) + } + + @IBAction func buttonAction(_ sender: UIButton) { + GrowingAutotracker.sharedInstance().trackCustomEvent("tvOS_custom_event", withAttributes: ["key2": "value"]) + } + +} + diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index ab677bd7e..d2941eba8 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -176,6 +176,11 @@ 34DAD9A12B6F919E00760A9C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DAD9A02B6F919E00760A9C /* ContentView.swift */; }; 34DAD9A32B6F919F00760A9C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9A22B6F919F00760A9C /* Assets.xcassets */; }; 34DAD9A62B6F919F00760A9C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9A52B6F919F00760A9C /* Preview Assets.xcassets */; }; + 34DAD9BE2B6F948100760A9C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DAD9BD2B6F948100760A9C /* AppDelegate.swift */; }; + 34DAD9C02B6F948100760A9C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DAD9BF2B6F948100760A9C /* ViewController.swift */; }; + 34DAD9C32B6F948100760A9C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9C12B6F948100760A9C /* Main.storyboard */; }; + 34DAD9C52B6F948200760A9C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9C42B6F948200760A9C /* Assets.xcassets */; }; + 34DAD9C82B6F948200760A9C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9C62B6F948200760A9C /* LaunchScreen.storyboard */; }; 34E7854D2B513FCC00CBCBA1 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E7854C2B513FCC00CBCBA1 /* ShareViewController.m */; }; 34E785502B513FCC00CBCBA1 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34E7854E2B513FCC00CBCBA1 /* MainInterface.storyboard */; }; 34E785542B513FCC00CBCBA1 /* ShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -205,6 +210,7 @@ A61E1E81175885070AAD10A9 /* Pods_ExampleiOS13.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7CCC2E00F858DC5B58D4FA6 /* Pods_ExampleiOS13.framework */; }; A9D21D06460258FAC4736A26 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90476D1583D0EE778FCBED5E /* Pods_Example.framework */; }; DC414ADEC8E1A738BA63089E /* Pods_AdvertisingTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5655CC09B9A2CE16091DB52F /* Pods_AdvertisingTests.framework */; }; + FA78740F8B45E99B90F73157 /* Pods_Example_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24881A4A149E400F80B69E2A /* Pods_Example_tvOS.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -364,6 +370,7 @@ 0B3751A8D7A8C11CD50B544E /* Pods-GrowingAnalyticsStartTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GrowingAnalyticsStartTests.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-GrowingAnalyticsStartTests/Pods-GrowingAnalyticsStartTests.debug.xcconfig"; sourceTree = ""; }; 1769255A062869A5D219F683 /* Pods_GrowingAnalyticsStartTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GrowingAnalyticsStartTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2396F869C811CB392EA9F501 /* Pods-Example-watchOS Watch App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-watchOS Watch App.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-watchOS Watch App/Pods-Example-watchOS Watch App.release.xcconfig"; sourceTree = ""; }; + 24881A4A149E400F80B69E2A /* Pods_Example_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3406842A2A668EB700E25216 /* A3PageEventsTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = A3PageEventsTest.m; sourceTree = ""; }; 34106BB228FECB0D00E7DB01 /* Crasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crasher.h; sourceTree = ""; }; 34106BB328FECB0E00E7DB01 /* Crasher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Crasher.mm; sourceTree = ""; }; @@ -478,6 +485,12 @@ 34DAD9A22B6F919F00760A9C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 34DAD9A52B6F919F00760A9C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 34DAD9A72B6F919F00760A9C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 34DAD9BB2B6F948100760A9C /* Example-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 34DAD9BD2B6F948100760A9C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 34DAD9BF2B6F948100760A9C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 34DAD9C22B6F948100760A9C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 34DAD9C42B6F948200760A9C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 34DAD9C72B6F948200760A9C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 34E7854B2B513FCC00CBCBA1 /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = ""; }; 34E7854C2B513FCC00CBCBA1 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = ""; }; @@ -530,6 +543,7 @@ BBC64B438435E91D8D408C70 /* Pods-Example-macOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-macOS.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-macOS/Pods-Example-macOS.debug.xcconfig"; sourceTree = ""; }; BDF26A896226E51F6DD6DA0E /* Pods_ShareExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ShareExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C2E2C01C3AC89773BC3F4BE1 /* Pods_ProtobufTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ProtobufTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C3770B519AE17A95967F4D21 /* Pods-Example-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.debug.xcconfig"; sourceTree = ""; }; C7CCC2E00F858DC5B58D4FA6 /* Pods_ExampleiOS13.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ExampleiOS13.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CFC074E90BAC4B828194DC02 /* Pods-GrowingAnalyticsStartTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GrowingAnalyticsStartTests.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-GrowingAnalyticsStartTests/Pods-GrowingAnalyticsStartTests.release.xcconfig"; sourceTree = ""; }; D1AA342F735CCEF5565AEEE7 /* Pods-GrowingAnalyticsTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GrowingAnalyticsTests.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-GrowingAnalyticsTests/Pods-GrowingAnalyticsTests.release.xcconfig"; sourceTree = ""; }; @@ -537,6 +551,7 @@ DDE20EE0BB4E138A407A5D1C /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; DE5443FE362C1AE18B5F4C84 /* Pods-AdvertisingTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AdvertisingTests.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-AdvertisingTests/Pods-AdvertisingTests.release.xcconfig"; sourceTree = ""; }; E1800E7E573CE2BD70F0B706 /* Pods-ExampleiOS13.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleiOS13.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-ExampleiOS13/Pods-ExampleiOS13.release.xcconfig"; sourceTree = ""; }; + E3A2065A7EA394ECBE6D2F68 /* Pods-Example-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.release.xcconfig"; sourceTree = ""; }; F625366B1611DA7E27D0E32C /* Pods-ExampleiOS13.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ExampleiOS13.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-ExampleiOS13/Pods-ExampleiOS13.debug.xcconfig"; sourceTree = ""; }; FAB05E3514907518EF7B9514 /* Pods-HostApplicationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HostApplicationTests.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-HostApplicationTests/Pods-HostApplicationTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -662,6 +677,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9BB5336B6D820077BFE7F5F6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FA78740F8B45E99B90F73157 /* Pods_Example_tvOS.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -867,6 +890,8 @@ 8899A83F721CB9CFF4C9D7F9 /* Pods-ShareExtension.release.xcconfig */, 835401C6A4C9E2141838BE84 /* Pods-Example-watchOS Watch App.debug.xcconfig */, 2396F869C811CB392EA9F501 /* Pods-Example-watchOS Watch App.release.xcconfig */, + C3770B519AE17A95967F4D21 /* Pods-Example-tvOS.debug.xcconfig */, + E3A2065A7EA394ECBE6D2F68 /* Pods-Example-tvOS.release.xcconfig */, ); name = Pods; path = ../Pods; @@ -1478,6 +1503,18 @@ path = "Preview Content"; sourceTree = ""; }; + 34DAD9BC2B6F948100760A9C /* Example-tvOS */ = { + isa = PBXGroup; + children = ( + 34DAD9BD2B6F948100760A9C /* AppDelegate.swift */, + 34DAD9BF2B6F948100760A9C /* ViewController.swift */, + 34DAD9C12B6F948100760A9C /* Main.storyboard */, + 34DAD9C42B6F948200760A9C /* Assets.xcassets */, + 34DAD9C62B6F948200760A9C /* LaunchScreen.storyboard */, + ); + path = "Example-tvOS"; + sourceTree = ""; + }; 34E7854A2B513FCC00CBCBA1 /* ShareExtension */ = { isa = PBXGroup; children = ( @@ -1533,6 +1570,7 @@ 34E7854A2B513FCC00CBCBA1 /* ShareExtension */, 34FBF1892B6A2C1C008C7587 /* Example-watchOS Watch App */, 34DAD9992B6F919E00760A9C /* Example-visionOS */, + 34DAD9BC2B6F948100760A9C /* Example-tvOS */, 6003F58C195388D20070C39A /* Frameworks */, 34DAD99A2B6F919E00760A9C /* Packages */, 6003F58B195388D20070C39A /* Products */, @@ -1557,6 +1595,7 @@ 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */, 34FBF1882B6A2C1C008C7587 /* Example-watchOS Watch App.app */, 34DAD9982B6F919E00760A9C /* Example-visionOS.app */, + 34DAD9BB2B6F948100760A9C /* Example-tvOS.app */, ); name = Products; sourceTree = ""; @@ -1584,6 +1623,7 @@ 36E93290071EF480453E2196 /* Pods_ABTestingTests.framework */, BDF26A896226E51F6DD6DA0E /* Pods_ShareExtension.framework */, 358137F6293DF184E03C3572 /* Pods_Example_watchOS_Watch_App.framework */, + 24881A4A149E400F80B69E2A /* Pods_Example_tvOS.framework */, ); name = Frameworks; sourceTree = ""; @@ -1800,6 +1840,25 @@ productReference = 34DAD9982B6F919E00760A9C /* Example-visionOS.app */; productType = "com.apple.product-type.application"; }; + 34DAD9BA2B6F948100760A9C /* Example-tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 34DAD9CB2B6F948200760A9C /* Build configuration list for PBXNativeTarget "Example-tvOS" */; + buildPhases = ( + A6DA060FB75FA8E941AC901A /* [CP] Check Pods Manifest.lock */, + 34DAD9B72B6F948100760A9C /* Sources */, + 34DAD9B92B6F948100760A9C /* Resources */, + 9BB5336B6D820077BFE7F5F6 /* Frameworks */, + A2270AA9BEDB0382E0E452AF /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Example-tvOS"; + productName = "Example-tvOS"; + productReference = 34DAD9BB2B6F948100760A9C /* Example-tvOS.app */; + productType = "com.apple.product-type.application"; + }; 34E785482B513FCC00CBCBA1 /* ShareExtension */ = { isa = PBXNativeTarget; buildConfigurationList = 34E785592B513FCC00CBCBA1 /* Build configuration list for PBXNativeTarget "ShareExtension" */; @@ -1935,6 +1994,9 @@ 34DAD9972B6F919E00760A9C = { CreatedOnToolsVersion = 15.2; }; + 34DAD9BA2B6F948100760A9C = { + CreatedOnToolsVersion = 15.2; + }; 34E785482B513FCC00CBCBA1 = { CreatedOnToolsVersion = 15.1; DevelopmentTeam = SXBU677CPT; @@ -1982,6 +2044,7 @@ 34E785482B513FCC00CBCBA1 /* ShareExtension */, 34FBF1872B6A2C1C008C7587 /* Example-watchOS Watch App */, 34DAD9972B6F919E00760A9C /* Example-visionOS */, + 34DAD9BA2B6F948100760A9C /* Example-tvOS */, ); }; /* End PBXProject section */ @@ -2071,6 +2134,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34DAD9B92B6F948100760A9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34DAD9C82B6F948200760A9C /* LaunchScreen.storyboard in Resources */, + 34DAD9C52B6F948200760A9C /* Assets.xcassets in Resources */, + 34DAD9C32B6F948100760A9C /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 34E785472B513FCC00CBCBA1 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2177,7 +2250,7 @@ "${BUILT_PRODUCTS_DIR}/GrowingAPM/GrowingAPM.framework", "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-18cf2943/GrowingAnalytics.framework", "${BUILT_PRODUCTS_DIR}/GrowingToolsKit/GrowingToolsKit.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", "${BUILT_PRODUCTS_DIR}/SDCycleScrollView/SDCycleScrollView.framework", "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", @@ -2205,7 +2278,7 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-GrowingAnalyticsStartTests/Pods-GrowingAnalyticsStartTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-88384491/GrowingAnalytics.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -2383,7 +2456,7 @@ "${BUILT_PRODUCTS_DIR}/GrowingAPM/GrowingAPM.framework", "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-8f52182e/GrowingAnalytics.framework", "${BUILT_PRODUCTS_DIR}/GrowingToolsKit/GrowingToolsKit.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -2429,7 +2502,7 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-GrowingAnalyticsTests/Pods-GrowingAnalyticsTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-b35945a7/GrowingAnalytics.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -2451,7 +2524,7 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-ABTestingTests/Pods-ABTestingTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-cfbe515d/GrowingAnalytics.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", "${BUILT_PRODUCTS_DIR}/OHHTTPStubs/OHHTTPStubs.framework", ); @@ -2467,6 +2540,50 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ABTestingTests/Pods-ABTestingTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + A2270AA9BEDB0382E0E452AF /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-67f52605/GrowingAnalytics.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-tvOS/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/Protobuf-tvOS/Protobuf.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GrowingAnalytics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GrowingUtils.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + A6DA060FB75FA8E941AC901A /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-tvOS-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; BD21E0F09980000364B80451 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2475,7 +2592,7 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-HostApplicationTests/Pods-HostApplicationTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-d5b2e835/GrowingAnalytics.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", "${BUILT_PRODUCTS_DIR}/KIF/KIF.framework", ); @@ -2565,7 +2682,7 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-ProtobufTests/Pods-ProtobufTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-d5b2e835/GrowingAnalytics.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -2609,7 +2726,7 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-AdvertisingTests/Pods-AdvertisingTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-8f52182e/GrowingAnalytics.framework", - "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -2775,6 +2892,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34DAD9B72B6F948100760A9C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34DAD9C02B6F948100760A9C /* ViewController.swift in Sources */, + 34DAD9BE2B6F948100760A9C /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 34E785452B513FCC00CBCBA1 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2921,6 +3047,22 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; + 34DAD9C12B6F948100760A9C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 34DAD9C22B6F948100760A9C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 34DAD9C62B6F948200760A9C /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 34DAD9C72B6F948200760A9C /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; 34E7854E2B513FCC00CBCBA1 /* MainInterface.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -4098,6 +4240,118 @@ }; name = Release; }; + 34DAD9C92B6F948200760A9C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3770B519AE17A95967F4D21 /* Pods-Example-tvOS.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = SXBU677CPT; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-.Example-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 17.2; + }; + name = Debug; + }; + 34DAD9CA2B6F948200760A9C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E3A2065A7EA394ECBE6D2F68 /* Pods-Example-tvOS.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = SXBU677CPT; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-.Example-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 17.2; + }; + name = Release; + }; 34E785572B513FCC00CBCBA1 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 0344A9865CDD74AF1F8A6198 /* Pods-ShareExtension.debug.xcconfig */; @@ -4611,6 +4865,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 34DAD9CB2B6F948200760A9C /* Build configuration list for PBXNativeTarget "Example-tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 34DAD9C92B6F948200760A9C /* Debug */, + 34DAD9CA2B6F948200760A9C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 34E785592B513FCC00CBCBA1 /* Build configuration list for PBXNativeTarget "ShareExtension" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Example/Podfile b/Example/Podfile index 4d1469094..a699ed121 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -92,6 +92,11 @@ target 'Example-watchOS Watch App' do pod 'GrowingAnalytics/Tracker', :path => '../' end +target 'Example-tvOS' do + platform :tvos, '12.0' + pod 'GrowingAnalytics/Autotracker', :path => '../' +end + # target 'Example-visionOS' do # platform :visionos, '1.0' # pod 'GrowingAnalytics/Tracker', :path => '../' diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 9fa50c5fd..a90cc5f0d 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -105,9 +105,9 @@ PODS: - GrowingToolsKit/Core - GrowingToolsKit/XPathTrack (2.0.0): - GrowingToolsKit/Core - - GrowingUtils/AutotrackerCore (1.2.0): + - GrowingUtils/AutotrackerCore (1.2.1): - GrowingUtils/TrackerCore - - GrowingUtils/TrackerCore (1.2.0) + - GrowingUtils/TrackerCore (1.2.1) - KIF (3.8.9): - KIF/Core (= 3.8.9) - KIF/Core (3.8.9) @@ -163,13 +163,13 @@ SPEC CHECKSUMS: GrowingAnalytics: 183d75b3221b5becdeaca8954280a5d034febb66 GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b GrowingToolsKit: edc93c96e47bd6ad1ff3deffe72fe276ae0a1fa8 - GrowingUtils: 67f39629888d597a120b904213a128617ddcae25 + GrowingUtils: 0247e21b431d295f1ea67e04a18f662c1af6aefc KIF: 7660c626b0f2d4562533590960db70a36d640558 OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 Protobuf: 34db13339da0d02d64fa8a2ac6a124cfcc603703 SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf SDWebImage: fc8f2d48bbfd72ef39d70e981bd24a3f3be53fec -PODFILE CHECKSUM: 04f75853a34f62d286d1953abbc3995558c3b15e +PODFILE CHECKSUM: a6c6e36ec9a4330f52fb9f3ea4d2ea1be1c91bc5 COCOAPODS: 1.15.0 From c0979b55f53194ac9d295d05bcf728fbb82155cc Mon Sep 17 00:00:00 2001 From: YoloMao Date: Mon, 5 Feb 2024 18:49:04 +0800 Subject: [PATCH 11/36] fix: use nw_path_monitor_t to determine network status --- .../Event/GrowingEventManager.m | 11 +- GrowingTrackerCore/Event/GrowingVisitEvent.m | 1 - GrowingTrackerCore/GrowingRealTracker.m | 2 + .../Network/GrowingNetworkInterfaceManager.h | 16 ++- .../Network/GrowingNetworkInterfaceManager.m | 77 ++++++++--- .../Network/GrowingNetworkPathMonitor.h | 35 +++++ .../Network/GrowingNetworkPathMonitor.m | 121 ++++++++++++++++++ .../Reachability/GrowingReachability.h | 10 +- .../Reachability/GrowingReachability.m | 32 ++--- 9 files changed, 251 insertions(+), 54 deletions(-) create mode 100644 GrowingTrackerCore/Network/GrowingNetworkPathMonitor.h create mode 100644 GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m diff --git a/GrowingTrackerCore/Event/GrowingEventManager.m b/GrowingTrackerCore/Event/GrowingEventManager.m index 3900d5cfd..ba0738d8b 100644 --- a/GrowingTrackerCore/Event/GrowingEventManager.m +++ b/GrowingTrackerCore/Event/GrowingEventManager.m @@ -254,19 +254,20 @@ - (void)sendEventsOfChannel_unsafe:(GrowingEventChannel *)channel { return; } - [[GrowingNetworkInterfaceManager sharedInstance] updateInterfaceInfo]; + GrowingNetworkReachabilityStatus reachabilityStatus = [[GrowingNetworkInterfaceManager sharedInstance] currentStatus]; BOOL isViaCellular = NO; // 没网络 直接返回 - if (![GrowingNetworkInterfaceManager sharedInstance].isReachable) { + if (reachabilityStatus == GrowingNetworkReachabilityNotReachable) { // 没网络 直接返回 GIOLogDebug(@"No available Internet connection, delay upload (channel = %@).", channel.name); return; } - NSUInteger policyMask = GrowingEventSendPolicyInstant; - if ([GrowingNetworkInterfaceManager sharedInstance].WiFiValid) { + NSUInteger policyMask = GrowingEventSendPolicyInstant | GrowingEventSendPolicyMobileData | GrowingEventSendPolicyWiFi; + if (reachabilityStatus == GrowingNetworkReachabilityReachableViaWiFi + || reachabilityStatus == GrowingNetworkReachabilityReachableViaEthernet) { policyMask = GrowingEventSendPolicyInstant | GrowingEventSendPolicyMobileData | GrowingEventSendPolicyWiFi; - } else if ([GrowingNetworkInterfaceManager sharedInstance].WWANValid) { + } else if (reachabilityStatus == GrowingNetworkReachabilityReachableViaWWAN) { if (self.uploadEventSize < self.uploadLimitOfCellular) { GIOLogDebug(@"Upload key data with mobile network (channel = %@).", channel.name); policyMask = GrowingEventSendPolicyInstant | GrowingEventSendPolicyMobileData; diff --git a/GrowingTrackerCore/Event/GrowingVisitEvent.m b/GrowingTrackerCore/Event/GrowingVisitEvent.m index 36abc716a..f4bcecd2d 100644 --- a/GrowingTrackerCore/Event/GrowingVisitEvent.m +++ b/GrowingTrackerCore/Event/GrowingVisitEvent.m @@ -21,7 +21,6 @@ #import "GrowingTrackerCore/Event/GrowingEventManager.h" #import "GrowingTrackerCore/Event/GrowingTrackEventType.h" #import "GrowingTrackerCore/GrowingRealTracker.h" -#import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" @implementation GrowingVisitEvent diff --git a/GrowingTrackerCore/GrowingRealTracker.m b/GrowingTrackerCore/GrowingRealTracker.m index 9bf7196d7..e4cb28f20 100644 --- a/GrowingTrackerCore/GrowingRealTracker.m +++ b/GrowingTrackerCore/GrowingRealTracker.m @@ -37,6 +37,7 @@ #import "GrowingTrackerCore/Timer/GrowingEventTimer.h" #import "GrowingTrackerCore/Utils/GrowingArgumentChecker.h" #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" +#import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" #import "GrowingULAppLifecycle.h" NSString *const GrowingTrackerVersionName = @"4.2.0"; @@ -63,6 +64,7 @@ - (instancetype)initWithConfiguration:(GrowingTrackConfiguration *)configuration } [self loggerSetting]; + [GrowingNetworkInterfaceManager startMonitor]; [GrowingULAppLifecycle setup]; [GrowingSession startSession]; #if Growing_OS_IOS diff --git a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h index 7af7a6d8f..0ab87f15e 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h +++ b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h @@ -19,15 +19,19 @@ #import -@interface GrowingNetworkInterfaceManager : NSObject +typedef NS_ENUM(NSUInteger, GrowingNetworkReachabilityStatus) { + GrowingNetworkReachabilityUndetermined = 0, + GrowingNetworkReachabilityNotReachable, + GrowingNetworkReachabilityReachableViaEthernet, + GrowingNetworkReachabilityReachableViaWiFi, + GrowingNetworkReachabilityReachableViaWWAN, +}; -@property (nonatomic, assign, readonly) BOOL WWANValid; -@property (nonatomic, assign, readonly) BOOL WiFiValid; -@property (nonatomic, assign, readonly) BOOL isReachable; +@interface GrowingNetworkInterfaceManager : NSObject + (instancetype)sharedInstance; - -- (void)updateInterfaceInfo; ++ (void)startMonitor; +- (GrowingNetworkReachabilityStatus)currentStatus; - (NSString *)networkType; @end diff --git a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m index a2d8d897b..14fefbba5 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m +++ b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m @@ -20,6 +20,7 @@ #import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" #import "GrowingTargetConditionals.h" #import "GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h" +#import "GrowingTrackerCore/Network/GrowingNetworkPathMonitor.h" #if Growing_OS_PURE_IOS #import @@ -28,9 +29,8 @@ @interface GrowingNetworkInterfaceManager () @property (nonatomic, strong) GrowingReachability *internetReachability; -@property (nonatomic, assign, readwrite) BOOL WWANValid; -@property (nonatomic, assign, readwrite) BOOL WiFiValid; -@property (nonatomic, assign, readwrite) BOOL isReachable; +@property (nonatomic, strong) GrowingNetworkPathMonitor *monitor; +@property (nonatomic, strong) dispatch_queue_t monitorQueue; #if Growing_OS_PURE_IOS @property (nonatomic, strong) CTTelephonyNetworkInfo *teleInfo; @@ -41,9 +41,9 @@ @interface GrowingNetworkInterfaceManager () @implementation GrowingNetworkInterfaceManager + (instancetype)sharedInstance { - static dispatch_once_t pred; - __strong static id sharedInstance = nil; - dispatch_once(&pred, ^{ + static dispatch_once_t onceToken; + static id sharedInstance = nil; + dispatch_once(&onceToken, ^{ sharedInstance = [[self alloc] init]; }); return sharedInstance; @@ -52,29 +52,29 @@ + (instancetype)sharedInstance { - (instancetype)init { self = [super init]; if (self) { - _internetReachability = [GrowingReachability reachabilityForInternetConnection]; - [_internetReachability startNotifier]; + _monitorQueue = dispatch_queue_create("com.growingio.network.monitorQueue", DISPATCH_QUEUE_SERIAL); #if Growing_OS_PURE_IOS _teleInfo = [[CTTelephonyNetworkInfo alloc] init]; #endif + [self monitorInitialize]; } return self; } -- (void)updateInterfaceInfo { - GrowingNetworkStatus netStatus = self.internetReachability.networkStatus; - self.WiFiValid = netStatus == GrowingReachabilityViaWiFi; - self.WWANValid = netStatus == GrowingReachabilityViaWWAN; - self.isReachable = netStatus != GrowingReachabilityNotReachable; // contain GrowingReachabilityUnknown ++ (void)startMonitor { + [[self sharedInstance] startMonitor]; } - (NSString *)networkType { - GrowingNetworkStatus netStatus = self.internetReachability.networkStatus; - if (netStatus == GrowingReachabilityViaWiFi) { + GrowingNetworkReachabilityStatus reachabilityStatus = [self currentStatus]; + if (reachabilityStatus == GrowingNetworkReachabilityReachableViaWiFi) { return @"WIFI"; -#if Growing_OS_PURE_IOS - } else if (netStatus == GrowingReachabilityViaWWAN) { + } else if (reachabilityStatus == GrowingNetworkReachabilityReachableViaWWAN) { +#if Growing_OS_WATCH + // https://www.apple.com/watch/cellular/ + return @"4G"; +#elif Growing_OS_PURE_IOS NSArray *typeStrings4G = @[CTRadioAccessTechnologyLTE]; NSString *accessString = CTRadioAccessTechnologyLTE; // default 4G if (@available(iOS 12.0, *)) { @@ -99,10 +99,51 @@ - (NSString *)networkType { #endif } #endif + } else if (reachabilityStatus == GrowingNetworkReachabilityReachableViaEthernet) { + return @"WIFI"; // @"Ethernet" } - // GrowingReachabilityUnknown or GrowingReachabilityNotReachable + // GrowingNetworkReachabilityUndetermined or GrowingNetworkReachabilityNotReachable return @"UNKNOWN"; } + +- (GrowingNetworkReachabilityStatus)currentStatus { + GrowingNetworkReachabilityStatus reachabilityStatus = GrowingNetworkReachabilityUndetermined; +#if Growing_OS_VISION + if (1) { // if (@available(visionOS 1.0, *)) { +#else + if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { +#endif + reachabilityStatus = self.monitor.reachabilityStatus; + } else { + reachabilityStatus = self.internetReachability.reachabilityStatus; + } + + return reachabilityStatus; +} + +- (void)monitorInitialize { +#if Growing_OS_VISION + if (1) { // if (@available(visionOS 1.0, *)) { +#else + if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { +#endif + _monitor = [GrowingNetworkPathMonitor monitorWithQueue:_monitorQueue]; + } else { + _internetReachability = [GrowingReachability reachabilityForInternetConnection]; + } +} + +- (void)startMonitor { +#if Growing_OS_VISION + if (1) { // if (@available(visionOS 1.0, *)) { +#else + if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { +#endif + [_monitor startMonitor]; + } else { + [_internetReachability startNotifier]; + } +} @end diff --git a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.h b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.h new file mode 100644 index 000000000..a8e6219b3 --- /dev/null +++ b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.h @@ -0,0 +1,35 @@ +// +// GrowingNetworkPathMonitor.h +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/5. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import +#import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface GrowingNetworkPathMonitor : NSObject + +@property (nonatomic, assign, readonly) GrowingNetworkReachabilityStatus reachabilityStatus; + ++ (instancetype)monitorWithQueue:(dispatch_queue_t)queue; +- (void)startMonitor; +- (void)stopMonitor; + +@end + +NS_ASSUME_NONNULL_END diff --git a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m new file mode 100644 index 000000000..2370c5cca --- /dev/null +++ b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m @@ -0,0 +1,121 @@ +// +// GrowingNetworkPathMonitor.m +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/5. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "GrowingTrackerCore/Network/GrowingNetworkPathMonitor.h" +#import +#import "GrowingTargetConditionals.h" + +@interface GrowingNetworkPathMonitor () + +@property (nonatomic, assign, readwrite) GrowingNetworkReachabilityStatus reachabilityStatus; +@property (nonatomic, strong) nw_path_monitor_t monitor; + +@end + +@implementation GrowingNetworkPathMonitor + +- (instancetype)initWithQueue:(dispatch_queue_t)monitorQueue { + if (self = [super init]) { + _reachabilityStatus = GrowingNetworkReachabilityUndetermined; +#if Growing_OS_VISION + if (1) { // if (@available(visionOS 1.0, *)) { +#else + if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { +#endif + _monitor = nw_path_monitor_create(); + nw_path_monitor_set_queue(_monitor, monitorQueue); + + __weak typeof(self) weakSelf = self; + nw_path_monitor_set_update_handler(_monitor, ^(nw_path_t _Nonnull path) { + if (weakSelf == nil) { + return; + } + __strong typeof(weakSelf) strongSelf = weakSelf; + [strongSelf reachabilityPathChanged:path]; + }); + } + } + + return self; +} + ++ (instancetype)monitorWithQueue:(dispatch_queue_t)queue { + return [[self alloc] initWithQueue:queue]; +} + +- (void)dealloc { + [self stopMonitor]; +} + +- (void)startMonitor { +#if Growing_OS_VISION + if (1) { // if (@available(visionOS 1.0, *)) { +#else + if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { +#endif + nw_path_monitor_start(self.monitor); + } +} + +- (void)stopMonitor { +#if Growing_OS_VISION + if (1) { // if (@available(visionOS 1.0, *)) { +#else + if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { +#endif + nw_path_monitor_cancel(self.monitor); + } +} + +#if Growing_OS_VISION +- (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path { +#else +- (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { + nw_path_status_t status = nw_path_get_status(path); + if (status != nw_path_status_satisfied) { + return GrowingNetworkReachabilityNotReachable; + } + + BOOL isWiFi = nw_path_uses_interface_type(path, nw_interface_type_wifi); + BOOL isCellular = nw_path_uses_interface_type(path, nw_interface_type_cellular); + BOOL isEthernet = nw_path_uses_interface_type(path, nw_interface_type_wired); + if (isEthernet) { + return GrowingNetworkReachabilityReachableViaEthernet; + } else if (isWiFi) { + return GrowingNetworkReachabilityReachableViaWiFi; + } else if (isCellular) { + return GrowingNetworkReachabilityReachableViaWWAN; + } + + return GrowingNetworkReachabilityUndetermined; +} +#endif + +#if Growing_OS_VISION +- (void)reachabilityPathChanged:(nw_path_t)path { +#else +- (void)reachabilityPathChanged:(nw_path_t)path API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { + GrowingNetworkReachabilityStatus status = [self reachabilityStatusForPath:path]; + if (self.reachabilityStatus != status) { + self.reachabilityStatus = status; + } +} +#endif + +@end diff --git a/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h b/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h index 9ded84a82..69c6ac609 100644 --- a/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h +++ b/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h @@ -7,20 +7,14 @@ */ #import "GrowingTargetConditionals.h" +#import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" #if !Growing_OS_WATCH #import #endif -typedef enum : NSInteger { - GrowingReachabilityUnknown = 0, - GrowingReachabilityNotReachable, - GrowingReachabilityViaWiFi, - GrowingReachabilityViaWWAN, -} GrowingNetworkStatus; - @interface GrowingReachability : NSObject -@property (nonatomic, assign, readonly) GrowingNetworkStatus networkStatus; +@property (nonatomic, assign, readonly) GrowingNetworkReachabilityStatus reachabilityStatus; /*! * Checks whether the default route is available. Should be used by applications that do not connect to a particular host. diff --git a/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.m b/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.m index 76e36da4a..4a8203efb 100644 --- a/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.m +++ b/GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.m @@ -27,7 +27,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, @interface GrowingReachability () -@property (nonatomic, assign, readwrite) GrowingNetworkStatus networkStatus; +@property (nonatomic, assign, readwrite) GrowingNetworkReachabilityStatus reachabilityStatus; #if !Growing_OS_WATCH @property (nonatomic, assign) SCNetworkReachabilityRef reachabilityRef; #endif @@ -38,7 +38,7 @@ @implementation GrowingReachability - (instancetype)initWithAddress:(const struct sockaddr *)hostAddress { if (self = [super init]) { - _networkStatus = GrowingReachabilityUnknown; + _reachabilityStatus = GrowingNetworkReachabilityUndetermined; #if !Growing_OS_WATCH SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, hostAddress); @@ -46,7 +46,7 @@ - (instancetype)initWithAddress:(const struct sockaddr *)hostAddress { _reachabilityRef = reachability; SCNetworkReachabilityFlags flags = 0; if (SCNetworkReachabilityGetFlags(reachability, &flags)) { - _networkStatus = [self networkStatusForFlags:flags]; + _reachabilityStatus = [self reachabilityStatusForFlags:flags]; } } #endif @@ -100,13 +100,13 @@ - (void)stopNotifier { SCNetworkReachabilityUnscheduleFromRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); - _networkStatus = GrowingReachabilityUnknown; + _reachabilityStatus = GrowingNetworkReachabilityUndetermined; #endif } - (void)dealloc { - [self stopNotifier]; #if !Growing_OS_WATCH + [self stopNotifier]; if (_reachabilityRef) { CFRelease(_reachabilityRef); _reachabilityRef = nil; @@ -117,16 +117,16 @@ - (void)dealloc { #pragma mark - Network Flag Handling #if !Growing_OS_WATCH -- (GrowingNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags { +- (GrowingNetworkReachabilityStatus)reachabilityStatusForFlags:(SCNetworkReachabilityFlags)flags { if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) { // The target host is not reachable. - return GrowingReachabilityNotReachable; + return GrowingNetworkReachabilityNotReachable; } - GrowingNetworkStatus returnValue = GrowingReachabilityNotReachable; + GrowingNetworkReachabilityStatus returnValue = GrowingNetworkReachabilityNotReachable; if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) { // If the target host is reachable and no connection is required then we'll assume (for now) that you're on Wi-Fi... - returnValue = GrowingReachabilityViaWiFi; + returnValue = GrowingNetworkReachabilityReachableViaWiFi; } if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || @@ -134,16 +134,16 @@ - (GrowingNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags //and the connection is on-demand (or on-traffic) if the calling application is using the CFSocketStream or higher APIs... if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) { // and no [user] intervention is needed... - returnValue = GrowingReachabilityViaWiFi; + returnValue = GrowingNetworkReachabilityReachableViaWiFi; } } -#if Growing_OS_IOS || Growing_OS_TV || Growing_OS_VISION - if (returnValue == GrowingReachabilityViaWiFi) { +#if Growing_OS_IOS || Growing_OS_TV + if (returnValue == GrowingNetworkReachabilityReachableViaWiFi) { // is reachable... if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) { // but WWAN connections are OK if the calling application is using the CFNetwork APIs. - returnValue = GrowingReachabilityViaWWAN; + returnValue = GrowingNetworkReachabilityReachableViaWWAN; } } #endif @@ -152,9 +152,9 @@ - (GrowingNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags } - (void)reachabilityFlagsChanged:(SCNetworkReachabilityFlags)flags { - GrowingNetworkStatus status = [self networkStatusForFlags:flags]; - if (_networkStatus != status) { - _networkStatus = status; + GrowingNetworkReachabilityStatus status = [self reachabilityStatusForFlags:flags]; + if (_reachabilityStatus != status) { + _reachabilityStatus = status; } } #endif From 1bb3b7ba7c9ca9ec2671f2c1fc5d1147a37faa98 Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Mon, 5 Feb 2024 10:49:53 +0000 Subject: [PATCH 12/36] style: code format --- .../Event/GrowingEventManager.m | 10 ++++++---- GrowingTrackerCore/GrowingRealTracker.m | 2 +- .../Network/GrowingNetworkInterfaceManager.m | 12 ++++++------ .../Network/GrowingNetworkPathMonitor.m | 19 ++++++++++--------- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/GrowingTrackerCore/Event/GrowingEventManager.m b/GrowingTrackerCore/Event/GrowingEventManager.m index ba0738d8b..b024a27e7 100644 --- a/GrowingTrackerCore/Event/GrowingEventManager.m +++ b/GrowingTrackerCore/Event/GrowingEventManager.m @@ -254,7 +254,8 @@ - (void)sendEventsOfChannel_unsafe:(GrowingEventChannel *)channel { return; } - GrowingNetworkReachabilityStatus reachabilityStatus = [[GrowingNetworkInterfaceManager sharedInstance] currentStatus]; + GrowingNetworkReachabilityStatus reachabilityStatus = + [[GrowingNetworkInterfaceManager sharedInstance] currentStatus]; BOOL isViaCellular = NO; // 没网络 直接返回 if (reachabilityStatus == GrowingNetworkReachabilityNotReachable) { @@ -262,9 +263,10 @@ - (void)sendEventsOfChannel_unsafe:(GrowingEventChannel *)channel { GIOLogDebug(@"No available Internet connection, delay upload (channel = %@).", channel.name); return; } - NSUInteger policyMask = GrowingEventSendPolicyInstant | GrowingEventSendPolicyMobileData | GrowingEventSendPolicyWiFi; - if (reachabilityStatus == GrowingNetworkReachabilityReachableViaWiFi - || reachabilityStatus == GrowingNetworkReachabilityReachableViaEthernet) { + NSUInteger policyMask = + GrowingEventSendPolicyInstant | GrowingEventSendPolicyMobileData | GrowingEventSendPolicyWiFi; + if (reachabilityStatus == GrowingNetworkReachabilityReachableViaWiFi || + reachabilityStatus == GrowingNetworkReachabilityReachableViaEthernet) { policyMask = GrowingEventSendPolicyInstant | GrowingEventSendPolicyMobileData | GrowingEventSendPolicyWiFi; } else if (reachabilityStatus == GrowingNetworkReachabilityReachableViaWWAN) { diff --git a/GrowingTrackerCore/GrowingRealTracker.m b/GrowingTrackerCore/GrowingRealTracker.m index e4cb28f20..9dcf2ed9e 100644 --- a/GrowingTrackerCore/GrowingRealTracker.m +++ b/GrowingTrackerCore/GrowingRealTracker.m @@ -28,6 +28,7 @@ #import "GrowingTrackerCore/LogFormat/GrowingWSLoggerFormat.h" #import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h" #import "GrowingTrackerCore/Manager/GrowingSession.h" +#import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" #import "GrowingTrackerCore/Public/GrowingAttributesBuilder.h" #import "GrowingTrackerCore/Public/GrowingModuleManager.h" #import "GrowingTrackerCore/Public/GrowingServiceManager.h" @@ -37,7 +38,6 @@ #import "GrowingTrackerCore/Timer/GrowingEventTimer.h" #import "GrowingTrackerCore/Utils/GrowingArgumentChecker.h" #import "GrowingTrackerCore/Utils/GrowingDeviceInfo.h" -#import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" #import "GrowingULAppLifecycle.h" NSString *const GrowingTrackerVersionName = @"4.2.0"; diff --git a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m index 14fefbba5..27931f1f5 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m +++ b/GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.m @@ -19,8 +19,8 @@ #import "GrowingTrackerCore/Network/GrowingNetworkInterfaceManager.h" #import "GrowingTargetConditionals.h" -#import "GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h" #import "GrowingTrackerCore/Network/GrowingNetworkPathMonitor.h" +#import "GrowingTrackerCore/Thirdparty/Reachability/GrowingReachability.h" #if Growing_OS_PURE_IOS #import @@ -100,17 +100,17 @@ - (NSString *)networkType { } #endif } else if (reachabilityStatus == GrowingNetworkReachabilityReachableViaEthernet) { - return @"WIFI"; // @"Ethernet" + return @"WIFI"; // @"Ethernet" } // GrowingNetworkReachabilityUndetermined or GrowingNetworkReachabilityNotReachable return @"UNKNOWN"; } - + - (GrowingNetworkReachabilityStatus)currentStatus { GrowingNetworkReachabilityStatus reachabilityStatus = GrowingNetworkReachabilityUndetermined; #if Growing_OS_VISION - if (1) { // if (@available(visionOS 1.0, *)) { + if (1) { // if (@available(visionOS 1.0, *)) { #else if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { #endif @@ -124,7 +124,7 @@ - (GrowingNetworkReachabilityStatus)currentStatus { - (void)monitorInitialize { #if Growing_OS_VISION - if (1) { // if (@available(visionOS 1.0, *)) { + if (1) { // if (@available(visionOS 1.0, *)) { #else if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { #endif @@ -136,7 +136,7 @@ - (void)monitorInitialize { - (void)startMonitor { #if Growing_OS_VISION - if (1) { // if (@available(visionOS 1.0, *)) { + if (1) { // if (@available(visionOS 1.0, *)) { #else if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { #endif diff --git a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m index 2370c5cca..8b49e02ca 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m +++ b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m @@ -34,13 +34,13 @@ - (instancetype)initWithQueue:(dispatch_queue_t)monitorQueue { if (self = [super init]) { _reachabilityStatus = GrowingNetworkReachabilityUndetermined; #if Growing_OS_VISION - if (1) { // if (@available(visionOS 1.0, *)) { + if (1) { // if (@available(visionOS 1.0, *)) { #else if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { #endif _monitor = nw_path_monitor_create(); nw_path_monitor_set_queue(_monitor, monitorQueue); - + __weak typeof(self) weakSelf = self; nw_path_monitor_set_update_handler(_monitor, ^(nw_path_t _Nonnull path) { if (weakSelf == nil) { @@ -58,14 +58,14 @@ - (instancetype)initWithQueue:(dispatch_queue_t)monitorQueue { + (instancetype)monitorWithQueue:(dispatch_queue_t)queue { return [[self alloc] initWithQueue:queue]; } - + - (void)dealloc { [self stopMonitor]; } - (void)startMonitor { #if Growing_OS_VISION - if (1) { // if (@available(visionOS 1.0, *)) { + if (1) { // if (@available(visionOS 1.0, *)) { #else if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { #endif @@ -75,7 +75,7 @@ - (void)startMonitor { - (void)stopMonitor { #if Growing_OS_VISION - if (1) { // if (@available(visionOS 1.0, *)) { + if (1) { // if (@available(visionOS 1.0, *)) { #else if (@available(iOS 12.0, macCatalyst 13.0, macOS 10.14, tvOS 12.0, watchOS 6.0, *)) { #endif @@ -86,12 +86,13 @@ - (void)stopMonitor { #if Growing_OS_VISION - (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path { #else -- (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { +- (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path + API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { nw_path_status_t status = nw_path_get_status(path); if (status != nw_path_status_satisfied) { return GrowingNetworkReachabilityNotReachable; } - + BOOL isWiFi = nw_path_uses_interface_type(path, nw_interface_type_wifi); BOOL isCellular = nw_path_uses_interface_type(path, nw_interface_type_cellular); BOOL isEthernet = nw_path_uses_interface_type(path, nw_interface_type_wired); @@ -108,7 +109,7 @@ - (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path AP #endif #if Growing_OS_VISION -- (void)reachabilityPathChanged:(nw_path_t)path { + -(void)reachabilityPathChanged : (nw_path_t)path { #else - (void)reachabilityPathChanged:(nw_path_t)path API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { GrowingNetworkReachabilityStatus status = [self reachabilityStatusForPath:path]; @@ -118,4 +119,4 @@ - (void)reachabilityPathChanged:(nw_path_t)path API_AVAILABLE(ios(12.0), tvos(12 } #endif -@end + @end From e3e3a92adf9def6b9548759f967b3466a6c6b56c Mon Sep 17 00:00:00 2001 From: YoloMao Date: Tue, 6 Feb 2024 15:25:17 +0800 Subject: [PATCH 13/36] ci: update ci --- .github/workflows/ci.yml | 5 +- .github/workflows/spm.yml | 185 ++++++++++---------------------------- 2 files changed, 53 insertions(+), 137 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 239d5369e..55684f1d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,11 +12,14 @@ concurrency: jobs: build: - runs-on: macos-latest + runs-on: macos-13 env: DERIVED_DATA: $HOME/.DerivedData steps: + - name: Force Xcode 15 + run: sudo xcode-select -switch /Applications/Xcode_15.2.app + - name: Checkout Repo uses: actions/checkout@v4 with: diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index e2176302f..282d7324c 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -11,145 +11,58 @@ concurrency: cancel-in-progress: true jobs: - autotracker-build-iOS: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingAutotracker -destination 'platform=iOS Simulator,name=iPhone 14' \ - | xcbeautify --renderer github-actions - - autotracker-build-catalyst: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingAutotracker -destination 'platform=macOS,variant=Mac Catalyst' \ - | xcbeautify --renderer github-actions - - tracker-build-iOS: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingTracker -destination 'platform=iOS Simulator,name=iPhone 14' \ - | xcbeautify --renderer github-actions - - tracker-build-catalyst: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingTracker -destination 'platform=macOS,variant=Mac Catalyst' \ - | xcbeautify --renderer github-actions - - tracker-build-macos: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingTracker -destination 'platform=macOS' \ - | xcbeautify --renderer github-actions - - ads-build-iOS: - runs-on: macos-latest - + spm-build: + strategy: + matrix: + target: [ + iOS, + macOS, + macCatalyst, + tvOS, + watchOS + ] + os: [macos-12, macos-13] + include: + - os: macos-12 + xcode: Xcode_14.2 + - os: macos-13 + xcode: Xcode_15.2 + - target: iOS + platform: iOS Simulator,name=iPhone 14 Pro Max + - target: macOS + platform: macOS + - target: macCatalyst + platform: macOS,variant=Mac Catalyst + - target: tvOS + platform: tvOS Simulator,name=Apple TV + - target: watchOS + platform: watchOS Simulator,name=Apple Watch Ultra (49mm) + - scheme: GrowingAnalytics-Package + target: iOS + - scheme: GrowingAutotracker + target: macCatalyst + - scheme: GrowingAutotracker + target: tvOS + - scheme: GrowingTracker + target: macOS + - scheme: GrowingTracker + target: watchOS + - target: visionOS + os: macos-14 + xcode: Xcode_15.2 + platform: visionOS Simulator,name=Apple Vision Pro + scheme: GrowingTracker + runs-on: ${{ matrix.os }} steps: - name: Checkout Repo uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingModule_Ads -destination 'platform=iOS Simulator,name=iPhone 14' \ - | xcbeautify --renderer github-actions - - apm-build-iOS: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingModule_APM -destination 'platform=iOS Simulator,name=iPhone 14' \ - | xcbeautify --renderer github-actions - - apm-build-catalyst: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingModule_APM -destination 'platform=macOS,variant=Mac Catalyst' \ - | xcbeautify --renderer github-actions - - hybrid-build-iOS: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingModule_Hybrid -destination 'platform=iOS Simulator,name=iPhone 14' \ - | xcbeautify --renderer github-actions - - hybrid-build-catalyst: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Build - run: | - set -euo pipefail - xcodebuild build -scheme GrowingModule_Hybrid -destination 'platform=macOS,variant=Mac Catalyst' \ - | xcbeautify --renderer github-actions - - imp-build-iOS: - runs-on: macos-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - + - uses: mikehardy/buildcache-action@a50b89d53bb0a8da7b8d4c69f0bc0f0527b7b5c6 + with: + cache_key: spm-build-${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}-${{ matrix.scheme }} + - name: Xcode + run: sudo xcode-select -switch /Applications/${{ matrix.xcode }}.app - name: Build run: | set -euo pipefail - xcodebuild build -scheme GrowingModule_ImpressionTrack -destination 'platform=iOS Simulator,name=iPhone 14' \ - | xcbeautify --renderer github-actions + xcodebuild build -scheme ${{ matrix.scheme }} -destination 'platform=${{ matrix.platform }}' \ + | xcbeautify --renderer github-actions \ No newline at end of file From 1ce4debe2bfbfeb75329844a5cde95906c526af0 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Tue, 6 Feb 2024 15:32:08 +0800 Subject: [PATCH 14/36] fix: target condition judge --- .../Network/GrowingNetworkPathMonitor.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m index 8b49e02ca..2ccc64dc9 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m +++ b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m @@ -86,8 +86,8 @@ - (void)stopMonitor { #if Growing_OS_VISION - (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path { #else -- (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path - API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { +- (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { +#endif nw_path_status_t status = nw_path_get_status(path); if (status != nw_path_status_satisfied) { return GrowingNetworkReachabilityNotReachable; @@ -106,17 +106,16 @@ - (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path return GrowingNetworkReachabilityUndetermined; } -#endif #if Growing_OS_VISION - -(void)reachabilityPathChanged : (nw_path_t)path { +- (void)reachabilityPathChanged:(nw_path_t)path { #else - (void)reachabilityPathChanged:(nw_path_t)path API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { +#endif GrowingNetworkReachabilityStatus status = [self reachabilityStatusForPath:path]; if (self.reachabilityStatus != status) { self.reachabilityStatus = status; } } -#endif - @end +@end From fd2227a7f1ad2835f6b7fe84bbaeb2fc61b14971 Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Tue, 6 Feb 2024 07:32:36 +0000 Subject: [PATCH 15/36] style: code format --- GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m index 2ccc64dc9..eb2f1d86c 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m +++ b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m @@ -86,7 +86,8 @@ - (void)stopMonitor { #if Growing_OS_VISION - (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path { #else -- (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { +- (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path + API_AVAILABLE(ios(12.0), tvos(12.0), macos(10.14), watchos(6.0)) { #endif nw_path_status_t status = nw_path_get_status(path); if (status != nw_path_status_satisfied) { From 1aec1e320da6c290c7fb9fa0e8eb47923473576b Mon Sep 17 00:00:00 2001 From: YoloMao Date: Tue, 6 Feb 2024 17:19:27 +0800 Subject: [PATCH 16/36] chore: remove using of RealityKitContent in visionOS demo --- Example/Example-visionOS/ContentView.swift | 5 - Example/Example.xcodeproj/project.pbxproj | 26 --- .../ProjectData/main.json | 11 - .../WorkspaceData/SceneMetadataList.json | 209 ----------------- .../WorkspaceData/Settings.rcprojectdata | 17 -- .../Packages/RealityKitContent/Package.swift | 27 --- Example/Packages/RealityKitContent/README.md | 3 - .../Materials/GridMaterial.usda | 216 ------------------ .../RealityKitContent.rkassets/Scene.usda | 59 ----- .../RealityKitContent/RealityKitContent.swift | 4 - 10 files changed, 577 deletions(-) delete mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json delete mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json delete mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata delete mode 100644 Example/Packages/RealityKitContent/Package.swift delete mode 100644 Example/Packages/RealityKitContent/README.md delete mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda delete mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda delete mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift diff --git a/Example/Example-visionOS/ContentView.swift b/Example/Example-visionOS/ContentView.swift index b35df84e9..3bedc3cb5 100644 --- a/Example/Example-visionOS/ContentView.swift +++ b/Example/Example-visionOS/ContentView.swift @@ -18,16 +18,11 @@ // limitations under the License. import SwiftUI -import RealityKit -import RealityKitContent import GrowingAnalytics struct ContentView: View { var body: some View { VStack { - Model3D(named: "Scene", bundle: realityKitContentBundle) - .padding(.bottom, 50) - Text("Hello, world!") Button("TrackCustomEvent") { GrowingTracker.sharedInstance().trackCustomEvent("visionOS_custom_event", diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index d2941eba8..3be8f8eb0 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -171,7 +171,6 @@ 34BF77C92795571000CA18BA /* MockEventQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 4962653324DA66B600032551 /* MockEventQueue.m */; }; 34BF77CB279562AC00CA18BA /* ManualTrackHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4962653224DA66B600032551 /* ManualTrackHelper.m */; }; 34C0BF3A277EA7C90047ADC4 /* DataTrafficTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 34C0BF39277EA7C90047ADC4 /* DataTrafficTest.m */; }; - 34DAD99D2B6F919E00760A9C /* RealityKitContent in Frameworks */ = {isa = PBXBuildFile; productRef = 34DAD99C2B6F919E00760A9C /* RealityKitContent */; }; 34DAD99F2B6F919E00760A9C /* Example_visionOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DAD99E2B6F919E00760A9C /* Example_visionOSApp.swift */; }; 34DAD9A12B6F919E00760A9C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DAD9A02B6F919E00760A9C /* ContentView.swift */; }; 34DAD9A32B6F919F00760A9C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9A22B6F919F00760A9C /* Assets.xcassets */; }; @@ -479,7 +478,6 @@ 34C0BF39277EA7C90047ADC4 /* DataTrafficTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DataTrafficTest.m; sourceTree = ""; }; 34C0BF3C277EA9BA0047ADC4 /* MobileDebuggerTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MobileDebuggerTest.m; sourceTree = ""; }; 34DAD9982B6F919E00760A9C /* Example-visionOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-visionOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 34DAD99B2B6F919E00760A9C /* RealityKitContent */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = RealityKitContent; sourceTree = ""; }; 34DAD99E2B6F919E00760A9C /* Example_visionOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example_visionOSApp.swift; sourceTree = ""; }; 34DAD9A02B6F919E00760A9C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 34DAD9A22B6F919F00760A9C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -637,14 +635,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 34DAD9952B6F919E00760A9C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 34DAD99D2B6F919E00760A9C /* RealityKitContent in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 34E785462B513FCC00CBCBA1 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1487,14 +1477,6 @@ path = "Example-visionOS"; sourceTree = ""; }; - 34DAD99A2B6F919E00760A9C /* Packages */ = { - isa = PBXGroup; - children = ( - 34DAD99B2B6F919E00760A9C /* RealityKitContent */, - ); - path = Packages; - sourceTree = ""; - }; 34DAD9A42B6F919F00760A9C /* Preview Content */ = { isa = PBXGroup; children = ( @@ -1834,7 +1816,6 @@ ); name = "Example-visionOS"; packageProductDependencies = ( - 34DAD99C2B6F919E00760A9C /* RealityKitContent */, ); productName = "Example-visionOS"; productReference = 34DAD9982B6F919E00760A9C /* Example-visionOS.app */; @@ -4911,13 +4892,6 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ - -/* Begin XCSwiftPackageProductDependency section */ - 34DAD99C2B6F919E00760A9C /* RealityKitContent */ = { - isa = XCSwiftPackageProductDependency; - productName = RealityKitContent; - }; -/* End XCSwiftPackageProductDependency section */ }; rootObject = 6003F582195388D10070C39A /* Project object */; } diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json b/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json deleted file mode 100644 index 4a8c74bf3..000000000 --- a/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "pathsToIds" : { - "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/GridMaterial.usda" : "440DE5B4-E4E4-459B-AABF-9ACE96319272", - "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/procedural_sphere_grid.usda" : "34C460AE-CA1B-4348-BD05-621ACBDFFE97", - "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Scene.usda" : "0A9B4653-B11E-4D6A-850E-C6FCB621626C", - "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Untitled Scene.usda" : "03E02005-EFA6-48D6-8A76-05B2822A74E9", - "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/GridMaterial.usda" : "FBD8436F-6B8B-4B82-99B5-995D538B4704", - "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/procedural_sphere_grid.usda" : "1CBF3893-ABFD-408C-8B91-045BFD257808", - "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Scene.usda" : "26DBAE76-5DD8-47B6-A085-1B4ADA111097" - } -} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json deleted file mode 100644 index 1d84a750e..000000000 --- a/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "0A9B4653-B11E-4D6A-850E-C6FCB621626C" : { - "cameraTransform" : [ - 0.9807314, - -1.9820146e-10, - -0.195361, - 0, - -0.10051192, - 0.85749435, - -0.5045798, - 0, - 0.16752096, - 0.51449335, - 0.84097165, - 0, - 0.09084191, - 0.05849296, - 0.13903293, - 1 - ], - "objectMetadataList" : [ - [ - "0A9B4653-B11E-4D6A-850E-C6FCB621626C", - "Root" - ], - { - "isExpanded" : true, - "isLocked" : false - }, - [ - "0A9B4653-B11E-4D6A-850E-C6FCB621626C", - "Root", - "GridMaterial" - ], - { - "isExpanded" : true, - "isLocked" : false - }, - [ - "0A9B4653-B11E-4D6A-850E-C6FCB621626C", - "Root", - "Sphere" - ], - { - "isExpanded" : true, - "isLocked" : false - } - ] - }, - "1CBF3893-ABFD-408C-8B91-045BFD257808" : { - "cameraTransform" : [ - 0.99999994, - 0, - -0, - 0, - -0, - 0.8660255, - -0.49999988, - 0, - 0, - 0.49999988, - 0.8660255, - 0, - 0, - 0.27093542, - 0.46927398, - 1 - ], - "objectMetadataList" : [ - - ] - }, - "03E02005-EFA6-48D6-8A76-05B2822A74E9" : { - "cameraTransform" : [ - 0.99999994, - 0, - -0, - 0, - -0, - 0.8660254, - -0.49999994, - 0, - 0, - 0.49999994, - 0.8660254, - 0, - 0, - 0.5981957, - 1.0361054, - 1 - ], - "objectMetadataList" : [ - - ] - }, - "26DBAE76-5DD8-47B6-A085-1B4ADA111097" : { - "cameraTransform" : [ - 1, - 0, - -0, - 0, - -0, - 0.7071069, - -0.7071067, - 0, - 0, - 0.7071067, - 0.7071069, - 0, - 0, - 0.2681068, - 0.26850593, - 1 - ], - "objectMetadataList" : [ - [ - "26DBAE76-5DD8-47B6-A085-1B4ADA111097", - "Root" - ], - { - "isExpanded" : true, - "isLocked" : false - } - ] - }, - "34C460AE-CA1B-4348-BD05-621ACBDFFE97" : { - "cameraTransform" : [ - 0.99999994, - 0, - -0, - 0, - -0, - 0.8660255, - -0.49999988, - 0, - 0, - 0.49999988, - 0.8660255, - 0, - 0, - 0.27093542, - 0.46927398, - 1 - ], - "objectMetadataList" : [ - - ] - }, - "440DE5B4-E4E4-459B-AABF-9ACE96319272" : { - "cameraTransform" : [ - 0.99999994, - 0, - -0, - 0, - -0, - 0.8660254, - -0.49999994, - 0, - 0, - 0.49999994, - 0.8660254, - 0, - 0, - 0.5981957, - 1.0361054, - 1 - ], - "objectMetadataList" : [ - [ - "440DE5B4-E4E4-459B-AABF-9ACE96319272", - "Root" - ], - { - "isExpanded" : true, - "isLocked" : false - } - ] - }, - "FBD8436F-6B8B-4B82-99B5-995D538B4704" : { - "cameraTransform" : [ - 0.99999994, - 0, - -0, - 0, - -0, - 0.8660254, - -0.49999994, - 0, - 0, - 0.49999994, - 0.8660254, - 0, - 0, - 0.5981957, - 1.0361054, - 1 - ], - "objectMetadataList" : [ - [ - "FBD8436F-6B8B-4B82-99B5-995D538B4704", - "Root" - ], - { - "isExpanded" : true, - "isLocked" : false - } - ] - } -} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata deleted file mode 100644 index 6dea95c8d..000000000 --- a/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata +++ /dev/null @@ -1,17 +0,0 @@ -{ - "cameraPresets" : { - - }, - "secondaryToolbarData" : { - "isGridVisible" : true, - "sceneReverbPreset" : -1 - }, - "unitDefaults" : { - "°" : "°", - "kg" : "g", - "m" : "cm", - "m\/s" : "m\/s", - "m\/s²" : "m\/s²", - "s" : "s" - } -} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.swift b/Example/Packages/RealityKitContent/Package.swift deleted file mode 100644 index 7c7a403f5..000000000 --- a/Example/Packages/RealityKitContent/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// swift-tools-version:5.9 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "RealityKitContent", - products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. - .library( - name: "RealityKitContent", - targets: ["RealityKitContent"] - ), - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. - .target( - name: "RealityKitContent", - dependencies: [] - ), - ] -) diff --git a/Example/Packages/RealityKitContent/README.md b/Example/Packages/RealityKitContent/README.md deleted file mode 100644 index 486b5755e..000000000 --- a/Example/Packages/RealityKitContent/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# RealityKitContent - -A description of this package. \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda deleted file mode 100644 index b7afd0240..000000000 --- a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda +++ /dev/null @@ -1,216 +0,0 @@ -#usda 1.0 -( - defaultPrim = "Root" - metersPerUnit = 1 - upAxis = "Y" -) - -def Xform "Root" -{ - def Material "GridMaterial" - { - reorder nameChildren = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "DefaultSurfaceShader", "MaterialXPreviewSurface", "Texcoord", "Add", "Multiply", "Fractional", "LineCounts", "Multiply_1", "Separate2", "Separate2_1", "Ifgreater", "Ifgreater_1", "Max", "Background_Color"] - token outputs:mtlx:surface.connect = - token outputs:realitykit:vertex - token outputs:surface - float2 ui:nodegraph:realitykit:subgraphOutputs:pos = (2222, 300.5) - float2 ui:nodegraph:realitykit:subgraphOutputs:size = (182, 89) - int ui:nodegraph:realitykit:subgraphOutputs:stackingOrder = 749 - - def Shader "DefaultSurfaceShader" - { - uniform token info:id = "UsdPreviewSurface" - color3f inputs:diffuseColor = (1, 1, 1) - float inputs:roughness = 0.75 - token outputs:surface - } - - def Shader "MaterialXPreviewSurface" - { - uniform token info:id = "ND_UsdPreviewSurface_surfaceshader" - float inputs:clearcoat - float inputs:clearcoatRoughness - color3f inputs:diffuseColor.connect = - color3f inputs:emissiveColor - float inputs:ior - float inputs:metallic = 0.15 - float3 inputs:normal - float inputs:occlusion - float inputs:opacity - float inputs:opacityThreshold - float inputs:roughness = 0.5 - token outputs:out - float2 ui:nodegraph:node:pos = (1967, 300.5) - float2 ui:nodegraph:node:size = (208, 297) - int ui:nodegraph:node:stackingOrder = 870 - string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["Advanced"] - } - - def Shader "Texcoord" - { - uniform token info:id = "ND_texcoord_vector2" - float2 outputs:out - float2 ui:nodegraph:node:pos = (94.14453, 35.29297) - float2 ui:nodegraph:node:size = (182, 43) - int ui:nodegraph:node:stackingOrder = 1358 - } - - def Shader "Multiply" - { - uniform token info:id = "ND_multiply_vector2" - float2 inputs:in1.connect = - float2 inputs:in2 = (32, 15) - float2 inputs:in2.connect = - float2 outputs:out - float2 ui:nodegraph:node:pos = (275.64453, 47.29297) - float2 ui:nodegraph:node:size = (61, 36) - int ui:nodegraph:node:stackingOrder = 1348 - string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["inputs:in2"] - } - - def Shader "Fractional" - { - uniform token info:id = "ND_realitykit_fractional_vector2" - float2 inputs:in.connect = - float2 outputs:out - float2 ui:nodegraph:node:pos = (440.5, 49.5) - float2 ui:nodegraph:node:size = (155, 99) - int ui:nodegraph:node:stackingOrder = 1345 - } - - def Shader "BaseColor" - { - uniform token info:id = "ND_constant_color3" - color3f inputs:value = (0.89737034, 0.89737034, 0.89737034) ( - colorSpace = "Input - Texture - sRGB - sRGB" - ) - color3f inputs:value.connect = None - color3f outputs:out - float2 ui:nodegraph:node:pos = (1537.5977, 363.07812) - float2 ui:nodegraph:node:size = (150, 43) - int ui:nodegraph:node:stackingOrder = 1353 - } - - def Shader "LineColor" - { - uniform token info:id = "ND_constant_color3" - color3f inputs:value = (0.55945957, 0.55945957, 0.55945957) ( - colorSpace = "Input - Texture - sRGB - sRGB" - ) - color3f inputs:value.connect = None - color3f outputs:out - float2 ui:nodegraph:node:pos = (1536.9844, 287.86328) - float2 ui:nodegraph:node:size = (146, 43) - int ui:nodegraph:node:stackingOrder = 1355 - } - - def Shader "LineWidths" - { - uniform token info:id = "ND_combine2_vector2" - float inputs:in1 = 0.1 - float inputs:in2 = 0.1 - float2 outputs:out - float2 ui:nodegraph:node:pos = (443.64453, 233.79297) - float2 ui:nodegraph:node:size = (151, 43) - int ui:nodegraph:node:stackingOrder = 1361 - } - - def Shader "LineCounts" - { - uniform token info:id = "ND_combine2_vector2" - float inputs:in1 = 24 - float inputs:in2 = 12 - float2 outputs:out - float2 ui:nodegraph:node:pos = (94.14453, 138.29297) - float2 ui:nodegraph:node:size = (153, 43) - int ui:nodegraph:node:stackingOrder = 1359 - } - - def Shader "Remap" - { - uniform token info:id = "ND_remap_color3" - color3f inputs:in.connect = - color3f inputs:inhigh.connect = None - color3f inputs:inlow.connect = None - color3f inputs:outhigh.connect = - color3f inputs:outlow.connect = - color3f outputs:out - float2 ui:nodegraph:node:pos = (1755.5, 300.5) - float2 ui:nodegraph:node:size = (95, 171) - int ui:nodegraph:node:stackingOrder = 1282 - string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["inputs:outlow"] - } - - def Shader "Separate2" - { - uniform token info:id = "ND_separate2_vector2" - float2 inputs:in.connect = - float outputs:outx - float outputs:outy - float2 ui:nodegraph:node:pos = (1212.6445, 128.91797) - float2 ui:nodegraph:node:size = (116, 117) - int ui:nodegraph:node:stackingOrder = 1363 - } - - def Shader "Combine3" - { - uniform token info:id = "ND_combine3_color3" - float inputs:in1.connect = - float inputs:in2.connect = - float inputs:in3.connect = - color3f outputs:out - float2 ui:nodegraph:node:pos = (1578.1445, 128.91797) - float2 ui:nodegraph:node:size = (146, 54) - int ui:nodegraph:node:stackingOrder = 1348 - } - - def Shader "Range" - { - uniform token info:id = "ND_range_vector2" - bool inputs:doclamp = 1 - float2 inputs:gamma = (2, 2) - float2 inputs:in.connect = - float2 inputs:inhigh.connect = - float2 inputs:inlow = (0.02, 0.02) - float2 inputs:outhigh - float2 inputs:outlow - float2 outputs:out - float2 ui:nodegraph:node:pos = (990.64453, 128.91797) - float2 ui:nodegraph:node:size = (98, 207) - int ui:nodegraph:node:stackingOrder = 1364 - } - - def Shader "Subtract" - { - uniform token info:id = "ND_subtract_vector2" - float2 inputs:in1.connect = - float2 inputs:in2.connect = - float2 outputs:out - float2 ui:nodegraph:node:pos = (612.64453, 87.04297) - float2 ui:nodegraph:node:size = (63, 36) - int ui:nodegraph:node:stackingOrder = 1348 - } - - def Shader "Absval" - { - uniform token info:id = "ND_absval_vector2" - float2 inputs:in.connect = - float2 outputs:out - float2 ui:nodegraph:node:pos = (765.64453, 87.04297) - float2 ui:nodegraph:node:size = (123, 43) - int ui:nodegraph:node:stackingOrder = 1348 - } - - def Shader "Min" - { - uniform token info:id = "ND_min_float" - float inputs:in1.connect = - float inputs:in2.connect = - float outputs:out - float2 ui:nodegraph:node:pos = (1388.1445, 128.91797) - float2 ui:nodegraph:node:size = (114, 36) - int ui:nodegraph:node:stackingOrder = 1363 - } - } -} - diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda deleted file mode 100644 index 4cb070bf4..000000000 --- a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda +++ /dev/null @@ -1,59 +0,0 @@ -#usda 1.0 -( - defaultPrim = "Root" - metersPerUnit = 1 - upAxis = "Y" -) - -def Xform "Root" -{ - reorder nameChildren = ["GridMaterial", "Sphere"] - rel material:binding = None ( - bindMaterialAs = "weakerThanDescendants" - ) - - def Sphere "Sphere" ( - active = true - prepend apiSchemas = ["MaterialBindingAPI"] - ) - { - rel material:binding = ( - bindMaterialAs = "weakerThanDescendants" - ) - double radius = 0.05 - quatf xformOp:orient = (1, 0, 0, 0) - float3 xformOp:scale = (1, 1, 1) - float3 xformOp:translate = (0, 0, 0.0004) - uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] - - def RealityKitComponent "Collider" - { - uint group = 1 - uniform token info:id = "RealityKit.Collider" - uint mask = 4294967295 - token type = "Default" - - def RealityKitStruct "Shape" - { - float3 extent = (0.2, 0.2, 0.2) - float radius = 0.05 - token shapeType = "Sphere" - } - } - - def RealityKitComponent "InputTarget" - { - uniform token info:id = "RealityKit.InputTarget" - } - } - - def "GridMaterial" ( - active = true - prepend references = @Materials/GridMaterial.usda@ - ) - { - float3 xformOp:scale = (1, 1, 1) - uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] - } -} - diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift deleted file mode 100644 index 5caba4e3d..000000000 --- a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift +++ /dev/null @@ -1,4 +0,0 @@ -import Foundation - -/// Bundle for the RealityKitContent project -public let realityKitContentBundle = Bundle.module From da50b048915699a10f4ba3450748ba9a352f8c1c Mon Sep 17 00:00:00 2001 From: YoloMao Date: Tue, 6 Feb 2024 17:20:14 +0800 Subject: [PATCH 17/36] ci: update ci --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55684f1d6..239d5369e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,14 +12,11 @@ concurrency: jobs: build: - runs-on: macos-13 + runs-on: macos-latest env: DERIVED_DATA: $HOME/.DerivedData steps: - - name: Force Xcode 15 - run: sudo xcode-select -switch /Applications/Xcode_15.2.app - - name: Checkout Repo uses: actions/checkout@v4 with: From ba29954eb7f173ee3416d6f47275733620f44e74 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Tue, 6 Feb 2024 18:03:59 +0800 Subject: [PATCH 18/36] chore: swift macro is not compatible in Xcode 14 --- Example/Example-watchOS Watch App/ContentView.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Example/Example-watchOS Watch App/ContentView.swift b/Example/Example-watchOS Watch App/ContentView.swift index c1bb0b391..0db979d78 100644 --- a/Example/Example-watchOS Watch App/ContentView.swift +++ b/Example/Example-watchOS Watch App/ContentView.swift @@ -35,6 +35,14 @@ struct ContentView: View { } } -#Preview { - ContentView() +// Xcode 15+ +//#Preview { +// ContentView() +//} + +@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *) +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } } From af95bf75ad9606f23d2d338434580b718d8b177e Mon Sep 17 00:00:00 2001 From: YoloMao Date: Wed, 7 Feb 2024 10:50:00 +0800 Subject: [PATCH 19/36] fix: device orientation logic --- .../TrackerCoreTests/EventTests/EventTest.m | 56 +++++++------------ GrowingTrackerCore/GrowingRealTracker.m | 4 +- GrowingTrackerCore/Utils/GrowingDeviceInfo.h | 2 +- GrowingTrackerCore/Utils/GrowingDeviceInfo.m | 56 ++++++------------- 4 files changed, 39 insertions(+), 79 deletions(-) diff --git a/Example/GrowingAnalyticsTests/TrackerCoreTests/EventTests/EventTest.m b/Example/GrowingAnalyticsTests/TrackerCoreTests/EventTests/EventTest.m index 41c77218d..22ea2ab92 100644 --- a/Example/GrowingAnalyticsTests/TrackerCoreTests/EventTests/EventTest.m +++ b/Example/GrowingAnalyticsTests/TrackerCoreTests/EventTests/EventTest.m @@ -211,51 +211,33 @@ - (void)testGrowingPageEvent { .setAttributes(@{@"key": @"value"}); [GrowingEventManager.sharedInstance postEventBuilder:builder]; - // !!! 注意:这里有个隐藏的死锁问题 !!! - // 首次发送 GrowingPageEvent 时,-[GrowingDeviceInfo deviceOrientation] 中,有个子线程同步等待主线程的操作 - // 如果此时主线程也在同步等待子线程,则会造成死锁,比如在主线程调用以下代码: - // [GrowingDispatchManager dispatchInGrowingThread:^{} waitUntilDone:YES]; - // 因此,这里在子线程验证PageEvent - XCTestExpectation *expectation = [self expectationWithDescription:@"testGrowingPageEvent Test failed : timeout"]; - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - NSArray *events = [MockEventQueue.sharedQueue eventsFor:GrowingEventTypePage]; - XCTAssertEqual(events.count, 1); - - GrowingPageEvent *event = (GrowingPageEvent *)events.firstObject; - XCTAssertEqualObjects(event.eventType, GrowingEventTypePage); - XCTAssertEqualObjects(event.path, @"/path"); - XCTAssertEqualObjects(event.orientation, orientation); - XCTAssertEqualObjects(event.title, @"title"); - XCTAssertEqualObjects(event.referralPage, @"referralPage"); - XCTAssertEqualObjects(event.attributes[@"key"], @"value"); - - NSDictionary *dic = event.toDictionary; - XCTAssertEqualObjects(dic[@"eventType"], GrowingEventTypePage); - XCTAssertEqualObjects(dic[@"path"], @"/path"); - XCTAssertEqualObjects(dic[@"orientation"], orientation); - XCTAssertEqualObjects(dic[@"title"], @"title"); - XCTAssertEqualObjects(dic[@"referralPage"], @"referralPage"); - XCTAssertEqualObjects(dic[@"attributes"][@"key"], @"value"); - - NSMutableDictionary *mDic = dic.mutableCopy; - if (dic[@"orientation"] == nil && orientation == nil) { - // 在无HostApplication的Logic Test时,orientation将为nil,这里手动赋值为PORTRAIT - mDic[@"orientation"] = @"PORTRAIT"; - } - XCTAssertTrue([ManualTrackHelper pageEventCheck:mDic]); - XCTAssertTrue([ManualTrackHelper contextOptionalPropertyCheck:mDic]); + NSArray *events = [MockEventQueue.sharedQueue eventsFor:GrowingEventTypePage]; + XCTAssertEqual(events.count, 1); - [expectation fulfill]; - }); + GrowingPageEvent *event = (GrowingPageEvent *)events.firstObject; + XCTAssertEqualObjects(event.eventType, GrowingEventTypePage); + XCTAssertEqualObjects(event.path, @"/path"); + XCTAssertEqualObjects(event.orientation, orientation); + XCTAssertEqualObjects(event.title, @"title"); + XCTAssertEqualObjects(event.referralPage, @"referralPage"); + XCTAssertEqualObjects(event.attributes[@"key"], @"value"); - [self waitForExpectationsWithTimeout:3.0f handler:nil]; + NSDictionary *dic = event.toDictionary; + XCTAssertEqualObjects(dic[@"eventType"], GrowingEventTypePage); + XCTAssertEqualObjects(dic[@"path"], @"/path"); + XCTAssertEqualObjects(dic[@"orientation"], orientation); + XCTAssertEqualObjects(dic[@"title"], @"title"); + XCTAssertEqualObjects(dic[@"referralPage"], @"referralPage"); + XCTAssertEqualObjects(dic[@"attributes"][@"key"], @"value"); + XCTAssertTrue([ManualTrackHelper pageEventCheck:dic]); + XCTAssertTrue([ManualTrackHelper contextOptionalPropertyCheck:dic]); } #pragma mark - Private Methods - (NSString *)deviceOrientation { // SDK配置pageEvent.orientation的逻辑 - __block NSString *deviceOrientation = nil; + __block NSString *deviceOrientation = @"PORTRAIT"; dispatch_block_t block = ^{ UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation != UIInterfaceOrientationUnknown) { diff --git a/GrowingTrackerCore/GrowingRealTracker.m b/GrowingTrackerCore/GrowingRealTracker.m index 9dcf2ed9e..c8bc9ad07 100644 --- a/GrowingTrackerCore/GrowingRealTracker.m +++ b/GrowingTrackerCore/GrowingRealTracker.m @@ -59,11 +59,9 @@ - (instancetype)initWithConfiguration:(GrowingTrackConfiguration *)configuration _configuration = [configuration copyWithZone:nil]; _launchOptions = [launchOptions copy]; GrowingConfigurationManager.sharedInstance.trackConfiguration = _configuration; - if (configuration.urlScheme.length > 0) { - [GrowingDeviceInfo configUrlScheme:configuration.urlScheme.copy]; - } [self loggerSetting]; + [GrowingDeviceInfo setup]; [GrowingNetworkInterfaceManager startMonitor]; [GrowingULAppLifecycle setup]; [GrowingSession startSession]; diff --git a/GrowingTrackerCore/Utils/GrowingDeviceInfo.h b/GrowingTrackerCore/Utils/GrowingDeviceInfo.h index 39e9d088d..32164c292 100644 --- a/GrowingTrackerCore/Utils/GrowingDeviceInfo.h +++ b/GrowingTrackerCore/Utils/GrowingDeviceInfo.h @@ -42,6 +42,6 @@ @property (nonatomic, readonly, assign) NSInteger timezoneOffset; + (instancetype)currentDeviceInfo; -+ (void)configUrlScheme:(NSString *)urlScheme; ++ (void)setup; @end diff --git a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m index 735038af7..b6fe46ec9 100644 --- a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m +++ b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m @@ -30,10 +30,10 @@ #import "GrowingTrackerCore/Utils/GrowingInternalMacros.h" #import "GrowingTrackerCore/Utils/GrowingKeyChainWrapper.h" #import "GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.h" +#import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h" #import "GrowingULAppLifecycle.h" #import "GrowingULApplication.h" -static NSString *kGrowingUrlScheme = nil; NSString *const kGrowingKeychainUserIdKey = @"kGrowingIOKeychainUserIdKey"; @interface GrowingDeviceInfo () @@ -92,10 +92,16 @@ - (instancetype)init { _screenWidth = 1; _screenHeight = 1; #endif - - [[GrowingULAppLifecycle sharedInstance] addAppLifecycleDelegate:self]; - + NSString *urlScheme = GrowingConfigurationManager.sharedInstance.trackConfiguration.urlScheme; + _urlScheme = urlScheme.length > 0 ? urlScheme.copy : [self getCurrentUrlScheme]; + + _deviceOrientation = @"PORTRAIT"; #if Growing_OS_PURE_IOS + UIInterfaceOrientation orientation = [[GrowingULApplication sharedApplication] statusBarOrientation]; + if (orientation != UIInterfaceOrientationUnknown) { + _deviceOrientation = UIInterfaceOrientationIsPortrait(orientation) ? @"PORTRAIT" : @"LANDSCAPE"; + } + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleStatusBarOrientationChange:) name:UIApplicationDidChangeStatusBarOrientationNotification @@ -107,6 +113,12 @@ - (instancetype)init { #pragma mark - Public Methods ++ (void)setup { + // 初始化urlScheme、appState、deviceOrientation等等(需要保证在主线程执行) + GrowingDeviceInfo *deviceInfo = [GrowingDeviceInfo currentDeviceInfo]; + [[GrowingULAppLifecycle sharedInstance] addAppLifecycleDelegate:deviceInfo]; +} + + (instancetype)currentDeviceInfo { static GrowingDeviceInfo *info = nil; static dispatch_once_t onceToken; @@ -116,14 +128,11 @@ + (instancetype)currentDeviceInfo { return info; } -+ (void)configUrlScheme:(NSString *)urlScheme { - kGrowingUrlScheme = urlScheme; -} - #pragma mark - Private Methods - (NSString *)getCurrentUrlScheme { - for (NSDictionary *dic in _infoDictionary[@"CFBundleURLTypes"]) { + NSArray *urlTypes = _infoDictionary[@"CFBundleURLTypes"]; + for (NSDictionary *dic in urlTypes) { NSArray *schemes = dic[@"CFBundleURLSchemes"]; for (NSString *urlScheme in schemes) { if ([urlScheme isKindOfClass:[NSString class]] && [urlScheme hasPrefix:@"growing."]) { @@ -331,35 +340,6 @@ - (NSString *)appVersion { return _appVersion; } -- (NSString *)urlScheme { - if (!_urlScheme) { - _urlScheme = kGrowingUrlScheme ?: [self getCurrentUrlScheme]; - } - return _urlScheme; -} - -- (NSString *)deviceOrientation { - if (!_deviceOrientation) { - _deviceOrientation = @"PORTRAIT"; -#if Growing_OS_PURE_IOS - dispatch_block_t block = ^{ - UIInterfaceOrientation orientation = [[GrowingULApplication sharedApplication] statusBarOrientation]; - if (orientation != UIInterfaceOrientationUnknown) { - self->_deviceOrientation = UIInterfaceOrientationIsPortrait(orientation) ? @"PORTRAIT" : @"LANDSCAPE"; - } - }; - if ([NSThread isMainThread]) { - block(); - } else { - dispatch_sync(dispatch_get_main_queue(), ^{ - block(); - }); - } -#endif - } - return _deviceOrientation; -} - - (NSString *)idfv { if (!_idfv) { _idfv = [GrowingUserIdentifier idfv]; From f81c39d270105fe245bc133687afa9e25a3f1a4a Mon Sep 17 00:00:00 2001 From: YoloMao Date: Wed, 7 Feb 2024 11:40:59 +0800 Subject: [PATCH 20/36] chore: update spi.yml --- .spi.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.spi.yml b/.spi.yml index 0f982bac8..da1eee98b 100644 --- a/.spi.yml +++ b/.spi.yml @@ -2,8 +2,14 @@ version: 1 builder: configs: - platform: ios - scheme: GrowingAutotracker + scheme: GrowingAnalytics-Package - platform: macos-xcodebuild scheme: GrowingTracker - platform: macos-spm target: GrowingTracker + - platform: tvos + scheme: GrowingAutotracker + - platform: watchos + scheme: GrowingTracker + - platform: visionos + scheme: GrowingTracker From 960c53132ca5545252a7d40a32548e25ccdbc5ff Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Wed, 7 Feb 2024 02:54:00 +0000 Subject: [PATCH 21/36] style: code format --- GrowingTrackerCore/Utils/GrowingDeviceInfo.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m index b6fe46ec9..c0383138c 100644 --- a/GrowingTrackerCore/Utils/GrowingDeviceInfo.m +++ b/GrowingTrackerCore/Utils/GrowingDeviceInfo.m @@ -25,12 +25,12 @@ #import #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" +#import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" #import "GrowingTrackerCore/Thread/GrowingDispatchManager.h" #import "GrowingTrackerCore/Utils/GrowingInternalMacros.h" #import "GrowingTrackerCore/Utils/GrowingKeyChainWrapper.h" #import "GrowingTrackerCore/Utils/UserIdentifier/GrowingUserIdentifier.h" -#import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h" #import "GrowingULAppLifecycle.h" #import "GrowingULApplication.h" @@ -94,14 +94,14 @@ - (instancetype)init { #endif NSString *urlScheme = GrowingConfigurationManager.sharedInstance.trackConfiguration.urlScheme; _urlScheme = urlScheme.length > 0 ? urlScheme.copy : [self getCurrentUrlScheme]; - + _deviceOrientation = @"PORTRAIT"; #if Growing_OS_PURE_IOS UIInterfaceOrientation orientation = [[GrowingULApplication sharedApplication] statusBarOrientation]; if (orientation != UIInterfaceOrientationUnknown) { _deviceOrientation = UIInterfaceOrientationIsPortrait(orientation) ? @"PORTRAIT" : @"LANDSCAPE"; } - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleStatusBarOrientationChange:) name:UIApplicationDidChangeStatusBarOrientationNotification From 9d8c5ac8a9ca9107a3ee6c3b6e3c705dd1af7b73 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Wed, 7 Feb 2024 17:27:40 +0800 Subject: [PATCH 22/36] fix: update version of GrowingUtils and GrowingAPM --- Example/Example.xcodeproj/project.pbxproj | 2 -- Example/Podfile.lock | 14 +++++++------- GrowingAnalytics.podspec | 6 +++--- Package.swift | 4 ++-- Package@swift-5.9.swift | 4 ++-- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 3be8f8eb0..5fb0fa711 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -1554,7 +1554,6 @@ 34DAD9992B6F919E00760A9C /* Example-visionOS */, 34DAD9BC2B6F948100760A9C /* Example-tvOS */, 6003F58C195388D20070C39A /* Frameworks */, - 34DAD99A2B6F919E00760A9C /* Packages */, 6003F58B195388D20070C39A /* Products */, 1172AEB47E26DD658BEEA1BB /* Pods */, ); @@ -1807,7 +1806,6 @@ buildConfigurationList = 34DAD9AA2B6F919F00760A9C /* Build configuration list for PBXNativeTarget "Example-visionOS" */; buildPhases = ( 34DAD9942B6F919E00760A9C /* Sources */, - 34DAD9952B6F919E00760A9C /* Frameworks */, 34DAD9962B6F919E00760A9C /* Resources */, ); buildRules = ( diff --git a/Example/Podfile.lock b/Example/Podfile.lock index a90cc5f0d..2ecbfd111 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -5,7 +5,7 @@ PODS: - GrowingAnalytics/TrackerCore (= 4.1.0) - GrowingAnalytics/APM (4.1.0): - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAPM/Core (~> 1.0.0) + - GrowingAPM/Core (~> 1.0.1) - GrowingAnalytics/Autotracker (4.1.0): - GrowingAnalytics/AutotrackerCore (= 4.1.0) - GrowingAnalytics/DefaultServices (= 4.1.0) @@ -14,7 +14,7 @@ PODS: - GrowingAnalytics/WebCircle (= 4.1.0) - GrowingAnalytics/AutotrackerCore (4.1.0): - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingUtils/AutotrackerCore (~> 1.2.0) + - GrowingUtils/AutotrackerCore (~> 1.2.2) - GrowingAnalytics/Compression (4.1.0): - GrowingAnalytics/TrackerCore (= 4.1.0) - GrowingAnalytics/Database (4.1.0): @@ -53,7 +53,7 @@ PODS: - GrowingAnalytics/MobileDebugger (= 4.1.0) - GrowingAnalytics/TrackerCore (= 4.1.0) - GrowingAnalytics/TrackerCore (4.1.0): - - GrowingUtils/TrackerCore (~> 1.2.0) + - GrowingUtils/TrackerCore (~> 1.2.2) - GrowingAnalytics/WebCircle (4.1.0): - GrowingAnalytics/AutotrackerCore (= 4.1.0) - GrowingAnalytics/Hybrid (= 4.1.0) @@ -105,9 +105,9 @@ PODS: - GrowingToolsKit/Core - GrowingToolsKit/XPathTrack (2.0.0): - GrowingToolsKit/Core - - GrowingUtils/AutotrackerCore (1.2.1): + - GrowingUtils/AutotrackerCore (1.2.2): - GrowingUtils/TrackerCore - - GrowingUtils/TrackerCore (1.2.1) + - GrowingUtils/TrackerCore (1.2.2) - KIF (3.8.9): - KIF/Core (= 3.8.9) - KIF/Core (3.8.9) @@ -160,10 +160,10 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - GrowingAnalytics: 183d75b3221b5becdeaca8954280a5d034febb66 + GrowingAnalytics: 8a9dd09ac6688ca2e6e73265b1075387a682327d GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b GrowingToolsKit: edc93c96e47bd6ad1ff3deffe72fe276ae0a1fa8 - GrowingUtils: 0247e21b431d295f1ea67e04a18f662c1af6aefc + GrowingUtils: 6071dc1206f5e62398d90dec78c7eaa07b1b9892 KIF: 7660c626b0f2d4562533590960db70a36d640558 OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 Protobuf: 34db13339da0d02d64fa8a2ac6a124cfcc603703 diff --git a/GrowingAnalytics.podspec b/GrowingAnalytics.podspec index 749fc71f0..3b0f1cf07 100644 --- a/GrowingAnalytics.podspec +++ b/GrowingAnalytics.podspec @@ -44,7 +44,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 end s.subspec 'TrackerCore' do |trackerCore| - trackerCore.dependency 'GrowingUtils/TrackerCore', '~> 1.2.0' + trackerCore.dependency 'GrowingUtils/TrackerCore', '~> 1.2.2' trackerCore.source_files = 'GrowingTrackerCore/**/*{.h,.m,.c,.cpp,.mm}' trackerCore.public_header_files = 'GrowingTrackerCore/Public/*.h' trackerCore.ios.resource_bundles = {'GrowingAnalytics' => ['Resources/iOS/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy']} @@ -55,7 +55,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.subspec 'AutotrackerCore' do |autotrackerCore| autotrackerCore.ios.deployment_target = '10.0' autotrackerCore.tvos.deployment_target = '10.0' - autotrackerCore.dependency 'GrowingUtils/AutotrackerCore', '~> 1.2.0' + autotrackerCore.dependency 'GrowingUtils/AutotrackerCore', '~> 1.2.2' autotrackerCore.source_files = 'GrowingAutotrackerCore/**/*{.h,.m,.c,.cpp,.mm}' autotrackerCore.public_header_files = 'GrowingAutotrackerCore/Public/*.h' autotrackerCore.dependency 'GrowingAnalytics/TrackerCore', s.version.to_s @@ -177,7 +177,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 apm.source_files = 'Modules/APM/**/*{.h,.m,.c,.cpp,.mm}' apm.public_header_files = 'Modules/APM/Public/*.h' apm.dependency 'GrowingAnalytics/TrackerCore', s.version.to_s - apm.dependency 'GrowingAPM/Core', '~> 1.0.0' + apm.dependency 'GrowingAPM/Core', '~> 1.0.1' end s.subspec 'V2Adapter' do |adapter| diff --git a/Package.swift b/Package.swift index 95a0aa976..b2c88e4d0 100644 --- a/Package.swift +++ b/Package.swift @@ -43,11 +43,11 @@ let package = Package( dependencies: [ .package( url: "https://github.com/growingio/growingio-sdk-ios-utilities.git", - "1.2.0" ..< "1.3.0" + "1.2.2" ..< "1.3.0" ), .package( url: "https://github.com/growingio/growingio-sdk-ios-performance-ext.git", - "1.0.0" ..< "1.1.0" + "1.0.1" ..< "1.1.0" ), .package( url: "https://github.com/apple/swift-protobuf.git", diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift index a159237a0..b20e4e311 100644 --- a/Package@swift-5.9.swift +++ b/Package@swift-5.9.swift @@ -44,11 +44,11 @@ let package = Package( dependencies: [ .package( url: "https://github.com/growingio/growingio-sdk-ios-utilities.git", - "1.2.0" ..< "1.3.0" + "1.2.2" ..< "1.3.0" ), .package( url: "https://github.com/growingio/growingio-sdk-ios-performance-ext.git", - "1.0.0" ..< "1.1.0" + "1.0.1" ..< "1.1.0" ), .package( url: "https://github.com/apple/swift-protobuf.git", From c47416a3f11736bba39936906145cfb9c58fbfaa Mon Sep 17 00:00:00 2001 From: YoloMao Date: Sun, 18 Feb 2024 11:05:45 +0800 Subject: [PATCH 23/36] fix: bugs --- .github/workflows/spm.yml | 3 --- GrowingAnalytics.podspec | 4 ++-- GrowingTrackerCore/Utils/GrowingInternalMacros.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml index 282d7324c..4f9df946f 100644 --- a/.github/workflows/spm.yml +++ b/.github/workflows/spm.yml @@ -56,9 +56,6 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v4 - - uses: mikehardy/buildcache-action@a50b89d53bb0a8da7b8d4c69f0bc0f0527b7b5c6 - with: - cache_key: spm-build-${{ matrix.os }}-${{ matrix.xcode }}-${{ matrix.target }}-${{ matrix.scheme }} - name: Xcode run: sudo xcode-select -switch /Applications/${{ matrix.xcode }}.app - name: Build diff --git a/GrowingAnalytics.podspec b/GrowingAnalytics.podspec index 3b0f1cf07..097b98555 100644 --- a/GrowingAnalytics.podspec +++ b/GrowingAnalytics.podspec @@ -21,7 +21,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.subspec 'Autotracker' do |autotracker| autotracker.ios.deployment_target = '10.0' - autotracker.tvos.deployment_target = '10.0' + autotracker.tvos.deployment_target = '12.0' autotracker.source_files = 'GrowingAutotracker/**/*{.h,.m,.c,.cpp,.mm}' autotracker.public_header_files = 'GrowingAutotracker/*.h' autotracker.dependency 'GrowingAnalytics/AutotrackerCore', s.version.to_s @@ -54,7 +54,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.subspec 'AutotrackerCore' do |autotrackerCore| autotrackerCore.ios.deployment_target = '10.0' - autotrackerCore.tvos.deployment_target = '10.0' + autotrackerCore.tvos.deployment_target = '12.0' autotrackerCore.dependency 'GrowingUtils/AutotrackerCore', '~> 1.2.2' autotrackerCore.source_files = 'GrowingAutotrackerCore/**/*{.h,.m,.c,.cpp,.mm}' autotrackerCore.public_header_files = 'GrowingAutotrackerCore/Public/*.h' diff --git a/GrowingTrackerCore/Utils/GrowingInternalMacros.h b/GrowingTrackerCore/Utils/GrowingInternalMacros.h index fe7aaf7dd..a003673ea 100644 --- a/GrowingTrackerCore/Utils/GrowingInternalMacros.h +++ b/GrowingTrackerCore/Utils/GrowingInternalMacros.h @@ -42,7 +42,7 @@ #import #define GROWING_USE_OS_UNFAIR_LOCK \ - Growing_OS_MACCATALYST || (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0) || \ + TARGET_OS_MACCATALYST || (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0) || \ (__MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_12) || (__TV_OS_VERSION_MIN_REQUIRED >= __TVOS_10_0) || \ (__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_3_0) From f03a9ea793aaf6194831f9cd1ccc29f40de999c2 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Sun, 18 Feb 2024 16:31:07 +0800 Subject: [PATCH 24/36] chore: update podfile lock --- Example/Podfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 2ecbfd111..b3ebb87a6 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -124,12 +124,12 @@ PODS: - OHHTTPStubs/NSURLSession (9.1.0): - OHHTTPStubs/Core - OHHTTPStubs/OHPathHelpers (9.1.0) - - Protobuf (3.25.2) + - Protobuf (3.25.3) - SDCycleScrollView (1.82): - SDWebImage (>= 5.0.0) - - SDWebImage (5.18.10): - - SDWebImage/Core (= 5.18.10) - - SDWebImage/Core (5.18.10) + - SDWebImage (5.18.11): + - SDWebImage/Core (= 5.18.11) + - SDWebImage/Core (5.18.11) DEPENDENCIES: - GrowingAnalytics/ABTesting (from `../`) @@ -160,15 +160,15 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - GrowingAnalytics: 8a9dd09ac6688ca2e6e73265b1075387a682327d + GrowingAnalytics: ba899e368badee68acd6ac8f80b59e6ce3a64442 GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b GrowingToolsKit: edc93c96e47bd6ad1ff3deffe72fe276ae0a1fa8 GrowingUtils: 6071dc1206f5e62398d90dec78c7eaa07b1b9892 KIF: 7660c626b0f2d4562533590960db70a36d640558 OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 - Protobuf: 34db13339da0d02d64fa8a2ac6a124cfcc603703 + Protobuf: 8e9074797a13c484a79959fdb819ef4ae6da7dbe SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf - SDWebImage: fc8f2d48bbfd72ef39d70e981bd24a3f3be53fec + SDWebImage: a3ba0b8faac7228c3c8eadd1a55c9c9fe5e16457 PODFILE CHECKSUM: a6c6e36ec9a4330f52fb9f3ea4d2ea1be1c91bc5 From b2185143e7ac4f6677a157217cb002995a7b1a35 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Sun, 18 Feb 2024 17:39:35 +0800 Subject: [PATCH 25/36] chore: code coverage ignore Package@swift-*.swift --- codecov.yml | 3 ++- sonar-project.properties | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/codecov.yml b/codecov.yml index f45434c42..6aaaa49ad 100644 --- a/codecov.yml +++ b/codecov.yml @@ -7,4 +7,5 @@ ignore: - "Services/Compression/LZ4" - "Services/Database/FMDB" - "Services/WebSocket" - - "Package.swift" \ No newline at end of file + - "Package.swift" + - "Package@swift-*.swift" \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties index 7dd2121e1..6e9b6d496 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,7 +12,8 @@ sonar.exclusions = Example/**,\ Services/Compression/LZ4/**,\ Services/Database/FMDB/**,\ Services/WebSocket/**, \ - Package.swift + Package.swift, \ + Package@swift-*.swift sonar.c.file.suffixes = .c,.cpp sonar.objc.file.suffixes = .h,.m,.mm From eebd48300b1b0f5b804ad861d70ddf72561eff0f Mon Sep 17 00:00:00 2001 From: YoloMao Date: Tue, 20 Feb 2024 17:53:35 +0800 Subject: [PATCH 26/36] fix: adapt deep link to SwiftUI --- Example/Example-visionOS/AppDelegate.swift | 32 +++++++++++++++++++ .../Example_visionOSApp.swift | 15 +++++---- .../Example_watchOSApp.swift | 8 +++++ Example/Example.xcodeproj/project.pbxproj | 4 +++ .../Helper/GrowingDeepLinkHandler+XCTest.h | 2 +- .../Helper/GrowingDeepLinkHandler+XCTest.m | 12 +++---- .../MobileDebuggerTests/MobileDebuggerTest.m | 6 ++-- .../WebCircleTests/WebCircleTest.m | 6 ++-- .../DeepLinkTests/DeepLinkTest.m | 6 ++-- .../DeepLink/GrowingAppDelegateAutotracker.m | 15 ++++++--- ...ler.h => GrowingDeepLinkHandler+Private.h} | 18 ++++------- .../DeepLink/GrowingDeepLinkHandler.m | 12 +++---- .../GrowingSceneDelegateAutotracker.m | 11 +++---- GrowingTrackerCore/GrowingRealTracker.m | 1 - .../Public/GrowingDeepLinkHandler.h | 31 ++++++++++++++++++ Modules/Advertising/GrowingAdvertising.m | 14 ++++---- .../MobileDebugger/GrowingMobileDebugger.m | 4 +-- Modules/WebCircle/GrowingWebCircle.m | 4 +-- 18 files changed, 137 insertions(+), 64 deletions(-) create mode 100644 Example/Example-visionOS/AppDelegate.swift rename GrowingTrackerCore/DeepLink/{GrowingDeepLinkHandler.h => GrowingDeepLinkHandler+Private.h} (71%) create mode 100644 GrowingTrackerCore/Public/GrowingDeepLinkHandler.h diff --git a/Example/Example-visionOS/AppDelegate.swift b/Example/Example-visionOS/AppDelegate.swift new file mode 100644 index 000000000..8391c249e --- /dev/null +++ b/Example/Example-visionOS/AppDelegate.swift @@ -0,0 +1,32 @@ +// +// AppDelegate.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/02/20. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import Foundation +import UIKit +import GrowingAnalytics + +class AppDelegate: NSObject, UIApplicationDelegate { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + let config = GrowingTrackConfiguration(accountId: "0a1b4118dd954ec3bcc69da5138bdb96") + config?.dataSourceId = "ab555003531e0fd1" + config?.urlScheme = "growing.bf30ad277eaae1aa" + config?.debugEnabled = true + GrowingTracker.start(with: config!) + } +} diff --git a/Example/Example-visionOS/Example_visionOSApp.swift b/Example/Example-visionOS/Example_visionOSApp.swift index 897326b9b..986e6891f 100644 --- a/Example/Example-visionOS/Example_visionOSApp.swift +++ b/Example/Example-visionOS/Example_visionOSApp.swift @@ -22,17 +22,18 @@ import GrowingAnalytics @main struct Example_visionOSApp: App { - init() { - let config = GrowingTrackConfiguration(accountId: "0a1b4118dd954ec3bcc69da5138bdb96") - config?.dataSourceId = "ab555003531e0fd1" - config?.urlScheme = "growing.bf30ad277eaae1aa" - config?.debugEnabled = true - GrowingTracker.start(with: config!) - } + @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate var body: some Scene { WindowGroup { ContentView() +// MobileDebugger、WebCircle、DeepLink目前仅在iOS下使用 +// .onOpenURL(perform: { url in +// DeepLink.handle(url) +// }) +// .onContinueUserActivity(NSUserActivityTypeBrowsingWeb, perform: { userActivity in +// DeepLink.handle(userActivity.webpageURL!) +// }) } } } diff --git a/Example/Example-watchOS Watch App/Example_watchOSApp.swift b/Example/Example-watchOS Watch App/Example_watchOSApp.swift index d67000b5e..d731dd0d8 100644 --- a/Example/Example-watchOS Watch App/Example_watchOSApp.swift +++ b/Example/Example-watchOS Watch App/Example_watchOSApp.swift @@ -18,6 +18,7 @@ // limitations under the License. import SwiftUI +import GrowingAnalytics @main struct Example_watchOS_Watch_AppApp: App { @@ -26,6 +27,13 @@ struct Example_watchOS_Watch_AppApp: App { var body: some Scene { WindowGroup { ContentView() +// MobileDebugger、WebCircle、DeepLink目前仅在iOS下使用 +// .onOpenURL(perform: { url in +// DeepLink.handle(url) +// }) +// .onContinueUserActivity(NSUserActivityTypeBrowsingWeb, perform: { userActivity in +// DeepLink.handle(userActivity.webpageURL!) +// }) } } } diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 5fb0fa711..9b3e8f87e 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -75,6 +75,7 @@ 04F675662628293800077374 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04F675652628293800077374 /* AdSupport.framework */; }; 33A0F692F1D1738D6854E19A /* Pods_HostApplicationTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42F5EA0EFE2552358C35A0F5 /* Pods_HostApplicationTests.framework */; }; 3406842B2A668EB700E25216 /* A3PageEventsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3406842A2A668EB700E25216 /* A3PageEventsTest.m */; }; + 3412DDDF2B844D3000F2EA48 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3412DDDE2B844D3000F2EA48 /* AppDelegate.swift */; }; 341A579A2ABAA23E0052840A /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 341A57992ABAA2380052840A /* libc++.tbd */; }; 3432CF372AEA58A800E555A9 /* AdvertisingTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3432CF362AEA58A800E555A9 /* AdvertisingTest.m */; }; 34486D3D27B1049000FA8223 /* UITapGestureRecognizerAutotrackTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 34486D3B27B102B000FA8223 /* UITapGestureRecognizerAutotrackTest.m */; }; @@ -373,6 +374,7 @@ 3406842A2A668EB700E25216 /* A3PageEventsTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = A3PageEventsTest.m; sourceTree = ""; }; 34106BB228FECB0D00E7DB01 /* Crasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crasher.h; sourceTree = ""; }; 34106BB328FECB0E00E7DB01 /* Crasher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Crasher.mm; sourceTree = ""; }; + 3412DDDE2B844D3000F2EA48 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 341A57992ABAA2380052840A /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libc++.tbd"; sourceTree = DEVELOPER_DIR; }; 3432CF362AEA58A800E555A9 /* AdvertisingTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdvertisingTest.m; sourceTree = ""; }; 34486D3B27B102B000FA8223 /* UITapGestureRecognizerAutotrackTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UITapGestureRecognizerAutotrackTest.m; sourceTree = ""; }; @@ -1469,6 +1471,7 @@ isa = PBXGroup; children = ( 34DAD99E2B6F919E00760A9C /* Example_visionOSApp.swift */, + 3412DDDE2B844D3000F2EA48 /* AppDelegate.swift */, 34DAD9A02B6F919E00760A9C /* ContentView.swift */, 34DAD9A22B6F919F00760A9C /* Assets.xcassets */, 34DAD9A72B6F919F00760A9C /* Info.plist */, @@ -2866,6 +2869,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3412DDDF2B844D3000F2EA48 /* AppDelegate.swift in Sources */, 34DAD9A12B6F919E00760A9C /* ContentView.swift in Sources */, 34DAD99F2B6F919E00760A9C /* Example_visionOSApp.swift in Sources */, ); diff --git a/Example/GrowingAnalyticsTests/GrowingAnalyticsUITests/DeepLinkTests/Helper/GrowingDeepLinkHandler+XCTest.h b/Example/GrowingAnalyticsTests/GrowingAnalyticsUITests/DeepLinkTests/Helper/GrowingDeepLinkHandler+XCTest.h index 392d4e70a..4e15972a1 100644 --- a/Example/GrowingAnalyticsTests/GrowingAnalyticsUITests/DeepLinkTests/Helper/GrowingDeepLinkHandler+XCTest.h +++ b/Example/GrowingAnalyticsTests/GrowingAnalyticsUITests/DeepLinkTests/Helper/GrowingDeepLinkHandler+XCTest.h @@ -17,7 +17,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Example/GrowingAnalyticsTests/GrowingAnalyticsUITests/DeepLinkTests/Helper/GrowingDeepLinkHandler+XCTest.m b/Example/GrowingAnalyticsTests/GrowingAnalyticsUITests/DeepLinkTests/Helper/GrowingDeepLinkHandler+XCTest.m index a0b689b5f..a54c9c9a3 100644 --- a/Example/GrowingAnalyticsTests/GrowingAnalyticsUITests/DeepLinkTests/Helper/GrowingDeepLinkHandler+XCTest.m +++ b/Example/GrowingAnalyticsTests/GrowingAnalyticsUITests/DeepLinkTests/Helper/GrowingDeepLinkHandler+XCTest.m @@ -20,13 +20,13 @@ #import #import #import "GrowingDeepLinkHandler+XCTest.h" -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" @implementation GrowingDeepLinkHandler (XCTest) + (void)load { - SEL originSelector = @selector(handlerUrl:); - SEL swizzleSelector = @selector(XCTest_handlerUrl:); + SEL originSelector = @selector(handleURL:); + SEL swizzleSelector = @selector(XCTest_handleURL:); id handler = object_getClass(self); @@ -51,10 +51,10 @@ + (void)load { class_getInstanceMethod(handler, swizzleSelector)); } -+ (BOOL)XCTest_handlerUrl:(NSURL *)url { ++ (BOOL)XCTest_handleURL:(NSURL *)url { if ([url.absoluteString containsString:@"xctest=DeepLinkTest"]) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"XCTest_handlerUrl" + UIAlertController *controller = [UIAlertController alertControllerWithTitle:@"XCTest_handleURL" message:@"" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"XCTest" @@ -65,7 +65,7 @@ + (BOOL)XCTest_handlerUrl:(NSURL *)url { }); } - return [self XCTest_handlerUrl:url]; + return [self XCTest_handleURL:url]; } + (UIWindow *)XCTest_keywindow { diff --git a/Example/GrowingAnalyticsTests/ModulesTests/MobileDebuggerTests/MobileDebuggerTest.m b/Example/GrowingAnalyticsTests/ModulesTests/MobileDebuggerTests/MobileDebuggerTest.m index d0f6b6ef7..be384be5f 100644 --- a/Example/GrowingAnalyticsTests/ModulesTests/MobileDebuggerTests/MobileDebuggerTest.m +++ b/Example/GrowingAnalyticsTests/ModulesTests/MobileDebuggerTests/MobileDebuggerTest.m @@ -21,7 +21,7 @@ #import "ManualTrackHelper.h" #import "WebSocketTestHelper.h" -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" #import "Modules/MobileDebugger/GrowingMobileDebugger.h" @@ -69,7 +69,7 @@ - (void)setUp { NSURL *url = [NSURL URLWithString: @"growing.3612b67ce562c755://growingio/webservice?serviceType=debugger&wsUrl=wss://" @"gta0.growingio.com/app/0wDaZmQ1/circle/ec7f5925458f458b8ae6f3901cacaa92"]; - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; [mobileDebugger webSocketDidOpen:nil]; [MockWebSocket.sharedInstance cleanMessages]; @@ -121,7 +121,7 @@ - (void)test04SocketReopen { NSURL *url = [NSURL URLWithString: @"growing.3612b67ce562c755://growingio/webservice?serviceType=debugger&wsUrl=wss://" @"gta0.growingio.com/app/0wDaZmQ1/circle/ec7f5925458f458b8ae6f3901cacaa92"]; - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; [mobileDebugger webSocketDidOpen:nil]; [mobileDebugger webSocket:nil didReceiveMessage:@"{\"msgType\":\"ready\"}"]; } diff --git a/Example/GrowingAnalyticsTests/ModulesTests/WebCircleTests/WebCircleTest.m b/Example/GrowingAnalyticsTests/ModulesTests/WebCircleTests/WebCircleTest.m index 546fac314..32da3a623 100644 --- a/Example/GrowingAnalyticsTests/ModulesTests/WebCircleTests/WebCircleTest.m +++ b/Example/GrowingAnalyticsTests/ModulesTests/WebCircleTests/WebCircleTest.m @@ -20,7 +20,7 @@ #import #import "WebSocketTestHelper.h" -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" #import "Modules/WebCircle/GrowingWebCircle.h" @@ -68,7 +68,7 @@ - (void)setUp { NSURL *url = [NSURL URLWithString: @"growing.bf30ad277eaae1aa://growingio/webservice?serviceType=circle&wsUrl" @"=wss://portal.growingio.com/app/r85jV5gv/circle/faeb773a1d004663a86c227a159cc687"]; - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; [webCircle webSocketDidOpen:nil]; [MockWebSocket.sharedInstance cleanMessages]; @@ -112,7 +112,7 @@ - (void)test04SocketReopen { NSURL *url = [NSURL URLWithString: @"growing.bf30ad277eaae1aa://growingio/webservice?serviceType=circle&wsUrl=wss://" @"portal.growingio.com/app/r85jV5gv/circle/faeb773a1d004663a86c227a159cc687"]; - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; [webCircle webSocketDidOpen:nil]; [webCircle webSocket:nil didReceiveMessage:@"{\"msgType\":\"ready\"}"]; } diff --git a/Example/GrowingAnalyticsTests/TrackerCoreTests/DeepLinkTests/DeepLinkTest.m b/Example/GrowingAnalyticsTests/TrackerCoreTests/DeepLinkTests/DeepLinkTest.m index 45d37d73a..10c71e979 100644 --- a/Example/GrowingAnalyticsTests/TrackerCoreTests/DeepLinkTests/DeepLinkTest.m +++ b/Example/GrowingAnalyticsTests/TrackerCoreTests/DeepLinkTests/DeepLinkTest.m @@ -19,7 +19,7 @@ #import -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" @interface DeepLinkTest : XCTestCase @@ -36,13 +36,13 @@ - (void)tearDown { - (void)testDeepLinkhandlerUrl { [[GrowingDeepLinkHandler sharedInstance] addHandlersObject:self]; NSURL *url = [NSURL URLWithString:@"https://www.baidu.com"]; - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; [[GrowingDeepLinkHandler sharedInstance] removeHandlersObject:self]; } #pragma mark - GrowingDeepLinkHandlerProtocol -- (BOOL)growingHandlerUrl:(NSURL *)url { +- (BOOL)growingHandleURL:(NSURL *)url { XCTAssertEqualObjects(url.absoluteString, @"https://www.baidu.com"); return YES; } diff --git a/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m b/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m index 9f0e17d91..694874fac 100644 --- a/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m +++ b/GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.m @@ -23,7 +23,7 @@ #import #import #import "GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h" -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" #import "GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" #import "GrowingULApplication.h" @@ -63,6 +63,11 @@ + (void)track { if (!delegate) { return; } + if ([delegate isKindOfClass:NSClassFromString(@"SwiftUI.AppDelegate")]) { + // SwiftUI下无法完成以下Method Swizzling,请手动调用handleURL + // 见:https://github.com/firebase/firebase-ios-sdk/issues/10417 + return; + } if ([delegate respondsToSelector:@selector(application:openURL:options:)]) { SEL sel = @selector(application:openURL:options:); Method method = class_getInstanceMethod(delegate.class, sel); @@ -76,7 +81,7 @@ + (void)track { UIApplication *application, NSURL *url, NSDictionary *options) { - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; BOOL(*tempImp) (id obj, SEL sel, @@ -99,7 +104,7 @@ + (void)track { NSURL *url, NSString *sourceApplication, id annotation) { - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; BOOL(*tempImp) (id obj, SEL sel, @@ -119,7 +124,7 @@ + (void)track { method_setImplementation( method, imp_implementationWithBlock(^(id target, UIApplication *application, NSURL *url) { - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; BOOL (*tempImp)(id obj, SEL sel, UIApplication *application, NSURL *url) = (void *)originImp; return tempImp(target, sel, application, url); })); @@ -149,7 +154,7 @@ + (void)track { UIApplication *application, NSUserActivity *userActivity, void (^restorationHandler)(NSArray> *)) { - [GrowingDeepLinkHandler handlerUrl:userActivity.webpageURL]; + [GrowingDeepLinkHandler handleURL:userActivity.webpageURL]; BOOL(*tempImp) (id obj, SEL sel, diff --git a/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h b/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h similarity index 71% rename from GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h rename to GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h index cde822ad8..31b35b435 100644 --- a/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h +++ b/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h @@ -1,9 +1,9 @@ // -// GrowingDeepLinkHandler.h -// GrowingAnalytics +// GrowingDeepLinkHandler+Private.h +// GrowingAnalytics // -// Created by sheng on 2020/11/30. -// Copyright (C) 2017 Beijing Yishu Technology Co., Ltd. +// Created by YoloMao on 2024/02/20. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import +#import "GrowingDeepLinkHandler.h" NS_ASSUME_NONNULL_BEGIN @@ -25,21 +25,17 @@ NS_ASSUME_NONNULL_BEGIN /// 处理url,如果能够处理则返回YES,否则返回NO /// @param url 链接Url -- (BOOL)growingHandlerUrl:(NSURL *)url; +- (BOOL)growingHandleURL:(NSURL *)url; @end -@interface GrowingDeepLinkHandler : NSObject +@interface GrowingDeepLinkHandler (Private) + (instancetype)sharedInstance; -/// 添加一个处理者 -/// @param object 处理者 - (void)addHandlersObject:(id)object; - (void)removeHandlersObject:(id)object; -+ (BOOL)handlerUrl:(NSURL *)url; - @end NS_ASSUME_NONNULL_END diff --git a/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m b/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m index 7f3409883..036681a92 100644 --- a/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m +++ b/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m @@ -17,7 +17,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" #import "GrowingTrackerCore/Utils/GrowingInternalMacros.h" @interface GrowingDeepLinkHandler () @@ -67,11 +67,11 @@ - (void)removeHandlersObject:(id)object { GROWING_UNLOCK(lock); } -- (BOOL)dispatchHandlerUrl:(NSURL *)url { +- (BOOL)dispatchHandleURL:(NSURL *)url { GROWING_LOCK(lock); for (id object in self.handlers) { - if ([object respondsToSelector:@selector(growingHandlerUrl:)]) { - if ([object growingHandlerUrl:url]) { + if ([object respondsToSelector:@selector(growingHandleURL:)]) { + if ([object growingHandleURL:url]) { // 如果有一个handler处理,则break,不再继续执行后续handler break; } @@ -81,8 +81,8 @@ - (BOOL)dispatchHandlerUrl:(NSURL *)url { return YES; } -+ (BOOL)handlerUrl:(NSURL *)url { - return [[GrowingDeepLinkHandler sharedInstance] dispatchHandlerUrl:url]; ++ (BOOL)handleURL:(NSURL *)url { + return [[GrowingDeepLinkHandler sharedInstance] dispatchHandleURL:url]; } @end diff --git a/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m b/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m index c73b8336e..c89447f2b 100644 --- a/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m +++ b/GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.m @@ -22,7 +22,7 @@ #if Growing_USE_UIKIT #import #import -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" #import "GrowingTrackerCore/DeepLink/GrowingSceneDelegateAutotracker.h" #import "GrowingTrackerCore/Thirdparty/Logger/GrowingLogger.h" @@ -34,7 +34,6 @@ + (void)track:(Class)delegateClass { if (@available(iOS 13.0, *)) { // URL Scheme SEL sel = @selector(scene:openURLContexts:); - class_getInstanceMethod(delegateClass, sel); Method method = class_getInstanceMethod(delegateClass, sel); if (method) { IMP originImp = method_getImplementation(method); @@ -43,7 +42,7 @@ + (void)track:(Class)delegateClass { imp_implementationWithBlock(^(id target, UIScene *scene, NSSet *URLContexts) { NSURL *url = URLContexts.allObjects.firstObject.URL; if (url) { - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; } void (*tempImp)(id, SEL, UIScene *, NSSet *) = (void *)originImp; @@ -60,7 +59,6 @@ + (void)track:(Class)delegateClass { } // DeepLink sel = @selector(scene:continueUserActivity:); - class_getInstanceMethod(delegateClass, sel); method = class_getInstanceMethod(delegateClass, sel); if (method) { IMP originImp = method_getImplementation(method); @@ -70,7 +68,7 @@ + (void)track:(Class)delegateClass { if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) { NSURL *url = userActivity.webpageURL; if (url) { - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; } } void (*tempImp)(id, SEL, UIScene *, NSUserActivity *) = (void *)originImp; @@ -87,7 +85,6 @@ + (void)track:(Class)delegateClass { } // 冷启动 sel = @selector(scene:willConnectToSession:options:); - class_getInstanceMethod(delegateClass, sel); method = class_getInstanceMethod(delegateClass, sel); if (method) { IMP originImp = method_getImplementation(method); @@ -122,7 +119,7 @@ to scene(_:continue:) when the universal link is tapped while your app is runnin } if (url) { - [GrowingDeepLinkHandler handlerUrl:url]; + [GrowingDeepLinkHandler handleURL:url]; } void (*tempImp)(id, SEL, UIScene *, UISceneSession *, UISceneConnectionOptions *) = diff --git a/GrowingTrackerCore/GrowingRealTracker.m b/GrowingTrackerCore/GrowingRealTracker.m index c8bc9ad07..1972f01df 100644 --- a/GrowingTrackerCore/GrowingRealTracker.m +++ b/GrowingTrackerCore/GrowingRealTracker.m @@ -20,7 +20,6 @@ #import "GrowingTrackerCore/GrowingRealTracker.h" #import "GrowingTargetConditionals.h" #import "GrowingTrackerCore/DeepLink/GrowingAppDelegateAutotracker.h" -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" #import "GrowingTrackerCore/Event/GrowingEventGenerator.h" #import "GrowingTrackerCore/Event/GrowingEventManager.h" #import "GrowingTrackerCore/Event/GrowingVisitEvent.h" diff --git a/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h b/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h new file mode 100644 index 000000000..cf53bb302 --- /dev/null +++ b/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h @@ -0,0 +1,31 @@ +// +// GrowingDeepLinkHandler.h +// GrowingAnalytics +// +// Created by sheng on 2020/11/30. +// Copyright (C) 2017 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +NS_ASSUME_NONNULL_BEGIN + +NS_SWIFT_NAME(DeepLink) +@interface GrowingDeepLinkHandler : NSObject + ++ (BOOL)handleURL:(NSURL *)url; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Modules/Advertising/GrowingAdvertising.m b/Modules/Advertising/GrowingAdvertising.m index 9c658afd8..512414a52 100644 --- a/Modules/Advertising/GrowingAdvertising.m +++ b/Modules/Advertising/GrowingAdvertising.m @@ -25,7 +25,7 @@ #import "Modules/Advertising/Utils/GrowingAdUtils.h" #import "GrowingTrackerCore/Core/GrowingContext.h" -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" #import "GrowingTrackerCore/Event/GrowingEventChannel.h" #import "GrowingTrackerCore/Event/GrowingEventManager.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" @@ -96,7 +96,7 @@ - (void)growingModSetDataCollectionEnabled:(GrowingContext *)context { if (dataCollectionEnabled) { [self loadClipboard]; if (self.deeplinkUrl) { - [self growingHandlerUrl:self.deeplinkUrl.copy isManual:NO callback:nil]; + [self growingHandleURL:self.deeplinkUrl.copy isManual:NO callback:nil]; self.deeplinkUrl = nil; // 避免多线程环境下有可能多发 AppReengage } } @@ -104,8 +104,8 @@ - (void)growingModSetDataCollectionEnabled:(GrowingContext *)context { #pragma mark - GrowingDeepLinkHandlerProtocol -- (BOOL)growingHandlerUrl:(NSURL *)url { - return [self growingHandlerUrl:url isManual:NO callback:nil]; +- (BOOL)growingHandleURL:(NSURL *)url { + return [self growingHandleURL:url isManual:NO callback:nil]; } #pragma mark - GrowingULAppLifecycleDelegate @@ -142,7 +142,7 @@ - (void)setReadClipboardEnabled:(BOOL)enabled { } - (BOOL)doDeeplinkByUrl:(NSURL *)url callback:(GrowingAdDeepLinkCallback)callback { - return [self growingHandlerUrl:url isManual:YES callback:callback]; + return [self growingHandleURL:url isManual:YES callback:callback]; } #pragma mark - Private Method @@ -155,7 +155,7 @@ - (BOOL)SDKDoNotTrack { return NO; } -- (BOOL)growingHandlerUrl:(NSURL *)url isManual:(BOOL)isManual callback:(GrowingAdDeepLinkCallback)callback { +- (BOOL)growingHandleURL:(NSURL *)url isManual:(BOOL)isManual callback:(GrowingAdDeepLinkCallback)callback { if (![GrowingAdUtils isGrowingIOUrl:url]) { if (isManual) { // 若手动触发 callback 则报错 @@ -197,7 +197,7 @@ - (BOOL)growingHandlerUrl:(NSURL *)url isManual:(BOOL)isManual callback:(Growing [[GrowingServiceManager sharedInstance] createService:@protocol(GrowingEventNetworkService)]; if (!service) { GIOLogError( - @"[GrowingAdvertising] -growingHandlerUrl:isManual:callback: error : no network service " + @"[GrowingAdvertising] -growingHandleURL:isManual:callback: error : no network service " @"support"); return; } diff --git a/Modules/MobileDebugger/GrowingMobileDebugger.m b/Modules/MobileDebugger/GrowingMobileDebugger.m index d3f56ee2b..d9327259f 100644 --- a/Modules/MobileDebugger/GrowingMobileDebugger.m +++ b/Modules/MobileDebugger/GrowingMobileDebugger.m @@ -20,7 +20,7 @@ #import "Modules/MobileDebugger/GrowingMobileDebugger.h" #import #import -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" #import "GrowingTrackerCore/GrowingRealTracker.h" #import "GrowingTrackerCore/Helpers/GrowingHelpers.h" #import "GrowingTrackerCore/Manager/GrowingConfigurationManager.h" @@ -102,7 +102,7 @@ - (void)runWithMobileDebugger:(NSURL *)url { #pragma mark - GrowingDeepLinkHandlerProtocol -- (BOOL)growingHandlerUrl:(NSURL *)url { +- (BOOL)growingHandleURL:(NSURL *)url { NSDictionary *params = url.growingHelper_queryDict; NSString *serviceType = params[@"serviceType"]; NSString *wsurl = params[@"wsUrl"]; diff --git a/Modules/WebCircle/GrowingWebCircle.m b/Modules/WebCircle/GrowingWebCircle.m index 415f7cf23..036167db6 100644 --- a/Modules/WebCircle/GrowingWebCircle.m +++ b/Modules/WebCircle/GrowingWebCircle.m @@ -25,7 +25,7 @@ #import "GrowingAutotrackerCore/GrowingNode/Category/UIWindow+GrowingNode.h" #import "GrowingAutotrackerCore/GrowingNode/GrowingNodeHelper.h" #import "GrowingAutotrackerCore/Page/GrowingPageManager.h" -#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.h" +#import "GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler+Private.h" #import "GrowingTrackerCore/Event/Autotrack/GrowingAutotrackEventType.h" #import "GrowingTrackerCore/Event/GrowingEventManager.h" #import "GrowingTrackerCore/GrowingRealTracker.h" @@ -93,7 +93,7 @@ - (instancetype)init { #pragma mark - GrowingDeepLinkHandlerProtocol -- (BOOL)growingHandlerUrl:(NSURL *)url { +- (BOOL)growingHandleURL:(NSURL *)url { NSDictionary *params = url.growingHelper_queryDict; NSString *serviceType = params[@"serviceType"]; NSString *wsurl = params[@"wsUrl"]; From 59bbf648ef92c8f054191a57e005848f6c6c2e48 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Wed, 21 Feb 2024 09:47:45 +0800 Subject: [PATCH 27/36] fix: null safety --- GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m | 11 ++++++++--- GrowingTrackerCore/Public/GrowingDeepLinkHandler.h | 6 +----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m b/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m index 036681a92..74d91864d 100644 --- a/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m +++ b/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m @@ -68,21 +68,26 @@ - (void)removeHandlersObject:(id)object { } - (BOOL)dispatchHandleURL:(NSURL *)url { + BOOL isHandled = NO; GROWING_LOCK(lock); for (id object in self.handlers) { if ([object respondsToSelector:@selector(growingHandleURL:)]) { if ([object growingHandleURL:url]) { // 如果有一个handler处理,则break,不再继续执行后续handler + isHandled = YES; break; } } } GROWING_UNLOCK(lock); - return YES; + return isHandled; } -+ (BOOL)handleURL:(NSURL *)url { - return [[GrowingDeepLinkHandler sharedInstance] dispatchHandleURL:url]; ++ (BOOL)handleURL:(NSURL * _Nullable)url { + if (url) { + return [[GrowingDeepLinkHandler sharedInstance] dispatchHandleURL:url]; + } + return NO; } @end diff --git a/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h b/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h index cf53bb302..9245d5fa2 100644 --- a/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h +++ b/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h @@ -19,13 +19,9 @@ #import -NS_ASSUME_NONNULL_BEGIN - NS_SWIFT_NAME(DeepLink) @interface GrowingDeepLinkHandler : NSObject -+ (BOOL)handleURL:(NSURL *)url; ++ (BOOL)handleURL:(NSURL * _Nullable)url; @end - -NS_ASSUME_NONNULL_END From 68f014aea50fa02bab71eea44c2ca1f6a51bb0cf Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Wed, 21 Feb 2024 01:48:34 +0000 Subject: [PATCH 28/36] style: code format --- GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m | 2 +- GrowingTrackerCore/Public/GrowingDeepLinkHandler.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m b/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m index 74d91864d..663f7f1dd 100644 --- a/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m +++ b/GrowingTrackerCore/DeepLink/GrowingDeepLinkHandler.m @@ -83,7 +83,7 @@ - (BOOL)dispatchHandleURL:(NSURL *)url { return isHandled; } -+ (BOOL)handleURL:(NSURL * _Nullable)url { ++ (BOOL)handleURL:(NSURL *_Nullable)url { if (url) { return [[GrowingDeepLinkHandler sharedInstance] dispatchHandleURL:url]; } diff --git a/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h b/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h index 9245d5fa2..c6d9f199a 100644 --- a/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h +++ b/GrowingTrackerCore/Public/GrowingDeepLinkHandler.h @@ -22,6 +22,6 @@ NS_SWIFT_NAME(DeepLink) @interface GrowingDeepLinkHandler : NSObject -+ (BOOL)handleURL:(NSURL * _Nullable)url; ++ (BOOL)handleURL:(NSURL *_Nullable)url; @end From 9b84689def7d1485349e58ace19e43b69932fd8f Mon Sep 17 00:00:00 2001 From: YoloMao Date: Wed, 21 Feb 2024 11:04:04 +0800 Subject: [PATCH 29/36] test: add SwiftUI Demo --- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 13 + .../Assets.xcassets/Contents.json | 6 + Example/Example-SwiftUI/ContentView.swift | 41 ++ .../Example-SwiftUI/CustomAppDelegate.swift | 34 ++ .../Example-SwiftUI/Example_SwiftUIApp.swift | 39 ++ Example/Example-SwiftUI/Info.plist | 25 + .../Preview Assets.xcassets/Contents.json | 6 + Example/Example-visionOS/AppDelegate.swift | 2 + .../Example_visionOSApp.swift | 2 +- .../Example_watchOSApp.swift | 2 +- Example/Example.xcodeproj/project.pbxproj | 430 ++++++++++++------ Example/Podfile | 7 + Example/Podfile.lock | 2 +- 14 files changed, 484 insertions(+), 136 deletions(-) create mode 100644 Example/Example-SwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Example/Example-SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Example/Example-SwiftUI/Assets.xcassets/Contents.json create mode 100644 Example/Example-SwiftUI/ContentView.swift create mode 100644 Example/Example-SwiftUI/CustomAppDelegate.swift create mode 100644 Example/Example-SwiftUI/Example_SwiftUIApp.swift create mode 100644 Example/Example-SwiftUI/Info.plist create mode 100644 Example/Example-SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/Example/Example-SwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json b/Example/Example-SwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..eb8789700 --- /dev/null +++ b/Example/Example-SwiftUI/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Example-SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..13613e3ee --- /dev/null +++ b/Example/Example-SwiftUI/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-SwiftUI/Assets.xcassets/Contents.json b/Example/Example-SwiftUI/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-SwiftUI/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-SwiftUI/ContentView.swift b/Example/Example-SwiftUI/ContentView.swift new file mode 100644 index 000000000..de1fe00b7 --- /dev/null +++ b/Example/Example-SwiftUI/ContentView.swift @@ -0,0 +1,41 @@ +// +// ContentView.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/21. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI +import GrowingAnalytics + +struct ContentView: View { + var body: some View { + VStack { + Image(systemName: "globe") + .imageScale(.large) + .foregroundStyle(.tint) + Text("Hello, world!") + Button("TrackCustomEvent") { + GrowingAutotracker.sharedInstance().trackCustomEvent("SwiftUI_custom_event", + withAttributes: ["key": "value"]) + } + } + .padding() + } +} + +#Preview { + ContentView() +} diff --git a/Example/Example-SwiftUI/CustomAppDelegate.swift b/Example/Example-SwiftUI/CustomAppDelegate.swift new file mode 100644 index 000000000..c77221a91 --- /dev/null +++ b/Example/Example-SwiftUI/CustomAppDelegate.swift @@ -0,0 +1,34 @@ +// +// CustomAppDelegate.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/21. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import Foundation +import UIKit +import GrowingAnalytics + +class CustomAppDelegate: NSObject, UIApplicationDelegate { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + let config = GrowingAutotrackConfiguration(accountId: "0a1b4118dd954ec3bcc69da5138bdb96") + config?.dataSourceId = "ab555003531e0fd1" + config?.urlScheme = "growing.bf30ad277eaae1aa" + config?.debugEnabled = true + GrowingAutotracker.start(with: config!) + + return true + } +} diff --git a/Example/Example-SwiftUI/Example_SwiftUIApp.swift b/Example/Example-SwiftUI/Example_SwiftUIApp.swift new file mode 100644 index 000000000..7a4be91ce --- /dev/null +++ b/Example/Example-SwiftUI/Example_SwiftUIApp.swift @@ -0,0 +1,39 @@ +// +// Example_SwiftUIApp.swift +// GrowingAnalytics +// +// Created by YoloMao on 2024/2/21. +// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import SwiftUI +import GrowingAnalytics + +@main +struct Example_SwiftUIApp: App { + + @UIApplicationDelegateAdaptor(CustomAppDelegate.self) var delegate + + var body: some Scene { + WindowGroup { + ContentView() + .onOpenURL(perform: { url in + DeepLink.handle(url) + }) + .onContinueUserActivity(NSUserActivityTypeBrowsingWeb, perform: { userActivity in + DeepLink.handle(userActivity.webpageURL) + }) + } + } +} diff --git a/Example/Example-SwiftUI/Info.plist b/Example/Example-SwiftUI/Info.plist new file mode 100644 index 000000000..51d185c94 --- /dev/null +++ b/Example/Example-SwiftUI/Info.plist @@ -0,0 +1,25 @@ + + + + + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + growing.bf30ad277eaae1aa + + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + growing.deeplink + + + + + diff --git a/Example/Example-SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json b/Example/Example-SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/Example/Example-SwiftUI/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/Example-visionOS/AppDelegate.swift b/Example/Example-visionOS/AppDelegate.swift index 8391c249e..504f4b378 100644 --- a/Example/Example-visionOS/AppDelegate.swift +++ b/Example/Example-visionOS/AppDelegate.swift @@ -28,5 +28,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { config?.urlScheme = "growing.bf30ad277eaae1aa" config?.debugEnabled = true GrowingTracker.start(with: config!) + + return true } } diff --git a/Example/Example-visionOS/Example_visionOSApp.swift b/Example/Example-visionOS/Example_visionOSApp.swift index 986e6891f..6a7441406 100644 --- a/Example/Example-visionOS/Example_visionOSApp.swift +++ b/Example/Example-visionOS/Example_visionOSApp.swift @@ -32,7 +32,7 @@ struct Example_visionOSApp: App { // DeepLink.handle(url) // }) // .onContinueUserActivity(NSUserActivityTypeBrowsingWeb, perform: { userActivity in -// DeepLink.handle(userActivity.webpageURL!) +// DeepLink.handle(userActivity.webpageURL) // }) } } diff --git a/Example/Example-watchOS Watch App/Example_watchOSApp.swift b/Example/Example-watchOS Watch App/Example_watchOSApp.swift index d731dd0d8..3307c0b7b 100644 --- a/Example/Example-watchOS Watch App/Example_watchOSApp.swift +++ b/Example/Example-watchOS Watch App/Example_watchOSApp.swift @@ -32,7 +32,7 @@ struct Example_watchOS_Watch_AppApp: App { // DeepLink.handle(url) // }) // .onContinueUserActivity(NSUserActivityTypeBrowsingWeb, perform: { userActivity in -// DeepLink.handle(userActivity.webpageURL!) +// DeepLink.handle(userActivity.webpageURL) // }) } } diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj index 9b3e8f87e..5c580cc64 100644 --- a/Example/Example.xcodeproj/project.pbxproj +++ b/Example/Example.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 46; objects = { /* Begin PBXAggregateTarget section */ @@ -181,6 +181,11 @@ 34DAD9C32B6F948100760A9C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9C12B6F948100760A9C /* Main.storyboard */; }; 34DAD9C52B6F948200760A9C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9C42B6F948200760A9C /* Assets.xcassets */; }; 34DAD9C82B6F948200760A9C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34DAD9C62B6F948200760A9C /* LaunchScreen.storyboard */; }; + 34DC378F2B8595C7000DFB99 /* Example_SwiftUIApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DC378E2B8595C7000DFB99 /* Example_SwiftUIApp.swift */; }; + 34DC37912B8595C7000DFB99 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DC37902B8595C7000DFB99 /* ContentView.swift */; }; + 34DC37932B8595C8000DFB99 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DC37922B8595C8000DFB99 /* Assets.xcassets */; }; + 34DC37962B8595C8000DFB99 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 34DC37952B8595C8000DFB99 /* Preview Assets.xcassets */; }; + 34DC379B2B8595E1000DFB99 /* CustomAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34DC379A2B8595E1000DFB99 /* CustomAppDelegate.swift */; }; 34E7854D2B513FCC00CBCBA1 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E7854C2B513FCC00CBCBA1 /* ShareViewController.m */; }; 34E785502B513FCC00CBCBA1 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34E7854E2B513FCC00CBCBA1 /* MainInterface.storyboard */; }; 34E785542B513FCC00CBCBA1 /* ShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -207,6 +212,7 @@ 7E20527CFF34511EE464C33F /* Pods_GrowingAnalyticsStartTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1769255A062869A5D219F683 /* Pods_GrowingAnalyticsStartTests.framework */; }; 997DAC68973F1F4FAF34EA2E /* Pods_Example_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B524BD63EF3439946134E74 /* Pods_Example_macOS.framework */; }; 9D43D2496D486AEB7DCFD460 /* Pods_Example_watchOS_Watch_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 358137F6293DF184E03C3572 /* Pods_Example_watchOS_Watch_App.framework */; }; + 9FA660A104463603E4710774 /* Pods_Example_SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4740916E28995032051C9BE /* Pods_Example_SwiftUI.framework */; }; A61E1E81175885070AAD10A9 /* Pods_ExampleiOS13.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C7CCC2E00F858DC5B58D4FA6 /* Pods_ExampleiOS13.framework */; }; A9D21D06460258FAC4736A26 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90476D1583D0EE778FCBED5E /* Pods_Example.framework */; }; DC414ADEC8E1A738BA63089E /* Pods_AdvertisingTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5655CC09B9A2CE16091DB52F /* Pods_AdvertisingTests.framework */; }; @@ -491,6 +497,13 @@ 34DAD9C22B6F948100760A9C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 34DAD9C42B6F948200760A9C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 34DAD9C72B6F948200760A9C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 34DC378C2B8595C7000DFB99 /* Example-SwiftUI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-SwiftUI.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 34DC378E2B8595C7000DFB99 /* Example_SwiftUIApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Example_SwiftUIApp.swift; sourceTree = ""; }; + 34DC37902B8595C7000DFB99 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 34DC37922B8595C8000DFB99 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 34DC37952B8595C8000DFB99 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 34DC379A2B8595E1000DFB99 /* CustomAppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAppDelegate.swift; sourceTree = ""; }; + 34DC379C2B859810000DFB99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 34E785492B513FCC00CBCBA1 /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 34E7854B2B513FCC00CBCBA1 /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = ""; }; 34E7854C2B513FCC00CBCBA1 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareViewController.m; sourceTree = ""; }; @@ -544,9 +557,12 @@ BDF26A896226E51F6DD6DA0E /* Pods_ShareExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ShareExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C2E2C01C3AC89773BC3F4BE1 /* Pods_ProtobufTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ProtobufTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C3770B519AE17A95967F4D21 /* Pods-Example-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-tvOS.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-tvOS/Pods-Example-tvOS.debug.xcconfig"; sourceTree = ""; }; + C7BA7AC57B5EDD2EE021AFF8 /* Pods-Example-SwiftUI.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-SwiftUI.debug.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-SwiftUI/Pods-Example-SwiftUI.debug.xcconfig"; sourceTree = ""; }; C7CCC2E00F858DC5B58D4FA6 /* Pods_ExampleiOS13.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ExampleiOS13.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C99DCCBFAEA542234FF81780 /* Pods-Example-SwiftUI.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-SwiftUI.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example-SwiftUI/Pods-Example-SwiftUI.release.xcconfig"; sourceTree = ""; }; CFC074E90BAC4B828194DC02 /* Pods-GrowingAnalyticsStartTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GrowingAnalyticsStartTests.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-GrowingAnalyticsStartTests/Pods-GrowingAnalyticsStartTests.release.xcconfig"; sourceTree = ""; }; D1AA342F735CCEF5565AEEE7 /* Pods-GrowingAnalyticsTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GrowingAnalyticsTests.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-GrowingAnalyticsTests/Pods-GrowingAnalyticsTests.release.xcconfig"; sourceTree = ""; }; + D4740916E28995032051C9BE /* Pods_Example_SwiftUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_SwiftUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; DBB8310F70301DB55003E65C /* Pods-ProtobufTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ProtobufTests.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-ProtobufTests/Pods-ProtobufTests.release.xcconfig"; sourceTree = ""; }; DDE20EE0BB4E138A407A5D1C /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; DE5443FE362C1AE18B5F4C84 /* Pods-AdvertisingTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AdvertisingTests.release.xcconfig"; path = "../Example/Pods/Target Support Files/Pods-AdvertisingTests/Pods-AdvertisingTests.release.xcconfig"; sourceTree = ""; }; @@ -637,6 +653,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34DC37892B8595C7000DFB99 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9FA660A104463603E4710774 /* Pods_Example_SwiftUI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 34E785462B513FCC00CBCBA1 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -884,6 +908,8 @@ 2396F869C811CB392EA9F501 /* Pods-Example-watchOS Watch App.release.xcconfig */, C3770B519AE17A95967F4D21 /* Pods-Example-tvOS.debug.xcconfig */, E3A2065A7EA394ECBE6D2F68 /* Pods-Example-tvOS.release.xcconfig */, + C7BA7AC57B5EDD2EE021AFF8 /* Pods-Example-SwiftUI.debug.xcconfig */, + C99DCCBFAEA542234FF81780 /* Pods-Example-SwiftUI.release.xcconfig */, ); name = Pods; path = ../Pods; @@ -1500,6 +1526,27 @@ path = "Example-tvOS"; sourceTree = ""; }; + 34DC378D2B8595C7000DFB99 /* Example-SwiftUI */ = { + isa = PBXGroup; + children = ( + 34DC379C2B859810000DFB99 /* Info.plist */, + 34DC378E2B8595C7000DFB99 /* Example_SwiftUIApp.swift */, + 34DC37902B8595C7000DFB99 /* ContentView.swift */, + 34DC379A2B8595E1000DFB99 /* CustomAppDelegate.swift */, + 34DC37922B8595C8000DFB99 /* Assets.xcassets */, + 34DC37942B8595C8000DFB99 /* Preview Content */, + ); + path = "Example-SwiftUI"; + sourceTree = ""; + }; + 34DC37942B8595C8000DFB99 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 34DC37952B8595C8000DFB99 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; 34E7854A2B513FCC00CBCBA1 /* ShareExtension */ = { isa = PBXGroup; children = ( @@ -1556,6 +1603,7 @@ 34FBF1892B6A2C1C008C7587 /* Example-watchOS Watch App */, 34DAD9992B6F919E00760A9C /* Example-visionOS */, 34DAD9BC2B6F948100760A9C /* Example-tvOS */, + 34DC378D2B8595C7000DFB99 /* Example-SwiftUI */, 6003F58C195388D20070C39A /* Frameworks */, 6003F58B195388D20070C39A /* Products */, 1172AEB47E26DD658BEEA1BB /* Pods */, @@ -1580,6 +1628,7 @@ 34FBF1882B6A2C1C008C7587 /* Example-watchOS Watch App.app */, 34DAD9982B6F919E00760A9C /* Example-visionOS.app */, 34DAD9BB2B6F948100760A9C /* Example-tvOS.app */, + 34DC378C2B8595C7000DFB99 /* Example-SwiftUI.app */, ); name = Products; sourceTree = ""; @@ -1608,6 +1657,7 @@ BDF26A896226E51F6DD6DA0E /* Pods_ShareExtension.framework */, 358137F6293DF184E03C3572 /* Pods_Example_watchOS_Watch_App.framework */, 24881A4A149E400F80B69E2A /* Pods_Example_tvOS.framework */, + D4740916E28995032051C9BE /* Pods_Example_SwiftUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -1816,8 +1866,6 @@ dependencies = ( ); name = "Example-visionOS"; - packageProductDependencies = ( - ); productName = "Example-visionOS"; productReference = 34DAD9982B6F919E00760A9C /* Example-visionOS.app */; productType = "com.apple.product-type.application"; @@ -1841,6 +1889,25 @@ productReference = 34DAD9BB2B6F948100760A9C /* Example-tvOS.app */; productType = "com.apple.product-type.application"; }; + 34DC378B2B8595C7000DFB99 /* Example-SwiftUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = 34DC37992B8595C8000DFB99 /* Build configuration list for PBXNativeTarget "Example-SwiftUI" */; + buildPhases = ( + B3E2912493C38B46B7E02305 /* [CP] Check Pods Manifest.lock */, + 34DC37882B8595C7000DFB99 /* Sources */, + 34DC37892B8595C7000DFB99 /* Frameworks */, + 34DC378A2B8595C7000DFB99 /* Resources */, + 73B8C944499528C8E6705A95 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Example-SwiftUI"; + productName = "Example-SwiftUI"; + productReference = 34DC378C2B8595C7000DFB99 /* Example-SwiftUI.app */; + productType = "com.apple.product-type.application"; + }; 34E785482B513FCC00CBCBA1 /* ShareExtension */ = { isa = PBXNativeTarget; buildConfigurationList = 34E785592B513FCC00CBCBA1 /* Build configuration list for PBXNativeTarget "ShareExtension" */; @@ -1975,9 +2042,18 @@ }; 34DAD9972B6F919E00760A9C = { CreatedOnToolsVersion = 15.2; + DevelopmentTeam = SXBU677CPT; + ProvisioningStyle = Automatic; }; 34DAD9BA2B6F948100760A9C = { CreatedOnToolsVersion = 15.2; + DevelopmentTeam = SXBU677CPT; + ProvisioningStyle = Automatic; + }; + 34DC378B2B8595C7000DFB99 = { + CreatedOnToolsVersion = 15.2; + DevelopmentTeam = SXBU677CPT; + ProvisioningStyle = Automatic; }; 34E785482B513FCC00CBCBA1 = { CreatedOnToolsVersion = 15.1; @@ -2027,6 +2103,7 @@ 34FBF1872B6A2C1C008C7587 /* Example-watchOS Watch App */, 34DAD9972B6F919E00760A9C /* Example-visionOS */, 34DAD9BA2B6F948100760A9C /* Example-tvOS */, + 34DC378B2B8595C7000DFB99 /* Example-SwiftUI */, ); }; /* End PBXProject section */ @@ -2126,6 +2203,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34DC378A2B8595C7000DFB99 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34DC37962B8595C8000DFB99 /* Preview Assets.xcassets in Resources */, + 34DC37932B8595C8000DFB99 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 34E785472B513FCC00CBCBA1 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2454,6 +2540,30 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ExampleiOS13/Pods-ExampleiOS13-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 73B8C944499528C8E6705A95 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Example-SwiftUI/Pods-Example-SwiftUI-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/GrowingAPM-Core/GrowingAPM.framework", + "${BUILT_PRODUCTS_DIR}/GrowingAnalytics-dd4d243e/GrowingAnalytics.framework", + "${BUILT_PRODUCTS_DIR}/GrowingUtils-AutotrackerCore-TrackerCore-iOS/GrowingUtils.framework", + "${BUILT_PRODUCTS_DIR}/Protobuf-iOS/Protobuf.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GrowingAPM.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GrowingAnalytics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GrowingUtils.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-SwiftUI/Pods-Example-SwiftUI-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 74CCB27175F6E8B90CD171BA /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2566,6 +2676,28 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + B3E2912493C38B46B7E02305 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Example-SwiftUI-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; BD21E0F09980000364B80451 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -2884,6 +3016,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 34DC37882B8595C7000DFB99 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 34DC379B2B8595E1000DFB99 /* CustomAppDelegate.swift in Sources */, + 34DC37912B8595C7000DFB99 /* ContentView.swift in Sources */, + 34DC378F2B8595C7000DFB99 /* Example_SwiftUIApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 34E785452B513FCC00CBCBA1 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -3216,10 +3358,7 @@ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 GrowingIO. All rights reserved."; INFOPLIST_KEY_NSMainStoryboardFile = Main; INFOPLIST_KEY_NSPrincipalClass = NSApplication; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -3273,10 +3412,7 @@ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 GrowingIO. All rights reserved."; INFOPLIST_KEY_NSMainStoryboardFile = Main; INFOPLIST_KEY_NSPrincipalClass = NSApplication; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -3284,9 +3420,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; }; name = Release; @@ -3325,11 +3460,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3376,11 +3507,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3437,10 +3564,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3497,10 +3621,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3544,11 +3665,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3594,11 +3711,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3644,11 +3757,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3694,11 +3803,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3743,11 +3848,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3793,11 +3894,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3842,11 +3939,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3892,11 +3985,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -3941,11 +4030,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -3991,11 +4076,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -4042,11 +4123,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -4095,11 +4172,7 @@ "\"$(SRCROOT)/..\"", ); IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -4146,10 +4219,7 @@ GCC_NO_COMMON_BLOCKS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "$(TARGET_NAME)/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -4203,10 +4273,7 @@ GCC_NO_COMMON_BLOCKS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "$(TARGET_NAME)/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -4259,10 +4326,7 @@ INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -4316,10 +4380,7 @@ INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; INFOPLIST_KEY_UIMainStoryboardFile = Main; INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -4335,6 +4396,120 @@ }; name = Release; }; + 34DC37972B8595C8000DFB99 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C7BA7AC57B5EDD2EE021AFF8 /* Pods-Example-SwiftUI.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_ASSET_PATHS = "\"Example-SwiftUI/Preview Content\""; + DEVELOPMENT_TEAM = SXBU677CPT; + ENABLE_PREVIEWS = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Example-SwiftUI/Info.plist"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-.Example-SwiftUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 34DC37982B8595C8000DFB99 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C99DCCBFAEA542234FF81780 /* Pods-Example-SwiftUI.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_ASSET_PATHS = "\"Example-SwiftUI/Preview Content\""; + DEVELOPMENT_TEAM = SXBU677CPT; + ENABLE_PREVIEWS = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Example-SwiftUI/Info.plist"; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-.Example-SwiftUI"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; 34E785572B513FCC00CBCBA1 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 0344A9865CDD74AF1F8A6198 /* Pods-ShareExtension.debug.xcconfig */; @@ -4372,11 +4547,7 @@ INFOPLIST_KEY_CFBundleDisplayName = ShareExtension; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 GrowingIO. All rights reserved."; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -4428,11 +4599,7 @@ INFOPLIST_KEY_CFBundleDisplayName = ShareExtension; INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 GrowingIO. All rights reserved."; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -4488,10 +4655,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "GrowingIO.GrowingIOTest-"; INFOPLIST_KEY_WKRunsIndependentlyOfCompanionApp = YES; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; @@ -4552,10 +4716,7 @@ INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; INFOPLIST_KEY_WKCompanionAppBundleIdentifier = "GrowingIO.GrowingIOTest-"; INFOPLIST_KEY_WKRunsIndependentlyOfCompanionApp = YES; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MARKETING_VERSION = 1.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -4664,10 +4825,7 @@ ); INFOPLIST_FILE = "Example/GrowingIO-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; OTHER_LDFLAGS = ( "$(inherited)", @@ -4706,10 +4864,7 @@ ); INFOPLIST_FILE = "Example/GrowingIO-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; OTHER_LDFLAGS = ( "$(inherited)", @@ -4857,6 +5012,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 34DC37992B8595C8000DFB99 /* Build configuration list for PBXNativeTarget "Example-SwiftUI" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 34DC37972B8595C8000DFB99 /* Debug */, + 34DC37982B8595C8000DFB99 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 34E785592B513FCC00CBCBA1 /* Build configuration list for PBXNativeTarget "ShareExtension" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Example/Podfile b/Example/Podfile index a699ed121..fcb2ebd67 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -102,6 +102,13 @@ end # pod 'GrowingAnalytics/Tracker', :path => '../' # end +target 'Example-SwiftUI' do + pod 'GrowingAnalytics/Autotracker', :path => '../' + pod 'GrowingAnalytics/Ads', :path => '../' + pod 'GrowingAnalytics/ABTesting', :path => '../' + pod 'GrowingAnalytics/APM', :path => '../' +end + post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| diff --git a/Example/Podfile.lock b/Example/Podfile.lock index b3ebb87a6..5e2bec48e 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -170,6 +170,6 @@ SPEC CHECKSUMS: SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf SDWebImage: a3ba0b8faac7228c3c8eadd1a55c9c9fe5e16457 -PODFILE CHECKSUM: a6c6e36ec9a4330f52fb9f3ea4d2ea1be1c91bc5 +PODFILE CHECKSUM: ca69667fb694419a0c7e2bce913494911fb599c7 COCOAPODS: 1.15.0 From 8cfda6740518bba9427edae73084c770c61d041a Mon Sep 17 00:00:00 2001 From: YoloMao Date: Wed, 21 Feb 2024 17:03:18 +0800 Subject: [PATCH 30/36] chore: update GrowingUtils to 1.2.3 --- Example/Podfile.lock | 14 +++++++------- GrowingAnalytics.podspec | 4 ++-- Package.swift | 2 +- Package@swift-5.9.swift | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 5e2bec48e..698a0fc9e 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -14,7 +14,7 @@ PODS: - GrowingAnalytics/WebCircle (= 4.1.0) - GrowingAnalytics/AutotrackerCore (4.1.0): - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingUtils/AutotrackerCore (~> 1.2.2) + - GrowingUtils/AutotrackerCore (~> 1.2.3) - GrowingAnalytics/Compression (4.1.0): - GrowingAnalytics/TrackerCore (= 4.1.0) - GrowingAnalytics/Database (4.1.0): @@ -53,7 +53,7 @@ PODS: - GrowingAnalytics/MobileDebugger (= 4.1.0) - GrowingAnalytics/TrackerCore (= 4.1.0) - GrowingAnalytics/TrackerCore (4.1.0): - - GrowingUtils/TrackerCore (~> 1.2.2) + - GrowingUtils/TrackerCore (~> 1.2.3) - GrowingAnalytics/WebCircle (4.1.0): - GrowingAnalytics/AutotrackerCore (= 4.1.0) - GrowingAnalytics/Hybrid (= 4.1.0) @@ -105,9 +105,9 @@ PODS: - GrowingToolsKit/Core - GrowingToolsKit/XPathTrack (2.0.0): - GrowingToolsKit/Core - - GrowingUtils/AutotrackerCore (1.2.2): + - GrowingUtils/AutotrackerCore (1.2.3): - GrowingUtils/TrackerCore - - GrowingUtils/TrackerCore (1.2.2) + - GrowingUtils/TrackerCore (1.2.3) - KIF (3.8.9): - KIF/Core (= 3.8.9) - KIF/Core (3.8.9) @@ -160,10 +160,10 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - GrowingAnalytics: ba899e368badee68acd6ac8f80b59e6ce3a64442 + GrowingAnalytics: 2438ebf7c6f52166e3c7097ee4c5d93e6881f9e2 GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b GrowingToolsKit: edc93c96e47bd6ad1ff3deffe72fe276ae0a1fa8 - GrowingUtils: 6071dc1206f5e62398d90dec78c7eaa07b1b9892 + GrowingUtils: 68aee2c96849bf9b674740503da30c2da468e79d KIF: 7660c626b0f2d4562533590960db70a36d640558 OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 Protobuf: 8e9074797a13c484a79959fdb819ef4ae6da7dbe @@ -172,4 +172,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: ca69667fb694419a0c7e2bce913494911fb599c7 -COCOAPODS: 1.15.0 +COCOAPODS: 1.15.2 diff --git a/GrowingAnalytics.podspec b/GrowingAnalytics.podspec index 097b98555..7c963c7cc 100644 --- a/GrowingAnalytics.podspec +++ b/GrowingAnalytics.podspec @@ -44,7 +44,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 end s.subspec 'TrackerCore' do |trackerCore| - trackerCore.dependency 'GrowingUtils/TrackerCore', '~> 1.2.2' + trackerCore.dependency 'GrowingUtils/TrackerCore', '~> 1.2.3' trackerCore.source_files = 'GrowingTrackerCore/**/*{.h,.m,.c,.cpp,.mm}' trackerCore.public_header_files = 'GrowingTrackerCore/Public/*.h' trackerCore.ios.resource_bundles = {'GrowingAnalytics' => ['Resources/iOS/GrowingAnalytics.bundle/PrivacyInfo.xcprivacy']} @@ -55,7 +55,7 @@ GrowingAnalytics具备自动采集基本的用户行为事件,比如访问和 s.subspec 'AutotrackerCore' do |autotrackerCore| autotrackerCore.ios.deployment_target = '10.0' autotrackerCore.tvos.deployment_target = '12.0' - autotrackerCore.dependency 'GrowingUtils/AutotrackerCore', '~> 1.2.2' + autotrackerCore.dependency 'GrowingUtils/AutotrackerCore', '~> 1.2.3' autotrackerCore.source_files = 'GrowingAutotrackerCore/**/*{.h,.m,.c,.cpp,.mm}' autotrackerCore.public_header_files = 'GrowingAutotrackerCore/Public/*.h' autotrackerCore.dependency 'GrowingAnalytics/TrackerCore', s.version.to_s diff --git a/Package.swift b/Package.swift index b2c88e4d0..376ae0b17 100644 --- a/Package.swift +++ b/Package.swift @@ -43,7 +43,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/growingio/growingio-sdk-ios-utilities.git", - "1.2.2" ..< "1.3.0" + "1.2.3" ..< "1.3.0" ), .package( url: "https://github.com/growingio/growingio-sdk-ios-performance-ext.git", diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift index b20e4e311..27cc19ba7 100644 --- a/Package@swift-5.9.swift +++ b/Package@swift-5.9.swift @@ -44,7 +44,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/growingio/growingio-sdk-ios-utilities.git", - "1.2.2" ..< "1.3.0" + "1.2.3" ..< "1.3.0" ), .package( url: "https://github.com/growingio/growingio-sdk-ios-performance-ext.git", From 4b5390381f4d4b2ce2e6c3a37554f21bdc3baeef Mon Sep 17 00:00:00 2001 From: YoloMao Date: Fri, 15 Mar 2024 15:35:38 +0800 Subject: [PATCH 31/36] chore: update pod dep --- Example/Podfile | 4 +- Example/Podfile.lock | 162 +++++++++++++++++++++---------------------- README.md | 2 +- 3 files changed, 84 insertions(+), 84 deletions(-) diff --git a/Example/Podfile b/Example/Podfile index fcb2ebd67..84d4246c2 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -24,7 +24,7 @@ target 'Example' do # pod 'GrowingAPM/CrashMonitor' pod 'GrowingAnalytics/APM', :path => '../' - pod 'GrowingToolsKit', '2.0.0' + pod 'GrowingToolsKit', '~> 2.0.1' pod 'SDCycleScrollView', '~> 1.75' # pod 'Bugly' @@ -79,7 +79,7 @@ target 'ExampleiOS13' do # 而不是再去集成一个新的 GrowingAPM,其将导致生成 2 个 GrowingAPM Pod Target,编译会出现 Multiple commands produce 报错 pod 'GrowingAPM' - pod 'GrowingToolsKit', '2.0.0' + pod 'GrowingToolsKit', '~> 2.0.1' end target 'Example-macOS' do diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 698a0fc9e..4225640b2 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,66 +1,66 @@ PODS: - - GrowingAnalytics/ABTesting (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/Ads (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/APM (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) + - GrowingAnalytics/ABTesting (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/Ads (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/APM (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) - GrowingAPM/Core (~> 1.0.1) - - GrowingAnalytics/Autotracker (4.1.0): - - GrowingAnalytics/AutotrackerCore (= 4.1.0) - - GrowingAnalytics/DefaultServices (= 4.1.0) - - GrowingAnalytics/Hybrid (= 4.1.0) - - GrowingAnalytics/MobileDebugger (= 4.1.0) - - GrowingAnalytics/WebCircle (= 4.1.0) - - GrowingAnalytics/AutotrackerCore (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) + - GrowingAnalytics/Autotracker (4.2.0): + - GrowingAnalytics/AutotrackerCore (= 4.2.0) + - GrowingAnalytics/DefaultServices (= 4.2.0) + - GrowingAnalytics/Hybrid (= 4.2.0) + - GrowingAnalytics/MobileDebugger (= 4.2.0) + - GrowingAnalytics/WebCircle (= 4.2.0) + - GrowingAnalytics/AutotrackerCore (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) - GrowingUtils/AutotrackerCore (~> 1.2.3) - - GrowingAnalytics/Compression (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/Database (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/DefaultServices (4.1.0): - - GrowingAnalytics/Compression (= 4.1.0) - - GrowingAnalytics/Encryption (= 4.1.0) - - GrowingAnalytics/JSON (= 4.1.0) - - GrowingAnalytics/Network (= 4.1.0) - - GrowingAnalytics/Protobuf (= 4.1.0) - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/Encryption (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/Hybrid (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/ImpressionTrack (4.1.0): - - GrowingAnalytics/AutotrackerCore (= 4.1.0) - - GrowingAnalytics/JSON (4.1.0): - - GrowingAnalytics/Database (= 4.1.0) - - GrowingAnalytics/MobileDebugger (4.1.0): - - GrowingAnalytics/Screenshot (= 4.1.0) - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/WebSocket (= 4.1.0) - - GrowingAnalytics/Network (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/Protobuf (4.1.0): - - GrowingAnalytics/Database (= 4.1.0) - - GrowingAnalytics/Protobuf/Proto (= 4.1.0) - - GrowingAnalytics/Protobuf/Proto (4.1.0): - - GrowingAnalytics/Database (= 4.1.0) + - GrowingAnalytics/Compression (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/Database (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/DefaultServices (4.2.0): + - GrowingAnalytics/Compression (= 4.2.0) + - GrowingAnalytics/Encryption (= 4.2.0) + - GrowingAnalytics/JSON (= 4.2.0) + - GrowingAnalytics/Network (= 4.2.0) + - GrowingAnalytics/Protobuf (= 4.2.0) + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/Encryption (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/Hybrid (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/ImpressionTrack (4.2.0): + - GrowingAnalytics/AutotrackerCore (= 4.2.0) + - GrowingAnalytics/JSON (4.2.0): + - GrowingAnalytics/Database (= 4.2.0) + - GrowingAnalytics/MobileDebugger (4.2.0): + - GrowingAnalytics/Screenshot (= 4.2.0) + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/WebSocket (= 4.2.0) + - GrowingAnalytics/Network (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/Protobuf (4.2.0): + - GrowingAnalytics/Database (= 4.2.0) + - GrowingAnalytics/Protobuf/Proto (= 4.2.0) + - GrowingAnalytics/Protobuf/Proto (4.2.0): + - GrowingAnalytics/Database (= 4.2.0) - Protobuf (>= 3.22.0) - - GrowingAnalytics/Screenshot (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/Tracker (4.1.0): - - GrowingAnalytics/DefaultServices (= 4.1.0) - - GrowingAnalytics/MobileDebugger (= 4.1.0) - - GrowingAnalytics/TrackerCore (= 4.1.0) - - GrowingAnalytics/TrackerCore (4.1.0): + - GrowingAnalytics/Screenshot (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/Tracker (4.2.0): + - GrowingAnalytics/DefaultServices (= 4.2.0) + - GrowingAnalytics/MobileDebugger (= 4.2.0) + - GrowingAnalytics/TrackerCore (= 4.2.0) + - GrowingAnalytics/TrackerCore (4.2.0): - GrowingUtils/TrackerCore (~> 1.2.3) - - GrowingAnalytics/WebCircle (4.1.0): - - GrowingAnalytics/AutotrackerCore (= 4.1.0) - - GrowingAnalytics/Hybrid (= 4.1.0) - - GrowingAnalytics/Screenshot (= 4.1.0) - - GrowingAnalytics/WebSocket (= 4.1.0) - - GrowingAnalytics/WebSocket (4.1.0): - - GrowingAnalytics/TrackerCore (= 4.1.0) + - GrowingAnalytics/WebCircle (4.2.0): + - GrowingAnalytics/AutotrackerCore (= 4.2.0) + - GrowingAnalytics/Hybrid (= 4.2.0) + - GrowingAnalytics/Screenshot (= 4.2.0) + - GrowingAnalytics/WebSocket (= 4.2.0) + - GrowingAnalytics/WebSocket (4.2.0): + - GrowingAnalytics/TrackerCore (= 4.2.0) - GrowingAPM (1.0.1): - GrowingAPM/Core (= 1.0.1) - GrowingAPM/CrashMonitor (= 1.0.1) @@ -71,16 +71,16 @@ PODS: - GrowingAPM/Core - GrowingAPM/UIMonitor (1.0.1): - GrowingAPM/Core - - GrowingToolsKit (2.0.0): - - GrowingToolsKit/Default (= 2.0.0) - - GrowingToolsKit/APMCore (2.0.0): + - GrowingToolsKit (2.0.1): + - GrowingToolsKit/Default (= 2.0.1) + - GrowingToolsKit/APMCore (2.0.1): - GrowingAPM/Core - GrowingToolsKit/Core - - GrowingToolsKit/Core (2.0.0) - - GrowingToolsKit/CrashMonitor (2.0.0): + - GrowingToolsKit/Core (2.0.1) + - GrowingToolsKit/CrashMonitor (2.0.1): - GrowingAPM/CrashMonitor - GrowingToolsKit/APMCore - - GrowingToolsKit/Default (2.0.0): + - GrowingToolsKit/Default (2.0.1): - GrowingToolsKit/Core - GrowingToolsKit/CrashMonitor - GrowingToolsKit/EventsList @@ -90,20 +90,20 @@ PODS: - GrowingToolsKit/SDKInfo - GrowingToolsKit/Settings - GrowingToolsKit/XPathTrack - - GrowingToolsKit/EventsList (2.0.0): + - GrowingToolsKit/EventsList (2.0.1): - GrowingToolsKit/Core - - GrowingToolsKit/LaunchTime (2.0.0): + - GrowingToolsKit/LaunchTime (2.0.1): - GrowingAPM/UIMonitor - GrowingToolsKit/APMCore - - GrowingToolsKit/NetFlow (2.0.0): + - GrowingToolsKit/NetFlow (2.0.1): - GrowingToolsKit/Core - - GrowingToolsKit/Realtime (2.0.0): + - GrowingToolsKit/Realtime (2.0.1): - GrowingToolsKit/Core - - GrowingToolsKit/SDKInfo (2.0.0): + - GrowingToolsKit/SDKInfo (2.0.1): - GrowingToolsKit/Core - - GrowingToolsKit/Settings (2.0.0): + - GrowingToolsKit/Settings (2.0.1): - GrowingToolsKit/Core - - GrowingToolsKit/XPathTrack (2.0.0): + - GrowingToolsKit/XPathTrack (2.0.1): - GrowingToolsKit/Core - GrowingUtils/AutotrackerCore (1.2.3): - GrowingUtils/TrackerCore @@ -124,12 +124,12 @@ PODS: - OHHTTPStubs/NSURLSession (9.1.0): - OHHTTPStubs/Core - OHHTTPStubs/OHPathHelpers (9.1.0) - - Protobuf (3.25.3) + - Protobuf (3.26.0) - SDCycleScrollView (1.82): - SDWebImage (>= 5.0.0) - - SDWebImage (5.18.11): - - SDWebImage/Core (= 5.18.11) - - SDWebImage/Core (5.18.11) + - SDWebImage (5.19.0): + - SDWebImage/Core (= 5.19.0) + - SDWebImage/Core (5.19.0) DEPENDENCIES: - GrowingAnalytics/ABTesting (from `../`) @@ -139,7 +139,7 @@ DEPENDENCIES: - GrowingAnalytics/ImpressionTrack (from `../`) - GrowingAnalytics/Tracker (from `../`) - GrowingAPM - - GrowingToolsKit (= 2.0.0) + - GrowingToolsKit (~> 2.0.1) - KIF - OHHTTPStubs - SDCycleScrollView (~> 1.75) @@ -160,16 +160,16 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - GrowingAnalytics: 2438ebf7c6f52166e3c7097ee4c5d93e6881f9e2 + GrowingAnalytics: c24033146e037d32387883bf57f0be44f42add13 GrowingAPM: 3c4de0384935b654e6798b95606f47883a99418b - GrowingToolsKit: edc93c96e47bd6ad1ff3deffe72fe276ae0a1fa8 + GrowingToolsKit: c1f7753484ca3e18dedb2fe083317fb19c1fecb4 GrowingUtils: 68aee2c96849bf9b674740503da30c2da468e79d KIF: 7660c626b0f2d4562533590960db70a36d640558 OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 - Protobuf: 8e9074797a13c484a79959fdb819ef4ae6da7dbe + Protobuf: 5685c66a07eaad9d18ce5ab618e9ac01fd04b5aa SDCycleScrollView: a0d74c3384caa72bdfc81470bdbc8c14b3e1fbcf - SDWebImage: a3ba0b8faac7228c3c8eadd1a55c9c9fe5e16457 + SDWebImage: 981fd7e860af070920f249fd092420006014c3eb -PODFILE CHECKSUM: ca69667fb694419a0c7e2bce913494911fb599c7 +PODFILE CHECKSUM: 51bab161e69d216b5eff74379bef32902e83107b COCOAPODS: 1.15.2 diff --git a/README.md b/README.md index aed71a4af..8a8feebee 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ GrowingIO 专注于零售、电商、保险、酒旅航司、教育、内容社 ## License ``` -Copyright (C) 2023 Beijing Yishu Technology Co., Ltd. +Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From ff27c660aa780aa27104153d591f715ab1ed159e Mon Sep 17 00:00:00 2001 From: YoloMao Date: Mon, 18 Mar 2024 16:55:46 +0800 Subject: [PATCH 32/36] style: add comment about undetermined reachability --- GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m | 1 + 1 file changed, 1 insertion(+) diff --git a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m index eb2f1d86c..02fd16e9e 100644 --- a/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m +++ b/GrowingTrackerCore/Network/GrowingNetworkPathMonitor.m @@ -105,6 +105,7 @@ - (GrowingNetworkReachabilityStatus)reachabilityStatusForPath:(nw_path_t)path return GrowingNetworkReachabilityReachableViaWWAN; } + // Eg. close all network connections (WiFi/WWAN/...) but still opening VPN return GrowingNetworkReachabilityUndetermined; } From 76c1e933136e44ab578f4e61dd7d223f88263991 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Mon, 18 Mar 2024 17:23:20 +0800 Subject: [PATCH 33/36] =?UTF-8?q?fix:=20path=20=E4=B8=BA=E7=A9=BA=E6=97=B6?= =?UTF-8?q?=EF=BC=8Cmobiledebugger=20=E4=B8=8A=E6=97=A0=E6=B3=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=AF=A5=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m b/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m index bf6748f11..8c0b36267 100644 --- a/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m +++ b/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m @@ -87,7 +87,7 @@ - (id)growingHelper_jsonObject { if (self.domain.length > 0) { [dic setObject:self.domain forKey:@"domain"]; } - if (self.path.length > 0) { + if (self.path.length >= 0) { [dic setObject:self.path forKey:@"path"]; } if (self.query.length > 0) { From c4716ec8cb12cf64c2cb20ead01cadab87467fc6 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Mon, 18 Mar 2024 19:37:10 +0800 Subject: [PATCH 34/36] =?UTF-8?q?fix:=20path=20=E4=B8=BA=E7=A9=BA=E6=97=B6?= =?UTF-8?q?=EF=BC=8Cmobiledebugger=20=E4=B8=8A=E6=97=A0=E6=B3=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=AF=A5=E5=AD=97=E6=AE=B5=20(=E4=BB=85=E6=97=A0?= =?UTF-8?q?=E5=9F=8B=E7=82=B9=E4=BA=8B=E4=BB=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m b/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m index 8c0b36267..8f43af2eb 100644 --- a/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m +++ b/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m @@ -87,7 +87,10 @@ - (id)growingHelper_jsonObject { if (self.domain.length > 0) { [dic setObject:self.domain forKey:@"domain"]; } - if (self.path.length >= 0) { + if (self.path.length >= 0 && + (self.eventType == GrowingPBEventType_Page || + self.eventType == GrowingPBEventType_ViewClick || + self.eventType == GrowingPBEventType_ViewChange)) { [dic setObject:self.path forKey:@"path"]; } if (self.query.length > 0) { From 1ba06c5a4df318c9ee4d8c06f5e0d77a8eedceea Mon Sep 17 00:00:00 2001 From: GIOSDK Date: Mon, 18 Mar 2024 11:37:38 +0000 Subject: [PATCH 35/36] style: code format --- Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m b/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m index 8f43af2eb..82fb0c881 100644 --- a/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m +++ b/Services/Protobuf/Catagory/GrowingPBEventV3Dto+GrowingHelper.m @@ -88,8 +88,7 @@ - (id)growingHelper_jsonObject { [dic setObject:self.domain forKey:@"domain"]; } if (self.path.length >= 0 && - (self.eventType == GrowingPBEventType_Page || - self.eventType == GrowingPBEventType_ViewClick || + (self.eventType == GrowingPBEventType_Page || self.eventType == GrowingPBEventType_ViewClick || self.eventType == GrowingPBEventType_ViewChange)) { [dic setObject:self.path forKey:@"path"]; } From dec8daa832377389eeb71741e41dea25ebecbe8a Mon Sep 17 00:00:00 2001 From: YoloMao Date: Tue, 26 Mar 2024 11:02:23 +0800 Subject: [PATCH 36/36] fix: ignore nw_path_status on watchOS --- GrowingTrackerCore/Event/GrowingEventManager.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GrowingTrackerCore/Event/GrowingEventManager.m b/GrowingTrackerCore/Event/GrowingEventManager.m index b024a27e7..b8cb45f9f 100644 --- a/GrowingTrackerCore/Event/GrowingEventManager.m +++ b/GrowingTrackerCore/Event/GrowingEventManager.m @@ -259,9 +259,11 @@ - (void)sendEventsOfChannel_unsafe:(GrowingEventChannel *)channel { BOOL isViaCellular = NO; // 没网络 直接返回 if (reachabilityStatus == GrowingNetworkReachabilityNotReachable) { - // 没网络 直接返回 +#if !Growing_OS_WATCH + // https://forums.developer.apple.com/forums/thread/729568 GIOLogDebug(@"No available Internet connection, delay upload (channel = %@).", channel.name); return; +#endif } NSUInteger policyMask = GrowingEventSendPolicyInstant | GrowingEventSendPolicyMobileData | GrowingEventSendPolicyWiFi;