From 6898a63e8d72e1e5494c733535befc1f87ede9c3 Mon Sep 17 00:00:00 2001 From: Ben Baron Date: Mon, 13 Jun 2022 12:04:34 -0500 Subject: [PATCH] M1 support and update Leanplum framework (#19) * Latest Leanplum SDK and fix M1 simulator support * Updated kit project to use xcframeworks * Update Carthage example app to use xcframeworks * Fix SPM issues with latest dependencies --- Cartfile | 2 +- Examples/Carthage/Cartfile | 2 +- .../project.pbxproj | 111 +++++++++--------- .../AppDelegate.swift | 2 +- Package.swift | 8 +- README.md | 6 +- mParticle-Leanplum.podspec | 9 +- mParticle-Leanplum.xcodeproj/project.pbxproj | 59 ++++++---- mParticle-Leanplum/File.swift | 6 + mParticle-Leanplum/MPKitLeanplum.m | 4 +- mParticle-Leanplum/mParticle_Leanplum.h | 6 +- 11 files changed, 119 insertions(+), 96 deletions(-) create mode 100644 mParticle-Leanplum/File.swift diff --git a/Cartfile b/Cartfile index 5d1e67d..23b1c58 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "leanplum/leanplum-ios-sdk" ~> 3.1 +github "leanplum/leanplum-ios-sdk" ~> 4.1 github "mparticle/mparticle-apple-sdk" ~> 8.0 diff --git a/Examples/Carthage/Cartfile b/Examples/Carthage/Cartfile index 48a84f2..865b996 100644 --- a/Examples/Carthage/Cartfile +++ b/Examples/Carthage/Cartfile @@ -1 +1 @@ -github "mparticle-integrations/mparticle-apple-integration-leanplum" ~> 7.0.0 +github "mparticle-integrations/mparticle-apple-integration-leanplum" ~> 8.0.0 diff --git a/Examples/Carthage/mParticle-Leanplum-Example.xcodeproj/project.pbxproj b/Examples/Carthage/mParticle-Leanplum-Example.xcodeproj/project.pbxproj index 7004509..fc50a84 100644 --- a/Examples/Carthage/mParticle-Leanplum-Example.xcodeproj/project.pbxproj +++ b/Examples/Carthage/mParticle-Leanplum-Example.xcodeproj/project.pbxproj @@ -3,10 +3,16 @@ archiveVersion = 1; classes = { }; - objectVersion = 48; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ + 535B24B528579D79003141C8 /* Leanplum.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 535B24AF28579D39003141C8 /* Leanplum.xcframework */; }; + 535B24B628579D79003141C8 /* Leanplum.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 535B24AF28579D39003141C8 /* Leanplum.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 535B24B728579D7A003141C8 /* mParticle_Apple_SDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 535B24B028579D39003141C8 /* mParticle_Apple_SDK.xcframework */; }; + 535B24B828579D7B003141C8 /* mParticle_Apple_SDK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 535B24B028579D39003141C8 /* mParticle_Apple_SDK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 535B24B928579D7C003141C8 /* mParticle_Leanplum.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 535B24B128579D39003141C8 /* mParticle_Leanplum.xcframework */; }; + 535B24BA28579D7C003141C8 /* mParticle_Leanplum.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 535B24B128579D39003141C8 /* mParticle_Leanplum.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; DBFA61E21F9ECB8F003A3ED8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBFA61E11F9ECB8F003A3ED8 /* AppDelegate.swift */; }; DBFA61E41F9ECB8F003A3ED8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBFA61E31F9ECB8F003A3ED8 /* ViewController.swift */; }; DBFA61E71F9ECB8F003A3ED8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DBFA61E51F9ECB8F003A3ED8 /* Main.storyboard */; }; @@ -14,12 +20,6 @@ DBFA61EC1F9ECB8F003A3ED8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DBFA61EA1F9ECB8F003A3ED8 /* LaunchScreen.storyboard */; }; DBFA61F71F9ECB90003A3ED8 /* mParticle_Leanplum_ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBFA61F61F9ECB90003A3ED8 /* mParticle_Leanplum_ExampleTests.swift */; }; DBFA62021F9ECB90003A3ED8 /* mParticle_Leanplum_ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBFA62011F9ECB90003A3ED8 /* mParticle_Leanplum_ExampleUITests.swift */; }; - DBFA62171F9ECE4C003A3ED8 /* Leanplum.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBFA62111F9ECE42003A3ED8 /* Leanplum.framework */; }; - DBFA62181F9ECE4C003A3ED8 /* Leanplum.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DBFA62111F9ECE42003A3ED8 /* Leanplum.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - DBFA62191F9ECE4C003A3ED8 /* mParticle_Apple_SDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBFA62131F9ECE42003A3ED8 /* mParticle_Apple_SDK.framework */; }; - DBFA621A1F9ECE4C003A3ED8 /* mParticle_Apple_SDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DBFA62131F9ECE42003A3ED8 /* mParticle_Apple_SDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - DBFA621B1F9ECE4C003A3ED8 /* mParticle_Leanplum.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBFA62121F9ECE42003A3ED8 /* mParticle_Leanplum.framework */; }; - DBFA621C1F9ECE4C003A3ED8 /* mParticle_Leanplum.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DBFA62121F9ECE42003A3ED8 /* mParticle_Leanplum.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -46,9 +46,9 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - DBFA621C1F9ECE4C003A3ED8 /* mParticle_Leanplum.framework in Embed Frameworks */, - DBFA621A1F9ECE4C003A3ED8 /* mParticle_Apple_SDK.framework in Embed Frameworks */, - DBFA62181F9ECE4C003A3ED8 /* Leanplum.framework in Embed Frameworks */, + 535B24B628579D79003141C8 /* Leanplum.xcframework in Embed Frameworks */, + 535B24BA28579D7C003141C8 /* mParticle_Leanplum.xcframework in Embed Frameworks */, + 535B24B828579D7B003141C8 /* mParticle_Apple_SDK.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -56,6 +56,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 535B24AF28579D39003141C8 /* Leanplum.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Leanplum.xcframework; path = Carthage/Build/Leanplum.xcframework; sourceTree = ""; }; + 535B24B028579D39003141C8 /* mParticle_Apple_SDK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = mParticle_Apple_SDK.xcframework; path = Carthage/Build/mParticle_Apple_SDK.xcframework; sourceTree = ""; }; + 535B24B128579D39003141C8 /* mParticle_Leanplum.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = mParticle_Leanplum.xcframework; path = Carthage/Build/mParticle_Leanplum.xcframework; sourceTree = ""; }; DBFA61DE1F9ECB8F003A3ED8 /* mParticle-Leanplum-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "mParticle-Leanplum-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; DBFA61E11F9ECB8F003A3ED8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; DBFA61E31F9ECB8F003A3ED8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -69,9 +72,6 @@ DBFA61FD1F9ECB90003A3ED8 /* mParticle-Leanplum-ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mParticle-Leanplum-ExampleUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; DBFA62011F9ECB90003A3ED8 /* mParticle_Leanplum_ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = mParticle_Leanplum_ExampleUITests.swift; sourceTree = ""; }; DBFA62031F9ECB90003A3ED8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - DBFA62111F9ECE42003A3ED8 /* Leanplum.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Leanplum.framework; path = Carthage/Build/iOS/Leanplum.framework; sourceTree = ""; }; - DBFA62121F9ECE42003A3ED8 /* mParticle_Leanplum.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mParticle_Leanplum.framework; path = Carthage/Build/iOS/mParticle_Leanplum.framework; sourceTree = ""; }; - DBFA62131F9ECE42003A3ED8 /* mParticle_Apple_SDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mParticle_Apple_SDK.framework; path = Carthage/Build/iOS/mParticle_Apple_SDK.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -79,9 +79,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DBFA621B1F9ECE4C003A3ED8 /* mParticle_Leanplum.framework in Frameworks */, - DBFA62191F9ECE4C003A3ED8 /* mParticle_Apple_SDK.framework in Frameworks */, - DBFA62171F9ECE4C003A3ED8 /* Leanplum.framework in Frameworks */, + 535B24B528579D79003141C8 /* Leanplum.xcframework in Frameworks */, + 535B24B928579D7C003141C8 /* mParticle_Leanplum.xcframework in Frameworks */, + 535B24B728579D7A003141C8 /* mParticle_Apple_SDK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -157,9 +157,9 @@ DBFA62101F9ECD49003A3ED8 /* Frameworks */ = { isa = PBXGroup; children = ( - DBFA62111F9ECE42003A3ED8 /* Leanplum.framework */, - DBFA62131F9ECE42003A3ED8 /* mParticle_Apple_SDK.framework */, - DBFA62121F9ECE42003A3ED8 /* mParticle_Leanplum.framework */, + 535B24AF28579D39003141C8 /* Leanplum.xcframework */, + 535B24B028579D39003141C8 /* mParticle_Apple_SDK.xcframework */, + 535B24B128579D39003141C8 /* mParticle_Leanplum.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -175,7 +175,6 @@ DBFA61DB1F9ECB8F003A3ED8 /* Frameworks */, DBFA61DC1F9ECB8F003A3ED8 /* Resources */, DBFA621D1F9ECE4C003A3ED8 /* Embed Frameworks */, - DBFA621E1F9ECE7E003A3ED8 /* ShellScript */, ); buildRules = ( ); @@ -295,28 +294,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - DBFA621E1F9ECE7E003A3ED8 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/Carthage/Build/iOS/Leanplum.framework", - "$(SRCROOT)/Carthage/Build/iOS/mParticle_Leanplum.framework", - "$(SRCROOT)/Carthage/Build/iOS/mParticle_Apple_SDK.framework", - ); - outputPaths = ( - "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Leanplum.framework", - "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/mParticle_Leanplum.framework", - "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/mParticle_Apple_SDK.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/usr/local/bin/carthage copy-frameworks"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ DBFA61DA1F9ECB8F003A3ED8 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -432,6 +409,8 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VALIDATE_WORKSPACE = YES; }; name = Debug; }; @@ -480,8 +459,10 @@ IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + VALIDATE_WORKSPACE = YES; }; name = Release; }; @@ -494,12 +475,15 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)/Carthage/Build/iOS/Static", ); INFOPLIST_FILE = "mParticle-Leanplum-Example/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.example.kit.leanplum.mParticle-Leanplum-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -513,12 +497,15 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", + "$(PROJECT_DIR)/Carthage/Build/iOS/Static", ); INFOPLIST_FILE = "mParticle-Leanplum-Example/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.example.kit.leanplum.mParticle-Leanplum-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -531,10 +518,13 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 9RE44VD454; INFOPLIST_FILE = "mParticle-Leanplum-ExampleTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.example.kit.leanplum.mParticle-Leanplum-ExampleTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mParticle-Leanplum-Example.app/mParticle-Leanplum-Example"; }; @@ -548,10 +538,13 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 9RE44VD454; INFOPLIST_FILE = "mParticle-Leanplum-ExampleTests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.example.kit.leanplum.mParticle-Leanplum-ExampleTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/mParticle-Leanplum-Example.app/mParticle-Leanplum-Example"; }; @@ -564,10 +557,13 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 9RE44VD454; INFOPLIST_FILE = "mParticle-Leanplum-ExampleUITests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.example.kit.leanplum.mParticle-Leanplum-ExampleUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = "mParticle-Leanplum-Example"; }; @@ -580,10 +576,13 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 9RE44VD454; INFOPLIST_FILE = "mParticle-Leanplum-ExampleUITests/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.example.kit.leanplum.mParticle-Leanplum-ExampleUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_TARGET_NAME = "mParticle-Leanplum-Example"; }; diff --git a/Examples/Carthage/mParticle-Leanplum-Example/AppDelegate.swift b/Examples/Carthage/mParticle-Leanplum-Example/AppDelegate.swift index 23e32f5..8eaf4d2 100644 --- a/Examples/Carthage/mParticle-Leanplum-Example/AppDelegate.swift +++ b/Examples/Carthage/mParticle-Leanplum-Example/AppDelegate.swift @@ -7,7 +7,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. let options = MParticleOptions(key: "REPLACEME", secret: "REPLACEME") MParticle.sharedInstance().start(with: options) diff --git a/Package.swift b/Package.swift index c1b6c26..3684d1a 100644 --- a/Package.swift +++ b/Package.swift @@ -15,13 +15,17 @@ let package = Package( .upToNextMajor(from: "8.7.0")), .package(name: "Leanplum", url: "https://github.com/leanplum/leanplum-ios-sdk", - .upToNextMajor(from: "3.1.0")), + .upToNextMajor(from: "4.1.0")), ], targets: [ .target( name: "mParticle-Leanplum", dependencies: ["mParticle-Apple-SDK","Leanplum"], path: "mParticle-Leanplum", - publicHeadersPath: "."), + exclude: ["File.swift", "Info.plist"], + publicHeadersPath: ".", + cSettings: [ + .headerSearchPath("."), + ]), ] ) diff --git a/README.md b/README.md index 31189d7..d2904e9 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ This repository contains the [Leanplum](https://www.leanplum.com) integration fo ### Adding the integration -1. Add the kit dependency to your app's Podfile or Cartfile: +1. Add the kit dependency via SPM or add to your app's Podfile or Cartfile: ``` - pod 'mParticle-Leanplum', '~> 7.0' + pod 'mParticle-Leanplum', '~> 8.0' ``` OR ``` - github "mparticle-integrations/mparticle-apple-integration-leanplum" ~> 7.0 + github "mparticle-integrations/mparticle-apple-integration-leanplum" ~> 8.0 ``` 2. Follow the mParticle iOS SDK [quick-start](https://github.com/mParticle/mparticle-apple-sdk), then rebuild and launch your app, and verify that you see `"Included kits: { Leanplum }"` in your Xcode console diff --git a/mParticle-Leanplum.podspec b/mParticle-Leanplum.podspec index f555014..72e0813 100755 --- a/mParticle-Leanplum.podspec +++ b/mParticle-Leanplum.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "mParticle-Leanplum" - s.version = "8.0.3" + s.version = "8.2.0" s.summary = "Leanplum integration for mParticle" s.description = <<-DESC @@ -16,14 +16,11 @@ Pod::Spec.new do |s| s.ios.deployment_target = "9.0" s.ios.source_files = 'mParticle-Leanplum/*.{h,m,mm}' s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.0' - s.ios.dependency 'Leanplum-iOS-SDK', '~> 3.1' + s.ios.dependency 'Leanplum-iOS-SDK', '~> 4.1' s.ios.frameworks = 'CFNetwork', 'SystemConfiguration', 'Security', 'CoreLocation', 'StoreKit' s.ios.weak_frameworks = 'AdSupport' s.ios.pod_target_xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) $(PODS_ROOT)/Leanplum-iOS-SDK/**', - 'OTHER_LDFLAGS' => '$(inherited) -framework "Leanplum"', - 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' + 'OTHER_LDFLAGS' => '$(inherited) -framework "Leanplum"' } - s.ios.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' } - end diff --git a/mParticle-Leanplum.xcodeproj/project.pbxproj b/mParticle-Leanplum.xcodeproj/project.pbxproj index faec808..24f4200 100644 --- a/mParticle-Leanplum.xcodeproj/project.pbxproj +++ b/mParticle-Leanplum.xcodeproj/project.pbxproj @@ -3,25 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ + 535B24AC285798AF003141C8 /* Leanplum.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 535B24AB285798AF003141C8 /* Leanplum.xcframework */; }; + 535B24AE285798B5003141C8 /* mParticle_Apple_SDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 535B24AD285798B5003141C8 /* mParticle_Apple_SDK.xcframework */; }; + 537FB0E0284AB1BF0097D765 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 537FB0DF284AB1BF0097D765 /* File.swift */; }; DB7E05A61CB819D300967FDF /* MPKitLeanplum.h in Headers */ = {isa = PBXBuildFile; fileRef = DB7E05A41CB819D300967FDF /* MPKitLeanplum.h */; settings = {ATTRIBUTES = (Public, ); }; }; DB7E05A71CB819D300967FDF /* MPKitLeanplum.m in Sources */ = {isa = PBXBuildFile; fileRef = DB7E05A51CB819D300967FDF /* MPKitLeanplum.m */; }; DB9401701CB703F2007ABB18 /* mParticle_Leanplum.h in Headers */ = {isa = PBXBuildFile; fileRef = DB94016F1CB703F2007ABB18 /* mParticle_Leanplum.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DB94017A1CB70C58007ABB18 /* mParticle_Apple_SDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB9401781CB70C58007ABB18 /* mParticle_Apple_SDK.framework */; }; - DBFA61961F9EC86C003A3ED8 /* Leanplum.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBFA61951F9EC86C003A3ED8 /* Leanplum.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 535B24AB285798AF003141C8 /* Leanplum.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Leanplum.xcframework; path = Carthage/Build/Leanplum.xcframework; sourceTree = ""; }; + 535B24AD285798B5003141C8 /* mParticle_Apple_SDK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = mParticle_Apple_SDK.xcframework; path = Carthage/Build/mParticle_Apple_SDK.xcframework; sourceTree = ""; }; + 537FB0DF284AB1BF0097D765 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; DB7E05A41CB819D300967FDF /* MPKitLeanplum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPKitLeanplum.h; sourceTree = ""; }; DB7E05A51CB819D300967FDF /* MPKitLeanplum.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPKitLeanplum.m; sourceTree = ""; }; DB94016C1CB703F2007ABB18 /* mParticle_Leanplum.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = mParticle_Leanplum.framework; sourceTree = BUILT_PRODUCTS_DIR; }; DB94016F1CB703F2007ABB18 /* mParticle_Leanplum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mParticle_Leanplum.h; sourceTree = ""; }; DB9401711CB703F2007ABB18 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - DB9401781CB70C58007ABB18 /* mParticle_Apple_SDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mParticle_Apple_SDK.framework; path = Carthage/Build/iOS/mParticle_Apple_SDK.framework; sourceTree = ""; }; - DBFA61951F9EC86C003A3ED8 /* Leanplum.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Leanplum.framework; path = Carthage/Build/iOS/Leanplum.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -29,8 +31,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DB94017A1CB70C58007ABB18 /* mParticle_Apple_SDK.framework in Frameworks */, - DBFA61961F9EC86C003A3ED8 /* Leanplum.framework in Frameworks */, + 535B24AC285798AF003141C8 /* Leanplum.xcframework in Frameworks */, + 535B24AE285798B5003141C8 /* mParticle_Apple_SDK.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -61,6 +63,7 @@ DB7E05A51CB819D300967FDF /* MPKitLeanplum.m */, DB94016F1CB703F2007ABB18 /* mParticle_Leanplum.h */, DB9401711CB703F2007ABB18 /* Info.plist */, + 537FB0DF284AB1BF0097D765 /* File.swift */, ); path = "mParticle-Leanplum"; sourceTree = ""; @@ -68,8 +71,8 @@ DBBE32AB1E09CA41008DDECB /* Frameworks */ = { isa = PBXGroup; children = ( - DBFA61951F9EC86C003A3ED8 /* Leanplum.framework */, - DB9401781CB70C58007ABB18 /* mParticle_Apple_SDK.framework */, + 535B24AD285798B5003141C8 /* mParticle_Apple_SDK.xcframework */, + 535B24AB285798AF003141C8 /* Leanplum.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -119,6 +122,7 @@ DB94016B1CB703F2007ABB18 = { CreatedOnToolsVersion = 7.3; DevelopmentTeam = Q948K5LXGZ; + LastSwiftMigration = 1330; }; }; }; @@ -127,6 +131,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = DB9401621CB703F2007ABB18; @@ -155,6 +160,7 @@ buildActionMask = 2147483647; files = ( DB7E05A71CB819D300967FDF /* MPKitLeanplum.m in Sources */, + 537FB0E0284AB1BF0097D765 /* File.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -201,7 +207,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -246,7 +252,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -259,44 +265,51 @@ DB9401751CB703F2007ABB18 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); INFOPLIST_FILE = "mParticle-Leanplum/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.mParticle-Leanplum"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; DB9401761CB703F2007ABB18 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); INFOPLIST_FILE = "mParticle-Leanplum/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.mParticle-Leanplum"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/mParticle-Leanplum/File.swift b/mParticle-Leanplum/File.swift new file mode 100644 index 0000000..5f2db88 --- /dev/null +++ b/mParticle-Leanplum/File.swift @@ -0,0 +1,6 @@ +// NOTE: This file only exists to fix compatibility with Carthage. Without any Swift files, +// Xcode will fail to link to the Swift frameworks. This doesn't affect projects using +// SPM or Cocoapods, as the Swift files in the Leanplum framework are compiled with +// the project. With Carthage, since the framework is compiled separately, Xcode +// doesn't recognize that it needs to link to Swift (this appears to be an Xcode bug). +import Foundation diff --git a/mParticle-Leanplum/MPKitLeanplum.m b/mParticle-Leanplum/MPKitLeanplum.m index 2d594d3..b94ae48 100644 --- a/mParticle-Leanplum/MPKitLeanplum.m +++ b/mParticle-Leanplum/MPKitLeanplum.m @@ -159,10 +159,10 @@ - (MPKitExecStatus *)onUserIdentified:(NSNotification*) notification { return [[MPKitExecStatus alloc] initWithSDKCode:[[self class] kitCode] returnCode:MPKitReturnCodeFail]; } } - + #pragma mark Application - (MPKitExecStatus *)handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo { - [Leanplum handleActionWithIdentifier:identifier forRemoteNotification:userInfo completionHandler:^(LeanplumUIBackgroundFetchResult result){ + [Leanplum handleActionWithIdentifier:identifier forRemoteNotification:userInfo completionHandler:^(UIBackgroundFetchResult result){ }]; MPKitExecStatus *execStatus = [[MPKitExecStatus alloc] initWithSDKCode:@(MPKitInstanceLeanplum) returnCode:MPKitReturnCodeSuccess]; diff --git a/mParticle-Leanplum/mParticle_Leanplum.h b/mParticle-Leanplum/mParticle_Leanplum.h index f555386..2519927 100644 --- a/mParticle-Leanplum/mParticle_Leanplum.h +++ b/mParticle-Leanplum/mParticle_Leanplum.h @@ -8,4 +8,8 @@ FOUNDATION_EXPORT const unsigned char mParticle_LeanplumVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import -#import +#if defined(__has_include) && __has_include() + #import +#else + #import "MPKitLeanplum.h" +#endif