You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AppDelegate+CULPlugin.m 917B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // AppDelegate+CULPlugin.m
  3. //
  4. // Created by Nikolay Demyankov on 15.09.15.
  5. //
  6. #import "AppDelegate+CULPlugin.h"
  7. #import "CULPlugin.h"
  8. /**
  9. * Plugin name in config.xml
  10. */
  11. static NSString *const PLUGIN_NAME = @"UniversalLinks";
  12. @implementation AppDelegate (CULPlugin)
  13. - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler {
  14. // ignore activities that are not for Universal Links
  15. if (![userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb] || userActivity.webpageURL == nil) {
  16. return NO;
  17. }
  18. // get instance of the plugin and let it handle the userActivity object
  19. CULPlugin *plugin = [self.viewController getCommandInstance:PLUGIN_NAME];
  20. if (plugin == nil) {
  21. return NO;
  22. }
  23. return [plugin handleUserActivity:userActivity];
  24. }
  25. @end