-
-
Save dpolivy/b181d881c0137d98be57 to your computer and use it in GitHub Desktop.
Implementation of delegate method for implementing Universal Links in iOS 9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handle Universal Links | |
*/ | |
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler | |
{ | |
// Check if this is a Universal Link | |
if (![userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb] || userActivity.webpageURL == nil) { | |
// Not a Universal Link, so not handled | |
return NO; | |
} | |
// Send out the notification | |
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:userActivity.webpageURL]]; | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment