File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
example/ios/IntercomReactNativeExample Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff 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 ];
Original file line number Diff line number Diff 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) {
You can’t perform that action at this time.
0 commit comments