Skip to content

Commit 1623375

Browse files
authored
Merge branch 'main' into vr/remove_unnecessary_ci_cd_steps
2 parents 2bed3cc + 692b34d commit 1623375

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

example/ios/IntercomReactNativeExample/AppDelegate.m

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,21 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4646
#ifdef FB_SONARKIT_ENABLED
4747
InitializeFlipper(application);
4848
#endif
49-
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
49+
50+
NSMutableDictionary *newLaunchOptions = [NSMutableDictionary dictionaryWithDictionary:launchOptions];
51+
52+
// Modifying launchOptions to facilitate deep linking.
53+
if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {
54+
NSDictionary *remoteNotif = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
55+
if (remoteNotif[@"uri"]) {
56+
NSString *initialURL = remoteNotif[@"uri"];
57+
if (!launchOptions[UIApplicationLaunchOptionsURLKey]) {
58+
newLaunchOptions[UIApplicationLaunchOptionsURLKey] = [NSURL URLWithString:initialURL];
59+
}
60+
}
61+
}
62+
63+
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:newLaunchOptions];
5064
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
5165
moduleName:@"IntercomReactNativeExample"
5266
initialProperties:nil];

ios/IntercomModule.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ - (NSData *)dataFromHexString:(NSString *)string {
215215
} else if ([contentType isEqualToString:@"SURVEY"]) {
216216
intercomContent = [IntercomContent surveyWithId:content[@"id"]];
217217
} else if ([contentType isEqualToString:@"HELP_CENTER_COLLECTIONS"]) {
218-
NSArray<NSString *> *collectionIds = [NSArray arrayWithObjects:content[@"ids"], nil];
218+
NSArray<NSString *> *collectionIds = content[@"ids"];
219219
intercomContent = [IntercomContent helpCenterCollectionsWithIds:collectionIds];
220220
}
221221
if (intercomContent) {

0 commit comments

Comments
 (0)