Skip to content

Commit

Permalink
feat: Add SPM and Improve Privacy Manifest support (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
einsteinx2 authored May 7, 2024
1 parent bea72da commit 2a57aa4
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 155 deletions.
1 change: 1 addition & 0 deletions .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
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
binary "https://downloads.localytics.com/SDKs/iOS/Localytics.json" ~> 6.0
github "mparticle/mparticle-apple-sdk" ~> 8.0
binary "https://downloads.localytics.com/SDKs/iOS/Localytics.json" ~> 6.3
binary "https://raw.githubusercontent.com/mParticle/mparticle-apple-sdk/main/mParticle_Apple_SDK.json" ~> 8.22
29 changes: 29 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "mParticle-Localytics",
platforms: [ .iOS(.v9) ],
products: [
.library(
name: "mParticle-Localytics",
targets: ["mParticle_Localytics"]),
],
dependencies: [
.package(name: "mParticle-Apple-SDK",
url: "https://github.com/mParticle/mparticle-apple-sdk",
.upToNextMajor(from: "8.22.0")),
.package(name: "Localytics",
url: "https://github.com/localytics/Localytics-swiftpm",
.upToNextMajor(from: "6.3.0")),
],
targets: [
.target(
name: "mParticle_Localytics",
dependencies: ["mParticle-Apple-SDK", "Localytics"],
path: "mParticle-Localytics",
exclude: ["Info.plist"],
resources: [.process("PrivacyInfo.xcprivacy")],
publicHeadersPath: "."
),
]
)
3 changes: 2 additions & 1 deletion mParticle-Localytics.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Pod::Spec.new do |s|

s.ios.deployment_target = "9.0"
s.ios.source_files = 'mParticle-Localytics/*.{h,m,mm}'
s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.19'
s.ios.resource_bundles = { 'mParticle-Localytics-Privacy' => ['mParticle-Localytics/PrivacyInfo.xcprivacy'] }
s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.22'
s.ios.dependency 'Localytics', '~> 6.3'
end
127 changes: 13 additions & 114 deletions mParticle-Localytics.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,83 +3,36 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 60;
objects = {

/* Begin PBXBuildFile section */
536B2B4F2BEACB0D00BD3217 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 536B2B4E2BEACB0D00BD3217 /* PrivacyInfo.xcprivacy */; };
536B2B522BEACB2900BD3217 /* mParticle_Apple_SDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 536B2B502BEACB2900BD3217 /* mParticle_Apple_SDK.xcframework */; };
536B2B532BEACB2900BD3217 /* Localytics.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 536B2B512BEACB2900BD3217 /* Localytics.xcframework */; };
D318FFC72121D37D00F41C55 /* MPKitLocalytics.h in Headers */ = {isa = PBXBuildFile; fileRef = D318FFC52121D37D00F41C55 /* MPKitLocalytics.h */; settings = {ATTRIBUTES = (Public, ); }; };
D318FFC82121D37D00F41C55 /* MPKitLocalytics.m in Sources */ = {isa = PBXBuildFile; fileRef = D318FFC62121D37D00F41C55 /* MPKitLocalytics.m */; };
D318FFDD2121D82700F41C55 /* Localytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D318FFDB2121D82700F41C55 /* Localytics.framework */; };
D318FFDE2121D82700F41C55 /* mParticle_Apple_SDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D318FFDC2121D82700F41C55 /* mParticle_Apple_SDK.framework */; };
D318FFE12121DA4200F41C55 /* mParticle_Localytics.h in Headers */ = {isa = PBXBuildFile; fileRef = D318FFE02121DA4200F41C55 /* mParticle_Localytics.h */; settings = {ATTRIBUTES = (Public, ); }; };
D318FFE32121DAD200F41C55 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D318FFE22121DAD200F41C55 /* AdSupport.framework */; };
D318FFE52121DAE200F41C55 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D318FFE42121DAE200F41C55 /* libsqlite3.tbd */; };
D318FFE72121DAF600F41C55 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D318FFE62121DAF600F41C55 /* libz.tbd */; };
D318FFE92121DB0600F41C55 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D318FFE82121DB0600F41C55 /* CoreLocation.framework */; };
D318FFEB2121DB1400F41C55 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D318FFEA2121DB1400F41C55 /* SystemConfiguration.framework */; };
D3D1C6B62BC8D64700ACFCAA /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D3D1C6B52BC8D64700ACFCAA /* PrivacyInfo.xcprivacy */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
D318FFD22121D78400F41C55 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D318FFCB2121D78300F41C55 /* mParticle-Apple-SDK.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C9DD1DFF1D8A118400D3ABBE;
remoteInfo = "mParticle-iOS-SDK";
};
D318FFD42121D78400F41C55 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D318FFCB2121D78300F41C55 /* mParticle-Apple-SDK.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C935A6B31D8A2B6B00A1EE2F;
remoteInfo = "mParticle-tvOS-SDK";
};
D318FFD62121D78400F41C55 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D318FFCB2121D78300F41C55 /* mParticle-Apple-SDK.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C9DD20851D8A18F500D3ABBE;
remoteInfo = mParticle_iOS_SDKTests;
};
D318FFD82121D78400F41C55 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D318FFCB2121D78300F41C55 /* mParticle-Apple-SDK.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C911FD7C1D8A3524002A3516;
remoteInfo = mParticle_tvOS_SDKTests;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
536B2B4E2BEACB0D00BD3217 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
536B2B502BEACB2900BD3217 /* 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>"; };
536B2B512BEACB2900BD3217 /* Localytics.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Localytics.xcframework; path = Carthage/Build/Localytics.xcframework; sourceTree = "<group>"; };
D318FFBA2121D2FF00F41C55 /* mParticle_Localytics.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = mParticle_Localytics.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D318FFBE2121D2FF00F41C55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D318FFC52121D37D00F41C55 /* MPKitLocalytics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPKitLocalytics.h; sourceTree = "<group>"; };
D318FFC62121D37D00F41C55 /* MPKitLocalytics.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPKitLocalytics.m; sourceTree = "<group>"; };
D318FFCB2121D78300F41C55 /* mParticle-Apple-SDK.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "mParticle-Apple-SDK.xcodeproj"; path = "Carthage/Checkouts/mparticle-apple-sdk/mParticle-Apple-SDK.xcodeproj"; sourceTree = "<group>"; };
D318FFDB2121D82700F41C55 /* Localytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Localytics.framework; path = Carthage/Build/iOS/Localytics.framework; sourceTree = "<group>"; };
D318FFDC2121D82700F41C55 /* mParticle_Apple_SDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mParticle_Apple_SDK.framework; path = Carthage/Build/iOS/mParticle_Apple_SDK.framework; sourceTree = "<group>"; };
D318FFE02121DA4200F41C55 /* mParticle_Localytics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mParticle_Localytics.h; sourceTree = "<group>"; };
D318FFE22121DAD200F41C55 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
D318FFE42121DAE200F41C55 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
D318FFE62121DAF600F41C55 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
D318FFE82121DB0600F41C55 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
D318FFEA2121DB1400F41C55 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
D3D1C6B52BC8D64700ACFCAA /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
D318FFB62121D2FF00F41C55 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D318FFEB2121DB1400F41C55 /* SystemConfiguration.framework in Frameworks */,
D318FFE92121DB0600F41C55 /* CoreLocation.framework in Frameworks */,
D318FFE72121DAF600F41C55 /* libz.tbd in Frameworks */,
D318FFE52121DAE200F41C55 /* libsqlite3.tbd in Frameworks */,
D318FFE32121DAD200F41C55 /* AdSupport.framework in Frameworks */,
D318FFDD2121D82700F41C55 /* Localytics.framework in Frameworks */,
D318FFDE2121D82700F41C55 /* mParticle_Apple_SDK.framework in Frameworks */,
536B2B532BEACB2900BD3217 /* Localytics.xcframework in Frameworks */,
536B2B522BEACB2900BD3217 /* mParticle_Apple_SDK.xcframework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -89,7 +42,6 @@
D318FFB02121D2FF00F41C55 = {
isa = PBXGroup;
children = (
D3D1C6B52BC8D64700ACFCAA /* PrivacyInfo.xcprivacy */,
D318FFBC2121D2FF00F41C55 /* mParticle-Localytics */,
D318FFBB2121D2FF00F41C55 /* Products */,
D318FFCA2121D78300F41C55 /* Frameworks */,
Expand All @@ -110,6 +62,7 @@
D318FFC52121D37D00F41C55 /* MPKitLocalytics.h */,
D318FFC62121D37D00F41C55 /* MPKitLocalytics.m */,
D318FFE02121DA4200F41C55 /* mParticle_Localytics.h */,
536B2B4E2BEACB0D00BD3217 /* PrivacyInfo.xcprivacy */,
D318FFBE2121D2FF00F41C55 /* Info.plist */,
);
path = "mParticle-Localytics";
Expand All @@ -118,29 +71,12 @@
D318FFCA2121D78300F41C55 /* Frameworks */ = {
isa = PBXGroup;
children = (
D318FFEA2121DB1400F41C55 /* SystemConfiguration.framework */,
D318FFE82121DB0600F41C55 /* CoreLocation.framework */,
D318FFE62121DAF600F41C55 /* libz.tbd */,
D318FFE42121DAE200F41C55 /* libsqlite3.tbd */,
D318FFE22121DAD200F41C55 /* AdSupport.framework */,
D318FFDB2121D82700F41C55 /* Localytics.framework */,
D318FFDC2121D82700F41C55 /* mParticle_Apple_SDK.framework */,
D318FFCB2121D78300F41C55 /* mParticle-Apple-SDK.xcodeproj */,
536B2B512BEACB2900BD3217 /* Localytics.xcframework */,
536B2B502BEACB2900BD3217 /* mParticle_Apple_SDK.xcframework */,
);
name = Frameworks;
sourceTree = "<group>";
};
D318FFCC2121D78300F41C55 /* Products */ = {
isa = PBXGroup;
children = (
D318FFD32121D78400F41C55 /* mParticle_Apple_SDK.framework */,
D318FFD52121D78400F41C55 /* mParticle_Apple_SDK.framework */,
D318FFD72121D78400F41C55 /* mParticle_iOS_SDKTests.xctest */,
D318FFD92121D78400F41C55 /* mParticle_tvOS_SDKTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -199,56 +135,19 @@
mainGroup = D318FFB02121D2FF00F41C55;
productRefGroup = D318FFBB2121D2FF00F41C55 /* Products */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = D318FFCC2121D78300F41C55 /* Products */;
ProjectRef = D318FFCB2121D78300F41C55 /* mParticle-Apple-SDK.xcodeproj */;
},
);
projectRoot = "";
targets = (
D318FFB92121D2FF00F41C55 /* mParticle-Localytics */,
);
};
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
D318FFD32121D78400F41C55 /* mParticle_Apple_SDK.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = mParticle_Apple_SDK.framework;
remoteRef = D318FFD22121D78400F41C55 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D318FFD52121D78400F41C55 /* mParticle_Apple_SDK.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = mParticle_Apple_SDK.framework;
remoteRef = D318FFD42121D78400F41C55 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D318FFD72121D78400F41C55 /* mParticle_iOS_SDKTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = mParticle_iOS_SDKTests.xctest;
remoteRef = D318FFD62121D78400F41C55 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D318FFD92121D78400F41C55 /* mParticle_tvOS_SDKTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = mParticle_tvOS_SDKTests.xctest;
remoteRef = D318FFD82121D78400F41C55 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
D318FFB82121D2FF00F41C55 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D3D1C6B62BC8D64700ACFCAA /* PrivacyInfo.xcprivacy in Resources */,
536B2B4F2BEACB0D00BD3217 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
22 changes: 4 additions & 18 deletions mParticle-Localytics/MPKitLocalytics.m
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
#import "MPKitLocalytics.h"
#import <CoreLocation/CoreLocation.h>
#ifdef COCOAPODS
#import "MPEvent.h"
#import "MPCommerceEvent.h"
#import "MPCommerceEvent+Dictionary.h"
#import "MPCommerceEventInstruction.h"
#import "MPTransactionAttributes.h"
#import "MPTransactionAttributes+Dictionary.h"
#import "MPProduct.h"
#import "MPProduct+Dictionary.h"
#import "mParticle.h"
#import "MPKitRegister.h"
#endif

#import <Localytics/Localytics.h>

#if TARGET_OS_IOS == 1 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
#import <UserNotifications/UserNotifications.h>
#import <UserNotifications/UNUserNotificationCenter.h>
#if defined(__has_include) && __has_include(<Localytics/Localytics.h>)
#import <Localytics/Localytics.h>
#else
#import "Localytics.h"
#endif

@interface MPKitLocalytics() {
Expand Down
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>
6 changes: 5 additions & 1 deletion mParticle-Localytics/mParticle_Localytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ FOUNDATION_EXPORT const unsigned char mParticle_LocalyticsVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <mParticle_Localytics/PublicHeader.h>

#import <mParticle_Localytics/MPKitLocalytics.h>
#if defined(__has_include) && __has_include(<mParticle_Localytics/MPKitLocalytics.h>)
#import <mParticle_Localytics/MPKitLocalytics.h>
#else
#import "MPKitLocalytics.h"
#endif
13 changes: 0 additions & 13 deletions mParticle_Localytics.json

This file was deleted.

0 comments on commit 2a57aa4

Please sign in to comment.