Skip to content

Commit 2afdc72

Browse files
Incorporate documentation feedback. Explain deferred deep linking better.
Also added a section on in-app initialization which I had missed before.
1 parent 6007ae2 commit 2afdc72

File tree

5 files changed

+41
-9
lines changed

5 files changed

+41
-9
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,34 @@ func application(_ application: UIApplication, continue userActivity: NSUserActi
251251
252252
### Deferred deep linking
253253
254-
If an app user does not have your app installed, deep linking will not work. The user will need to install your app first. After installing your app, the user will be taken to a specific location within your app when they launch it for the first time. See definition of deferred deep linking [here](#https://en.wikipedia.org/wiki/Deferred_deep_linking).
254+
Deferred deep linking comes into play when a user of your app does not have your app installed in their iPhone/iPad. See definition of deferred deep linking [here](#https://en.wikipedia.org/wiki/Deferred_deep_linking). If you enable deferred deeplinking in IterableSDK, when the user clicks on a deep link in an email, the user is first sent to the App Store. After installing your app from the App Store, the user is taken to a specific location within your app when they launch it for the first time.
255255
256256
#### Enabling deferred deep linking
257257
258258
Set `IterableConfig.checkForDeferredDeeplink = true` to enable deferred deep linking for IterableSDK.
259259
260260
### In-app messages
261261
262-
If you are already using in-app messages with IterableSDK, please check out the [migration section](#Migrating-in-app-messages-from-the-previous-version-of-the-SDK).
262+
If you are already using in-app messages with IterableSDK, please check out the [migration section](#Migrating-in-app-messages-from-the-previous-version-of-the-SDK).
263+
264+
In-app messages are handled via silent push messages from the server. When your application receives a silent push, you need to call IterableSDK in your AppDelegate as in the following code:
265+
266+
*Swift*
267+
268+
```swift
269+
// In AppDelegate.swift
270+
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
271+
IterableAppIntegration.application(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler)
272+
}
273+
```
274+
275+
*Objective-C*
276+
277+
```objc
278+
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
279+
[IterableAppIntegration application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
280+
}
281+
```
263282

264283
#### Default behavior
265284

sample-apps/objc-sample-app/objc-sample-app.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270
AC90809E20E308D1004BC146 /* Project object */ = {
271271
isa = PBXProject;
272272
attributes = {
273-
LastUpgradeCheck = 0940;
273+
LastUpgradeCheck = 1010;
274274
ORGANIZATIONNAME = Iterable;
275275
TargetAttributes = {
276276
AC9080A520E308D1004BC146 = {
@@ -554,6 +554,7 @@
554554
isa = XCBuildConfiguration;
555555
baseConfigurationReference = 75A967E379FC6270DFE2E36D /* Pods-objc-sample-app.debug.xcconfig */;
556556
buildSettings = {
557+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
557558
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
558559
CODE_SIGN_ENTITLEMENTS = "objc-sample-app/objc-sample-app.entitlements";
559560
CODE_SIGN_STYLE = Automatic;
@@ -573,6 +574,7 @@
573574
isa = XCBuildConfiguration;
574575
baseConfigurationReference = DDFF7C4DDD2898BE48245488 /* Pods-objc-sample-app.release.xcconfig */;
575576
buildSettings = {
577+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
576578
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
577579
CODE_SIGN_ENTITLEMENTS = "objc-sample-app/objc-sample-app.entitlements";
578580
CODE_SIGN_STYLE = Automatic;

sample-apps/objc-sample-app/objc-sample-app/AppDelegate.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,14 @@ - (void)applicationWillTerminate:(UIApplication *)application {
9191
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
9292
}
9393

94+
#pragma mark - Silent Push
95+
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
96+
[IterableAppIntegration application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
97+
}
98+
9499
#pragma mark - Url handling
95-
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler {
96-
100+
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
101+
97102
//ITBL:
98103
NSURL *url = userActivity.webpageURL;
99104
if (url == nil) {

sample-apps/objc-sample-app/objc-sample-app/Base.lproj/Main.storyboard

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="hgQ-gs-Z8D">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="hgQ-gs-Z8D">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
99
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
1010
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1111
</dependencies>
@@ -80,7 +80,7 @@
8080
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="f7k-qy-qxC">
8181
<rect key="frame" x="62.5" y="183" width="250" height="365.5"/>
8282
<subviews>
83-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="E6e-e6-ohw">
83+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="E6e-e6-ohw">
8484
<rect key="frame" x="0.0" y="0.0" width="250" height="20.5"/>
8585
<fontDescription key="fontDescription" type="system" weight="thin" pointSize="17"/>
8686
<nil key="textColor"/>
@@ -186,7 +186,7 @@
186186
<viewLayoutGuide key="safeArea" id="mdt-39-bbJ"/>
187187
</view>
188188
<navigationItem key="navigationItem" id="5BQ-Vo-KB0">
189-
<barButtonItem key="rightBarButtonItem" style="plain" systemItem="done" id="OQ7-S8-j6B">
189+
<barButtonItem key="rightBarButtonItem" style="done" systemItem="done" id="OQ7-S8-j6B">
190190
<connections>
191191
<action selector="doneButtonTapped:" destination="e0v-rS-htn" id="Wsh-gP-9al"/>
192192
</connections>

sample-apps/swift-sample-app/swift-sample-app/AppDelegate.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
8484
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
8585
}
8686

87+
// MARK: Silent Push for in-app
88+
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
89+
IterableAppIntegration.application(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler)
90+
}
91+
92+
8793
// MARK: Deep link
8894
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
8995
guard let url = userActivity.webpageURL else {

0 commit comments

Comments
 (0)