88
99@interface FLTQuickActionsPlugin ()
1010@property (nonatomic , retain ) FlutterMethodChannel *channel;
11+ @property (nonatomic , retain ) NSString *shortcutType;
1112@end
1213
13- @implementation FLTQuickActionsPlugin {
14- NSString *shortcutType;
15- }
14+ @implementation FLTQuickActionsPlugin
1615
1716+ (void )registerWithRegistrar : (NSObject <FlutterPluginRegistrar> *)registrar {
1817 FlutterMethodChannel *channel =
@@ -52,7 +51,7 @@ - (BOOL)application:(UIApplication *)application
5251 performActionForShortcutItem : (UIApplicationShortcutItem *)shortcutItem
5352 completionHandler : (void (^)(BOOL succeeded))completionHandler
5453 API_AVAILABLE(ios(9.0 )) {
55- [self _handleShortcut : shortcutItem.type];
54+ [self handleShortcut : shortcutItem.type];
5655 return YES ;
5756}
5857
@@ -62,23 +61,23 @@ - (BOOL)application:(UIApplication *)application
6261 UIApplicationShortcutItem *shortcutItem =
6362 launchOptions[UIApplicationLaunchOptionsShortcutItemKey];
6463 if (shortcutItem) {
65- shortcutType = shortcutItem.type ;
64+ self. shortcutType = shortcutItem.type ;
6665 return NO ;
6766 }
6867 }
6968 return YES ;
7069}
7170
7271- (void )applicationDidBecomeActive : (UIApplication *)application {
73- if (shortcutType) {
74- [self _handleShortcut: shortcutType];
75- shortcutType = nil ;
72+ if (self. shortcutType ) {
73+ [self handleShortcut: self . shortcutType];
74+ self. shortcutType = nil ;
7675 }
7776}
7877
7978#pragma mark Private functions
8079
81- - (void )_handleShortcut : (NSString *)shortcut {
80+ - (void )handleShortcut : (NSString *)shortcut {
8281 [self .channel invokeMethod: @" launch" arguments: shortcut];
8382}
8483
0 commit comments