From 0df77874c2b301f370fc36a0e709796da7df8690 Mon Sep 17 00:00:00 2001 From: BrandonStalnaker Date: Thu, 4 Apr 2024 10:09:25 -0400 Subject: [PATCH 1/2] feat: Add Privacy Manifest and SPM Support --- .gitignore | 2 ++ Package.swift | 31 +++++++++++++++++++ mParticle-Apptentive.podspec | 2 +- .../project.pbxproj | 4 +++ mParticle-Apptentive/MPKitApptentive.m | 12 ++++--- mParticle-Apptentive/PrivacyInfo.xcprivacy | 18 +++++++++++ 6 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 Package.swift create mode 100644 mParticle-Apptentive/PrivacyInfo.xcprivacy diff --git a/.gitignore b/.gitignore index 3f339f4..3a76edf 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,8 @@ playground.xcworkspace # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. # Packages/ .build/ +Package.resolved + # CocoaPods # diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..ee7b435 --- /dev/null +++ b/Package.swift @@ -0,0 +1,31 @@ +// 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: "mParticle-Apptentive", + platforms: [ .iOS(.v13) ], + products: [ + .library( + name: "mParticle-Apptentive", + targets: ["mParticle-Apptentive"]), + ], + dependencies: [ + .package(url: "https://github.com/mParticle/mparticle-apple-sdk", + .upToNextMajor(from: "8.0.0")), + .package(url: "https://github.com/apptentive/apptentive-kit-ios", + .upToNextMajor(from: "6.6.0")), + ], + targets: [ + .target( + name: "mParticle-Apptentive", + dependencies: [ + .product(name: "mParticle-Apple-SDK", package: "mparticle-apple-sdk"), + .product(name: "ApptentiveKit", package: "apptentive-kit-ios"), + ], + path: "mParticle-Apptentive", + exclude: ["Info.plist"], + publicHeadersPath: "."), + ] +) diff --git a/mParticle-Apptentive.podspec b/mParticle-Apptentive.podspec index 89771d4..18e29f4 100755 --- a/mParticle-Apptentive.podspec +++ b/mParticle-Apptentive.podspec @@ -14,5 +14,5 @@ Pod::Spec.new do |s| s.ios.deployment_target = "11.0" s.ios.source_files = 'mParticle-Apptentive/*.{h,m,mm}' s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.7' - s.ios.dependency 'ApptentiveKit', '~> 6.1' + s.ios.dependency 'ApptentiveKit', '~> 6.6' end diff --git a/mParticle-Apptentive.xcodeproj/project.pbxproj b/mParticle-Apptentive.xcodeproj/project.pbxproj index 2e4ceff..c4d02ac 100644 --- a/mParticle-Apptentive.xcodeproj/project.pbxproj +++ b/mParticle-Apptentive.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + D330F1682BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D330F1672BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy */; }; D37EFA8724F430580091B75B /* ApptentiveKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB695FB21F5F549A00A7F4CF /* ApptentiveKit.framework */; platformFilter = ios; }; DB7E05A61CB819D300967FDF /* MPKitApptentive.h in Headers */ = {isa = PBXBuildFile; fileRef = DB7E05A41CB819D300967FDF /* MPKitApptentive.h */; settings = {ATTRIBUTES = (Public, ); }; }; DB7E05A71CB819D300967FDF /* MPKitApptentive.m in Sources */ = {isa = PBXBuildFile; fileRef = DB7E05A51CB819D300967FDF /* MPKitApptentive.m */; }; @@ -29,6 +30,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + D330F1672BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; DB695FB21F5F549A00A7F4CF /* ApptentiveKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApptentiveKit.framework; path = Carthage/Build/iOS/ApptentiveKit.framework; sourceTree = ""; }; DB7E05A41CB819D300967FDF /* MPKitApptentive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPKitApptentive.h; sourceTree = ""; }; DB7E05A51CB819D300967FDF /* MPKitApptentive.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPKitApptentive.m; sourceTree = ""; }; @@ -89,6 +91,7 @@ children = ( DB7E05A41CB819D300967FDF /* MPKitApptentive.h */, DB7E05A51CB819D300967FDF /* MPKitApptentive.m */, + D330F1672BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy */, EF23381C263F48B2004B1C55 /* MPKitApptentiveUtils.h */, EF23381D263F48B2004B1C55 /* MPKitApptentiveUtils.m */, DB94016F1CB703F2007ABB18 /* mParticle_Apptentive.h */, @@ -203,6 +206,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + D330F1682BBEE0AC005CB4CD /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/mParticle-Apptentive/MPKitApptentive.m b/mParticle-Apptentive/MPKitApptentive.m index 9dd350e..a5df45e 100644 --- a/mParticle-Apptentive/MPKitApptentive.m +++ b/mParticle-Apptentive/MPKitApptentive.m @@ -1,12 +1,14 @@ #import "MPKitApptentive.h" #import "MPKitApptentiveUtils.h" -#if defined(__has_include) && __has_include() -#import -#elif defined(__has_include) && __has_include(ApptentiveKit-Swift.h) -#import "ApptentiveKit-Swift.h" +#if SWIFT_PACKAGE + @import ApptentiveKit; #else -@import ApptentiveKit; +#if __has_include() + #import +#else + #import "ApptentiveKit-Swift.h" +#endif #endif static NSString * const apptentiveAppKeyKey = @"apptentiveAppKey"; diff --git a/mParticle-Apptentive/PrivacyInfo.xcprivacy b/mParticle-Apptentive/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..eb3b0ea --- /dev/null +++ b/mParticle-Apptentive/PrivacyInfo.xcprivacy @@ -0,0 +1,18 @@ + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + + + NSPrivacyAccessedAPITypes + + + + + From ee0b50ce1add1d50c43f8bc54b465f9a7b689704 Mon Sep 17 00:00:00 2001 From: BrandonStalnaker Date: Thu, 4 Apr 2024 10:22:04 -0400 Subject: [PATCH 2/2] update minimum for podspec --- mParticle-Apptentive.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mParticle-Apptentive.podspec b/mParticle-Apptentive.podspec index 18e29f4..34feb5a 100755 --- a/mParticle-Apptentive.podspec +++ b/mParticle-Apptentive.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/mparticle-integrations/mparticle-apple-integration-apptentive.git", :tag => s.version.to_s } s.social_media_url = "https://twitter.com/mparticle" s.swift_version = "5.5" - s.ios.deployment_target = "11.0" + s.ios.deployment_target = "13.0" s.ios.source_files = 'mParticle-Apptentive/*.{h,m,mm}' s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.7' s.ios.dependency 'ApptentiveKit', '~> 6.6'