Commit 5c796bf7 authored by Yedidya Kennard's avatar Yedidya Kennard

getInitialNotification implemented on iOS

parent 28a28117
......@@ -513,6 +513,14 @@ RCT_EXPORT_METHOD(requestPermissionsWithCategories:(NSArray *)json)
[RNNotifications requestPermissionsWithCategories:categories];
}
RCT_EXPORT_METHOD(getInitialNotification:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
{
NSDictionary * notification = nil;
notification = [RNNotificationsBridgeQueue sharedInstance].openedRemoteNotification;
[RNNotificationsBridgeQueue sharedInstance].openedRemoteNotification = nil;
resolve(notification);
}
RCT_EXPORT_METHOD(log:(NSString *)message)
{
NSLog(message);
......
......@@ -180,6 +180,15 @@ export default class NotificationsIOS {
NativeRNNotifications.log(message);
}
static async getInitialNotification() {
const notification = await NativeRNNotifications.getInitialNotification();
if (notification) {
return new IOSNotification(notification);
} else {
return undefined;
}
}
/**
* Presenting local notification
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment