diff --git a/tealeaf/platform/PluginManager.h b/tealeaf/platform/PluginManager.h index 2706f7b9..586176fa 100644 --- a/tealeaf/platform/PluginManager.h +++ b/tealeaf/platform/PluginManager.h @@ -39,6 +39,7 @@ - (void) handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication; - (void) onPause; - (void) onResume; +- (void) performActionForShortcutItem: (UIApplicationShortcutItem *) shortcutItem; @end diff --git a/tealeaf/platform/PluginManager.mm b/tealeaf/platform/PluginManager.mm index 7618fc0e..6dd0ea1b 100644 --- a/tealeaf/platform/PluginManager.mm +++ b/tealeaf/platform/PluginManager.mm @@ -200,6 +200,10 @@ - (void) onResume { [self postNotification:@"onResume" obj1:nil obj2:nil]; } +- (void) performActionForShortcutItem:(UIApplicationShortcutItem *) shortcutItem { + [self postNotification:@"performActionForShortcutItem:" obj1:shortcutItem obj2:nil]; +} + - (void) dispatchJSEventWithJSONString: (NSString*) str andRequestId:(NSNumber *)requestId { if (m_core) { JSContext *cx = m_core.cx; diff --git a/tealeaf/platform/TeaLeafAppDelegate.mm b/tealeaf/platform/TeaLeafAppDelegate.mm index f83d21a8..084879ac 100644 --- a/tealeaf/platform/TeaLeafAppDelegate.mm +++ b/tealeaf/platform/TeaLeafAppDelegate.mm @@ -457,6 +457,13 @@ - (void)application:(UIApplication *)app didReceiveLocalNotification:(UILocalNot [self.pluginManager didReceiveLocalNotification:notification application:app]; } +- (void) application: (UIApplication *) application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler +{ + [self.pluginManager performActionForShortcutItem:shortcutItem]; + if (completionHandler) { + completionHandler(YES); + } +} //// Splash Screen