diff --git a/ExampleSwift/ExampleSwift.xcodeproj/project.pbxproj b/ExampleSwift/ExampleSwift.xcodeproj/project.pbxproj index 385beec..0c5cd1c 100644 --- a/ExampleSwift/ExampleSwift.xcodeproj/project.pbxproj +++ b/ExampleSwift/ExampleSwift.xcodeproj/project.pbxproj @@ -21,9 +21,9 @@ 588EB7242995BC3A00C0163A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 588EB7182995BBB700C0163A /* LaunchScreen.storyboard */; }; 588EB7252995BC3A00C0163A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 587DC5C3299554B00082F8D0 /* Assets.xcassets */; }; 588EB7262995BC3A00C0163A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 587DC5C82995551A0082F8D0 /* Main.storyboard */; }; + FB080C772C1CAF5C00834BAA /* ATTNSDKFramework in Frameworks */ = {isa = PBXBuildFile; productRef = FB080C762C1CAF5C00834BAA /* ATTNSDKFramework */; }; FB2F35B62C18D6950016CAE8 /* ATTNSDKFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB2F35B52C18D6950016CAE8 /* ATTNSDKFramework.framework */; }; FB2F35B72C18D6950016CAE8 /* ATTNSDKFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FB2F35B52C18D6950016CAE8 /* ATTNSDKFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - FB6723732C134958008D5516 /* ATTNSDKFramework in Frameworks */ = {isa = PBXBuildFile; productRef = FB6723722C134958008D5516 /* ATTNSDKFramework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -68,7 +68,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - FB6723732C134958008D5516 /* ATTNSDKFramework in Frameworks */, + FB080C772C1CAF5C00834BAA /* ATTNSDKFramework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -169,7 +169,7 @@ ); name = "ExampleSwift - SPM"; packageProductDependencies = ( - FB6723722C134958008D5516 /* ATTNSDKFramework */, + FB080C762C1CAF5C00834BAA /* ATTNSDKFramework */, ); productName = ExampleSwift; productReference = 588EB72C2995BC3A00C0163A /* ExampleSwift - SPM.app */; @@ -200,7 +200,7 @@ ); mainGroup = 58389AA12987647900A31A35; packageReferences = ( - FB6723712C134958008D5516 /* XCRemoteSwiftPackageReference "attentive-ios-sdk" */, + FB080C752C1CAF5B00834BAA /* XCRemoteSwiftPackageReference "attentive-ios-sdk" */, ); productRefGroup = 58389AAB2987647900A31A35 /* Products */; projectDirPath = ""; @@ -600,20 +600,20 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - FB6723712C134958008D5516 /* XCRemoteSwiftPackageReference "attentive-ios-sdk" */ = { + FB080C752C1CAF5B00834BAA /* XCRemoteSwiftPackageReference "attentive-ios-sdk" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/vespinola/attentive-ios-sdk.git"; + repositoryURL = "https://github.com/attentive-mobile/attentive-ios-sdk"; requirement = { - branch = main; - kind = branch; + kind = upToNextMajorVersion; + minimumVersion = 0.6.0; }; }; /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - FB6723722C134958008D5516 /* ATTNSDKFramework */ = { + FB080C762C1CAF5C00834BAA /* ATTNSDKFramework */ = { isa = XCSwiftPackageProductDependency; - package = FB6723712C134958008D5516 /* XCRemoteSwiftPackageReference "attentive-ios-sdk" */; + package = FB080C752C1CAF5B00834BAA /* XCRemoteSwiftPackageReference "attentive-ios-sdk" */; productName = ATTNSDKFramework; }; /* End XCSwiftPackageProductDependency section */ diff --git a/ExampleSwift/ExampleSwift/AppDelegate.swift b/ExampleSwift/ExampleSwift/AppDelegate.swift index 1a5566a..1e62293 100644 --- a/ExampleSwift/ExampleSwift/AppDelegate.swift +++ b/ExampleSwift/ExampleSwift/AppDelegate.swift @@ -39,12 +39,12 @@ class AppDelegate : UIResponder, UIApplicationDelegate { public static func createUserIdentifiers() -> [String: Any] { [ - IDENTIFIER_TYPE_PHONE: "+15671230987", - IDENTIFIER_TYPE_EMAIL: "someemail@email.com", - IDENTIFIER_TYPE_CLIENT_USER_ID: "APP_USER_ID", - IDENTIFIER_TYPE_SHOPIFY_ID: "207119551", - IDENTIFIER_TYPE_KLAVIYO_ID: "555555", - IDENTIFIER_TYPE_CUSTOM_IDENTIFIERS: ["customId": "customIdValue"] + ATTNIdentifierType.phone: "+15671230987", + ATTNIdentifierType.email: "someemail@email.com", + ATTNIdentifierType.clientUserId: "APP_USER_ID", + ATTNIdentifierType.shopifyId: "207119551", + ATTNIdentifierType.klaviyoId: "555555", + ATTNIdentifierType.customIdentifiers: ["customId": "customIdValue"] ] } } diff --git a/ExampleSwift/ExampleSwift/ProductViewController.swift b/ExampleSwift/ExampleSwift/ProductViewController.swift index 61f1780..7762bf2 100644 --- a/ExampleSwift/ExampleSwift/ProductViewController.swift +++ b/ExampleSwift/ExampleSwift/ProductViewController.swift @@ -20,15 +20,15 @@ class ProductViewController : UIViewController { let item : ATTNItem = buildItem() let productView : ATTNProductViewEvent = ATTNProductViewEvent(items: [item]) - ATTNEventTracker.sharedInstance()?.record(productView) - + ATTNEventTracker.sharedInstance()?.record(event: productView) + showToast(message: "Product View event sent") } @IBAction func addToCartBtnPressed(sender: Any) { let item : ATTNItem = self.buildItem() let addToCart : ATTNAddToCartEvent = ATTNAddToCartEvent(items: [item]) - ATTNEventTracker.sharedInstance()?.record(addToCart) + ATTNEventTracker.sharedInstance()?.record(event: addToCart) showToast(message: "Add To Cart event sent") } @@ -41,14 +41,14 @@ class ProductViewController : UIViewController { // Create PurchaseEvent let purchase : ATTNPurchaseEvent = ATTNPurchaseEvent(items: [item], order: order) // Send the PurchaseEvent - ATTNEventTracker.sharedInstance()?.record(purchase) + ATTNEventTracker.sharedInstance()?.record(event: purchase) showToast(message: "Purchase event sent") } @IBAction func customEventBtnPressed(sender: Any) { guard let customEvent = ATTNCustomEvent(type: "Added to Wishlist", properties: ["wishlistName": "Gift Ideas"]) else { return } - ATTNEventTracker.sharedInstance()?.record(customEvent) + ATTNEventTracker.sharedInstance()?.record(event: customEvent) showToast(message: "Custom event sent") } diff --git a/attentive-ios-sdk.xcworkspace/xcshareddata/swiftpm/Package.resolved b/attentive-ios-sdk.xcworkspace/xcshareddata/swiftpm/Package.resolved index 62609f3..40aed93 100644 --- a/attentive-ios-sdk.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/attentive-ios-sdk.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,13 +1,13 @@ { - "originHash" : "6b3de92165125b4410ec54f34acb3ca6e0b8fc849f4bd109516c1eddb59f6bf0", + "originHash" : "62dc5f9606142e259275d938027b59c944959560f934dd2210d0e0cc4420a08d", "pins" : [ { "identity" : "attentive-ios-sdk", "kind" : "remoteSourceControl", - "location" : "https://github.com/vespinola/attentive-ios-sdk.git", + "location" : "https://github.com/attentive-mobile/attentive-ios-sdk", "state" : { - "branch" : "main", - "revision" : "46691f276e02add53c6f6a0af5cd1c13c04c9497" + "revision" : "16ea6c5924b6431d996f38d057b9a55e6639ed03", + "version" : "0.6.0" } } ],