File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,9 @@ + (instancetype)sharedInstance
7272+ (void )registerWithRegistrar : (NSObject <FlutterPluginRegistrar>*)registrar {
7373
7474 [OneSignal initWithLaunchOptions: nil appId: nil handleNotificationAction: ^(OSNotificationOpenedResult *result) {
75-
75+ @synchronized (OneSignalPlugin.sharedInstance .coldStartOpenResult ) {
76+ OneSignalPlugin.sharedInstance .coldStartOpenResult = result;
77+ }
7678 }];
7779
7880 OneSignalPlugin.sharedInstance .channel = [FlutterMethodChannel
@@ -139,6 +141,12 @@ - (void)initOneSignal:(FlutterMethodCall *)call withResult:(FlutterResult)result
139141 [self addObservers ];
140142 }
141143
144+ @synchronized (self.coldStartOpenResult ) {
145+ if (self.coldStartOpenResult ) {
146+ [self handleNotificationOpened: self .coldStartOpenResult];
147+ }
148+ }
149+
142150 result (@[]);
143151}
144152
You can’t perform that action at this time.
0 commit comments