Changes for Swift API of iOS SDK 4.0.3¶
In order to remove misleading method names, all Swift API method names should now get correctly translated from Objective-C to Swift. Please refer to the development guide or the renaming table below.
API until now |
API from now on |
---|---|
Repro.optIn(true) |
Repro.optIn(endUserOptedIn: true) |
Repro.setup("YOUR_APP_TOKEN") |
Repro.setup(token:"YOUR_APP_TOKEN") |
Repro.setUserID("user_id") |
Repro.set(userID: "user_id") |
Repro.getUserID() |
Repro.userID() |
Repro.getDeviceID() |
Repro.deviceID() |
Repro.setStringUserProfile("green", forKey: "eyecolor") |
Repro.setUserProfile(stringValue: "green", forKey: "eyecolor") |
Repro.setIntUserProfile(30, forKey: "age") |
Repro.setUserProfile(integerValue: 30, forKey: "age") |
Repro.setDoubleUserProfile(40.5, forKey: "shoesize") |
Repro.setUserProfile(doubleValue: 40.5, forKey: "shoesize") |
Repro.setDateUserProfile(NSDate() as Date, forKey: "now") |
Repro.setUserProfile(dateValue: Date(), forKey: "now") |
Repro.setUserGender(.male) |
Repro.setUserProfile(gender: .male) |
Repro.setUserEmailAddress("user@example.com") |
Repro.setUserProfile(emailAddress: "user@example.com") |
Repro.track("trackname", properties: [:]) |
Repro.track(event: "trackname", properties: [:]) |
Repro.startWebViewTracking(self) |
Repro.startWebViewTracking(delegate: self) |
Repro.trackViewContent("contentIDstr", properties: nil) |
Repro.trackViewContentEvent(contentID: "contentIDstr", properties: nil) |
Repro.trackSearch(nil) |
Repro.trackSearchEvent(properties: nil) |
Repro.trackAdd(toCart: "contentIDstr", properties: nil) |
Repro.trackAddToCartEvent(contentID: "contentIDstr", properties: nil) |
Repro.trackAdd(toWishlist: nil) |
Repro.trackAddToWishlistEvent(properties: nil) |
Repro.trackInitiateCheckout(nil) |
Repro.trackInitiateCheckoutEvent(properties: nil) |
Repro.trackAddPaymentInfo(nil) |
Repro.trackAddPaymentInfoEvent(properties: nil) |
Repro.trackPurchase("contentIDstr", value: 3.50, currency: "USD", properties: nil) |
Repro.trackPurchaseEvent(contentID: "contentIDstr", value: 3.50, currency: "USD", properties: nil) |
Repro.trackShare(nil) |
Repro.trackShareEvent(properties: nil) |
Repro.trackCompleteRegistration(nil) |
Repro.trackCompleteRegistrationEvent(properties: nil) |
Repro.trackLead(nil) |
Repro.trackLeadEvent(properties: nil) |
Repro.setLogLevel(.debug) |
Repro.set(logLevel: .debug) |
Repro.setPushDeviceToken(NSData() as Data) |
Repro.setPushDeviceToken(data: Data()) |
Repro.setPushDeviceTokenString("03df25c...") |
Repro.setPushDeviceToken(string: "03df25c...") |
Repro.disableInAppMessageOnActive() |
Repro.disableInAppMessageOnActive() |
Repro.showInAppMessage() |
Repro.showInAppMessage() |