Skip to content

Commit ac69c40

Browse files
author
Brad Umbaugh
committed
Fixes to the migration section and in-app section
1 parent be314fe commit ac69c40

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ IterableAppExtensions.framework
6868
- In-app messages: handling manually
6969

7070
- To control when in-app messages display (rather than displaying them
71-
automatically), set an `inAppDelegate` (an object that conforms to the
72-
`IterableInAppDelegate` protocol) on `IterableConfig`. From the `onNew`
73-
(Swift) method, return `.skip`.
71+
automatically), set `IterableConfig.inAppDelegate` (an
72+
`IterableInAppDelegate` object). From its `onNew` method, return `.skip`.
7473

7574
- To get the queue of available in-app messages, call
7675
`IterableApi.inAppManager.getMessages()`. Then, call
@@ -89,12 +88,12 @@ IterableAppExtensions.framework
8988
- If you are currently using the `itbl://` URL scheme for custom actions,
9089
the SDK will still pass these actions to the custom action handler.
9190
However, support for this URL scheme will eventually be removed (timeline
92-
TBD), so it is best to move templates to the `action://` URL scheme as
93-
it's possible to do so.
91+
TBD), so it is best to move to the `action://` URL scheme as it's
92+
possible to do so.
9493

9594
- Consolidated deep link URL handling
9695

97-
- By default, the beta SDK handles deep links with the the URL delegate
96+
- By default, the SDK handles deep links with the the URL delegate
9897
assigned to `IterableConfig`. Follow the instructions in
9998
[Deep Linking](#deep-linking) to migrate any existing URL handling code
10099
to this new API.
@@ -466,12 +465,34 @@ NSArray *messages = [IterableAPI.inAppManager getMessages];
466465
467466
#### Handling in-app message buttons and links
468467
469-
Button and link clicks in in-app messages are handled similarly to [deep links](#deep-linking) in push notifications and emails. If a user taps a button or link in an in-app message, and its `href` contains a URL (which is usually the case), the SDK will call the `handle` method of `IterableConfig.urlDelegate` (an object of type `IterableURLDelegate`), if it is set. If this delegate is not set, by default the URL found in the `href` property will open in Safari.
470-
471-
Custom actions are specified by passing `action://customActionName` as the link URL (notice the `action://` scheme name). If the in-app message's `href` property contains a custom action, tapping the message will call the `handle` method of `IterableConfig.customActionDelegate` (an object that conforms to the `IterableCustomActionDelegate` protocol). If `customActionDelegate` is not set, by default nothing will happen.
468+
The SDK handles in-app message buttons and links as follows:
469+
470+
- If the URL of the button or link uses the `action://` URL scheme, the SDK
471+
passes the action to `IterableConfig.customActionDelegate.handle()`. If
472+
`customActionDelegate` (an `IterableCustomActionDelegate` object) has not
473+
been set, the action will not be handled.
474+
475+
- For the time being, the SDK will treat `itbl://` URLs the same way as
476+
`action://` URLs. However, this behavior will eventually be deprecated
477+
(timeline TBD), so it's best to migrate to the `action://` URL scheme
478+
as it's possible to do so.
479+
480+
- The `iterable://` URL scheme is reserved for action names predefined by
481+
the SDK. If the URL of the button or link uses an `iterable://` URL known
482+
to the SDK, it will be handled automatically and will not be passed to the
483+
custom action handler.
484+
485+
- The SDK passes all other URLs to `IterableConfig.urlDelegate.handle()`. If
486+
`urlDelegate` (an `IterableUrlDelegate` object) has not been set, or if it
487+
returns `false` for the provided URL, the URL will be opened by the system
488+
(using a web browser or other application, as applicable).
489+
490+
Take a look at [this sample code](https://github.com/Iterable/swift-sdk/blob/master/sample-apps/swift-sample-app/swift-sample-app/AppDelegate.swift)
491+
for a demonstration of how to implement and use the `IterableURLDelegate` and `IterableCustomActionDelegate` protocols.
492+
493+
The following code demonstrates how to assign a `urlDelegate` and
494+
`customActionDelegate` to an `IterableConfig` object:
472495
473-
Take a look at [this sample code](https://github.com/Iterable/swift-sdk/blob/master/sample-apps/swift-sample-app/swift-sample-app/AppDelegate.swift), which demonstrates how to implement and use the `IterableURLDelegate` and `IterableCustomActionDelegate` protocols.
474-
475496
```swift
476497
let config = IterableConfig()
477498
config.urlDelegate = YourCustomUrlDelegate()

0 commit comments

Comments
 (0)