diff --git a/Sources/BranchSDK/BNCServerInterface.m b/Sources/BranchSDK/BNCServerInterface.m index 37cfcfd1d..ccaf98bb8 100644 --- a/Sources/BranchSDK/BNCServerInterface.m +++ b/Sources/BranchSDK/BNCServerInterface.m @@ -177,7 +177,7 @@ - (void)genericHTTPRequest:(NSURLRequest *)request retryNumber:(NSInteger)retryN - (BOOL)isLinkingRelatedRequest:(NSString *)endpoint postParams:(NSDictionary *)post { - BOOL hasIdentifier = (post[BRANCH_REQUEST_KEY_LINK_IDENTIFIER] != nil ) || (post[BRANCH_REQUEST_KEY_LINK_IDENTIFIER] != nil) || (post[BRANCH_REQUEST_KEY_UNIVERSAL_LINK_URL] != nil); + BOOL hasIdentifier = (post[BRANCH_REQUEST_KEY_LINK_IDENTIFIER] != nil ) || (post[BRANCH_REQUEST_KEY_SPOTLIGHT_IDENTIFIER] != nil) || (post[BRANCH_REQUEST_KEY_UNIVERSAL_LINK_URL] != nil); // ND - Fix it // Allow install to resolve a link. if ([endpoint containsString:@"/v1/install"]) { diff --git a/Sources/BranchSDK/Branch.m b/Sources/BranchSDK/Branch.m index 7fccba72e..bda2d8dbe 100644 --- a/Sources/BranchSDK/Branch.m +++ b/Sources/BranchSDK/Branch.m @@ -704,18 +704,18 @@ - (void)initSessionWithLaunchOptions:(NSDictionary *)options self.shouldAutomaticallyDeepLink = automaticallyDisplayController; // Check for Branch link in a push payload - BranchOpenRequestLinkParams *params = [[BranchOpenRequestLinkParams alloc] init]; + BOOL appLaunchViaPushNotification = NO; #if !TARGET_OS_TV if ([options objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) { id branchUrlFromPush = [options objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey][BRANCH_PUSH_NOTIFICATION_PAYLOAD_KEY]; if ([branchUrlFromPush isKindOfClass:[NSString class]]) { - params.referringURL = (NSString *)branchUrlFromPush; + appLaunchViaPushNotification = YES; } } #endif - if(params.referringURL || [[options objectForKey:@"BRANCH_DEFER_INIT_FOR_PLUGIN_RUNTIME_KEY"] isEqualToNumber:@1] || (![options.allKeys containsObject:UIApplicationLaunchOptionsURLKey] && ![options.allKeys containsObject:UIApplicationLaunchOptionsUserActivityDictionaryKey]) ) { - [self initUserSessionAndCallCallback:YES sceneIdentifier:nil urlParams:params reset:NO]; + if( [[options objectForKey:@"BRANCH_DEFER_INIT_FOR_PLUGIN_RUNTIME_KEY"] isEqualToNumber:@1] || (![options.allKeys containsObject:UIApplicationLaunchOptionsURLKey] && ![options.allKeys containsObject:UIApplicationLaunchOptionsUserActivityDictionaryKey] && !appLaunchViaPushNotification)) { + [self initUserSessionAndCallCallback:YES sceneIdentifier:nil urlParams:nil reset:NO]; } }