singular-labs/react-native-sdk

Undocumented AppDelegate methods

toddtreece opened this issue · 2 comments

The integration guide doesn't mention these methods. Are they required in the AppDelegate in order to implement deep links?

// Saving the launchOptions for later when the SDK is initialized to handle Singular Links.
// The client will need to call this method is the AppDelegate in didFinishLaunchingWithOptions.
+(void)startSessionWithLaunchOptions:(NSDictionary*)options{
launchOptions = options;
}
// Handling Singular Link when the app is opened from a Singular Link while it was in the background.
// The client will need to call this method in the AppDelegate in continueUserActivity.
+(void)startSessionWithUserActivity:(NSUserActivity*)userActivity{
if(!isSingularLinkEnabled){
return;
}
[Singular startSession:apikey
withKey:secret
andUserActivity:userActivity
withSingularLinkHandler:^(SingularLinkParams * params){
[SingularBridge handleSingularLink:params];
}];
}

i tested this with a boilerplate react-native app to make sure it wasn't something else causing the issue, and i can confirm that these two undocumented methods are needed for deep links to work properly

Thanks @toddtreece! we have added them to our documentation.