Skip to content

Commit

Permalink
feat: Improve Privacy Manifest support for iOS 17 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
einsteinx2 authored May 8, 2024
1 parent 9db7069 commit 3ba18d3
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 71 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ playground.xcworkspace
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/
Package.resolved

# CocoaPods
#
Expand Down Expand Up @@ -65,4 +66,4 @@ fastlane/test_output
**/Podfile.lock
**/*.xcworkspace
**/*.DS_Store
*.DS_Store
*.DS_Store
2 changes: 2 additions & 0 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
binary "https://raw.githubusercontent.com/urbanairship/apptimize-ios-kit/master/Apptimize.json" ~> 3.5
binary "https://raw.githubusercontent.com/mParticle/mparticle-apple-sdk/main/mParticle_Apple_SDK.json" ~> 8.22
2 changes: 2 additions & 0 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
binary "https://raw.githubusercontent.com/mParticle/mparticle-apple-sdk/main/mParticle_Apple_SDK.json" "8.24.0"
binary "https://raw.githubusercontent.com/urbanairship/apptimize-ios-kit/master/Apptimize.json" "3.5.24"
30 changes: 30 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "mParticle-Apptimize",
platforms: [ .iOS(.v11) ],
products: [
.library(
name: "mParticle-Apptimize",
targets: ["mParticle-Apptimize"]),
],
dependencies: [
.package(url: "https://github.com/mParticle/mparticle-apple-sdk",
.upToNextMajor(from: "8.22.0")),
.package(url: "https://github.com/urbanairship/apptimize-ios-kit",
.upToNextMajor(from: "3.5.25")),
],
targets: [
.target(
name: "mParticle-Apptimize",
dependencies: [
.product(name: "mParticle-Apple-SDK", package: "mparticle-apple-sdk"),
.product(name: "Apptimize", package: "apptimize-ios-kit"),
],
path: "mParticle-Apptimize",
exclude: ["Info.plist"],
resources: [.process("PrivacyInfo.xcprivacy")],
publicHeadersPath: ".")
]
)
12 changes: 0 additions & 12 deletions Podfile

This file was deleted.

3 changes: 2 additions & 1 deletion mParticle-Apptimize.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Pod::Spec.new do |s|

s.ios.deployment_target = "11.0"
s.ios.source_files = 'mParticle-Apptimize/*.{h,m,mm}'
s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.0'
s.ios.resource_bundles = { 'mParticle-Apptimize-Privacy' => ['mParticle-Apptimize/PrivacyInfo.xcprivacy'] }
s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.22'
s.ios.dependency 'Apptimize', '~> 3.5'

end
58 changes: 10 additions & 48 deletions mParticle-Apptimize.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,48 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 60;
objects = {

/* Begin PBXBuildFile section */
27B46C39177A6EE98630695A /* Pods_mParticle_Apptimize.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FC81CBB3A99FAD1126C5BA51 /* Pods_mParticle_Apptimize.framework */; };
53034BE42BEAD62000AA62CE /* Apptimize.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53034BE22BEAD62000AA62CE /* Apptimize.xcframework */; };
53034BE52BEAD62000AA62CE /* mParticle_Apple_SDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53034BE32BEAD62000AA62CE /* mParticle_Apple_SDK.xcframework */; };
53E9ACCD2BBF0F7E0062A03A /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 53E9ACCC2BBF0F7E0062A03A /* PrivacyInfo.xcprivacy */; };
D37EFA9924F43B970091B75B /* mParticle_Apptimize.h in Headers */ = {isa = PBXBuildFile; fileRef = D37EFA9724F43B970091B75B /* mParticle_Apptimize.h */; settings = {ATTRIBUTES = (Public, ); }; };
D37EFAA124F43C780091B75B /* MPKitApptimize.m in Sources */ = {isa = PBXBuildFile; fileRef = D37EFA9F24F43C780091B75B /* MPKitApptimize.m */; };
D37EFAA224F43C780091B75B /* MPKitApptimize.h in Headers */ = {isa = PBXBuildFile; fileRef = D37EFAA024F43C780091B75B /* MPKitApptimize.h */; };
D37EFAA224F43C780091B75B /* MPKitApptimize.h in Headers */ = {isa = PBXBuildFile; fileRef = D37EFAA024F43C780091B75B /* MPKitApptimize.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
27D8AA1C689E5CD6D5103589 /* Pods-mParticle-Apptimize.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-mParticle-Apptimize.release.xcconfig"; path = "Target Support Files/Pods-mParticle-Apptimize/Pods-mParticle-Apptimize.release.xcconfig"; sourceTree = "<group>"; };
53034BE22BEAD62000AA62CE /* Apptimize.xcframework */ = {isa = PBXFileReference; expectedSignature = "AppleDeveloperProgram:PGJV57GD94:Urban Airship Inc."; lastKnownFileType = wrapper.xcframework; name = Apptimize.xcframework; path = Carthage/Build/Apptimize.xcframework; sourceTree = "<group>"; };
53034BE32BEAD62000AA62CE /* mParticle_Apple_SDK.xcframework */ = {isa = PBXFileReference; expectedSignature = "AppleDeveloperProgram:DLD43Y3TRP:mParticle, inc"; lastKnownFileType = wrapper.xcframework; name = mParticle_Apple_SDK.xcframework; path = Carthage/Build/mParticle_Apple_SDK.xcframework; sourceTree = "<group>"; };
53E9ACCC2BBF0F7E0062A03A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
AA05C6D0B18A689C357B7448 /* Pods-mParticle-Apptimize.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-mParticle-Apptimize.debug.xcconfig"; path = "Target Support Files/Pods-mParticle-Apptimize/Pods-mParticle-Apptimize.debug.xcconfig"; sourceTree = "<group>"; };
D37EFA9424F43B970091B75B /* mParticle_Apptimize.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = mParticle_Apptimize.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D37EFA9724F43B970091B75B /* mParticle_Apptimize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mParticle_Apptimize.h; sourceTree = "<group>"; };
D37EFA9824F43B970091B75B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D37EFA9F24F43C780091B75B /* MPKitApptimize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPKitApptimize.m; sourceTree = "<group>"; };
D37EFAA024F43C780091B75B /* MPKitApptimize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPKitApptimize.h; sourceTree = "<group>"; };
D37EFAA424F442E00091B75B /* mParticle_Apple_SDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mParticle_Apple_SDK.framework; path = Carthage/Build/iOS/mParticle_Apple_SDK.framework; sourceTree = "<group>"; };
FC81CBB3A99FAD1126C5BA51 /* Pods_mParticle_Apptimize.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_mParticle_Apptimize.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
D37EFA9124F43B970091B75B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
27B46C39177A6EE98630695A /* Pods_mParticle_Apptimize.framework in Frameworks */,
53034BE42BEAD62000AA62CE /* Apptimize.xcframework in Frameworks */,
53034BE52BEAD62000AA62CE /* mParticle_Apple_SDK.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
556ED8B199C57862917404B1 /* Pods */ = {
isa = PBXGroup;
children = (
AA05C6D0B18A689C357B7448 /* Pods-mParticle-Apptimize.debug.xcconfig */,
27D8AA1C689E5CD6D5103589 /* Pods-mParticle-Apptimize.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
D37EFA8A24F43B970091B75B = {
isa = PBXGroup;
children = (
D37EFA9624F43B970091B75B /* mParticle-Apptimize */,
D37EFA9524F43B970091B75B /* Products */,
D37EFAA324F442E00091B75B /* Frameworks */,
556ED8B199C57862917404B1 /* Pods */,
);
sourceTree = "<group>";
};
Expand All @@ -81,8 +71,8 @@
D37EFAA324F442E00091B75B /* Frameworks */ = {
isa = PBXGroup;
children = (
D37EFAA424F442E00091B75B /* mParticle_Apple_SDK.framework */,
FC81CBB3A99FAD1126C5BA51 /* Pods_mParticle_Apptimize.framework */,
53034BE22BEAD62000AA62CE /* Apptimize.xcframework */,
53034BE32BEAD62000AA62CE /* mParticle_Apple_SDK.xcframework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -106,7 +96,6 @@
isa = PBXNativeTarget;
buildConfigurationList = D37EFA9C24F43B970091B75B /* Build configuration list for PBXNativeTarget "mParticle-Apptimize" */;
buildPhases = (
D29EE7C56E0B79CECE2AFB9A /* [CP] Check Pods Manifest.lock */,
D37EFA8F24F43B970091B75B /* Headers */,
D37EFA9024F43B970091B75B /* Sources */,
D37EFA9124F43B970091B75B /* Frameworks */,
Expand Down Expand Up @@ -163,31 +152,6 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
D29EE7C56E0B79CECE2AFB9A /* [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-mParticle-Apptimize-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;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
D37EFA9024F43B970091B75B /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -322,7 +286,6 @@
};
D37EFA9D24F43B970091B75B /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AA05C6D0B18A689C357B7448 /* Pods-mParticle-Apptimize.debug.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand All @@ -349,7 +312,6 @@
};
D37EFA9E24F43B970091B75B /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 27D8AA1C689E5CD6D5103589 /* Pods-mParticle-Apptimize.release.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D37EFA9324F43B970091B75B"
BuildableName = "mParticle_Apptimize.framework"
BlueprintName = "mParticle-Apptimize"
ReferencedContainer = "container:mParticle-Apptimize.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D37EFA9324F43B970091B75B"
BuildableName = "mParticle_Apptimize.framework"
BlueprintName = "mParticle-Apptimize"
ReferencedContainer = "container:mParticle-Apptimize.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
6 changes: 5 additions & 1 deletion mParticle-Apptimize/MPKitApptimize.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#import "MPKitApptimize.h"
#import <Apptimize/Apptimize.h>
#if defined(__has_include) && __has_include(<Apptimize/Apptimize.h>)
#import <Apptimize/Apptimize.h>
#else
#import "Apptimize.h"
#endif

@interface MPKitApptimize()
@property (nonatomic, unsafe_unretained) BOOL started;
Expand Down
8 changes: 2 additions & 6 deletions mParticle-Apptimize/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict/>
</array>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict/>
</array>
<array/>
</dict>
</plist>
7 changes: 5 additions & 2 deletions mParticle-Apptimize/mParticle_Apptimize.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ FOUNDATION_EXPORT double mParticle_ApptimizeVersionNumber;
//! Project version string for mParticle_Apptimize.
FOUNDATION_EXPORT const unsigned char mParticle_ApptimizeVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <mParticle_Apptimize/PublicHeader.h>
#import <mParticle_Apptimize/MPKitApptimize.h>
#if defined(__has_include) && __has_include(<mParticle_Apptimize/MPKitApptimize.h>)
#import <mParticle_Apptimize/MPKitApptimize.h>
#else
#import "MPKitApptimize.h"
#endif

0 comments on commit 3ba18d3

Please sign in to comment.