Skip to content

Commit d855514

Browse files
Change api signature from update(xxx) to updateXXX. Change doc accordingly.
1 parent 0bf2435 commit d855514

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Congratulations! You can now send remote push notifications to your device from
148148

149149
* Handling Links from Push Notifications
150150
151-
Push notifications and action buttons may have `openUrl` actions attached to them. When a URL is specified, the SDK first calls `urlDelegate` specified in your `IterableConfig` object. You can use this delegate to handle `openUrl` actions the same way as you handle normal deep links. If the delegate is not set or if it returns `false` (the default), the SDK will open Safari with that URL. If you want to navigate to a UIViewController on receiving a deep link, you should do so in the `urlDelegate`.
151+
Push notifications and action buttons may have `openUrl` actions attached to them. When a URL is specified, the SDK first calls `urlDelegate` specified in your `IterableConfig` object. You can use this delegate to handle `openUrl` actions the same way as you handle normal deep links. If the delegate is not set or if it returns `false` (the default), the SDK will open Safari with that URL. If you want to navigate to a UIViewController on receiving a deep link, you should do so in the `urlDelegate`.
152152
153153
In the code below, `DeepLinkHandler` is a custom handler which is reponsible for deep link navigation. You have to provide implementation for deep link navigation. Please see [sample application](./sample-apps/swift-sample-app/swift-sample-app.xcworkspace) for a reference implementation.
154154
@@ -160,7 +160,7 @@ Congratulations! You can now send remote push notifications to your device from
160160
// Initialize Iterable API
161161
let config = IterableConfig()
162162
...
163-
config.urlDelegate = self
163+
config.urlDelegate = self
164164
IterableAPI.initialize(apiKey: apiKey, launchOptions:launchOptions, config: config)
165165
...
166166
}
@@ -262,7 +262,7 @@ Congratulations! You can now send remote push notifications to your device from
262262
Custom events can be tracked using `IterableAPI.track(event:...)` calls.
263263

264264
5. ##### Updating User Fields
265-
User fields can be modified using `IterableAPI.updateXYZ(...)` calls.
265+
User fields can be modified using `IterableAPI.updateUser` call. You also have `updateEmail` and `updateSubscriptions` methods.
266266

267267
6. ##### Disabling Push Notifications to a Device
268268
When a user logs out, you typically want to disable push notifications to that user/device. This can be accomplished by calling `disableDeviceForCurrentUser`. Please note that it will only attempt to disable the device if you have previously called `registerToken`.

swift-sdk/IterableAPI.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public final class IterableAPI : NSObject {
165165
- seeAlso: OnSuccessHandler
166166
- seeAlso: OnFailureHandler
167167
*/
168-
@objc(updateUser:mergeNestedObjects:onSuccess:onFailure:) public static func update(userDataFields dataFields: [AnyHashable : Any], mergeNestedObjects: Bool, onSuccess: OnSuccessHandler? = nil, onFailure: OnFailureHandler? = nil) {
168+
@objc(updateUser:mergeNestedObjects:onSuccess:onFailure:) public static func updateUser(_ dataFields: [AnyHashable : Any], mergeNestedObjects: Bool, onSuccess: OnSuccessHandler? = nil, onFailure: OnFailureHandler? = nil) {
169169
implementation?.updateUser(dataFields, mergeNestedObjects: mergeNestedObjects, onSuccess: onSuccess, onFailure: onFailure)
170170
}
171171

@@ -182,7 +182,7 @@ public final class IterableAPI : NSObject {
182182
- seeAlso: OnSuccessHandler
183183
- seeAlso: OnFailureHandler
184184
*/
185-
@objc(updateEmail:onSuccess:onFailure:) public static func update(email newEmail: String, onSuccess: OnSuccessHandler?, onFailure: OnFailureHandler?) {
185+
@objc(updateEmail:onSuccess:onFailure:) public static func updateEmail(_ newEmail: String, onSuccess: OnSuccessHandler?, onFailure: OnFailureHandler?) {
186186
implementation?.updateEmail(newEmail, onSuccess: onSuccess, onFailure: onFailure)
187187
}
188188

@@ -351,7 +351,7 @@ public final class IterableAPI : NSObject {
351351

352352
- remark: passing in an empty array will clear subscription list, passing in nil will not modify the list
353353
*/
354-
@objc(updateSubscriptions:unsubscribedChannelIds:unsubscribedMessageTypeIds:) public static func update(subscriptions emailListIds: [String]?, unsubscribedChannelIds: [String]?, unsubscribedMessageTypeIds: [String]?) {
354+
@objc(updateSubscriptions:unsubscribedChannelIds:unsubscribedMessageTypeIds:) public static func updateSubscriptions(_ emailListIds: [String]?, unsubscribedChannelIds: [String]?, unsubscribedMessageTypeIds: [String]?) {
355355
implementation?.updateSubscriptions(emailListIds, unsubscribedChannelIds: unsubscribedChannelIds, unsubscribedMessageTypeIds: unsubscribedMessageTypeIds)
356356
}
357357

0 commit comments

Comments
 (0)