Commit b03b51ac authored by Libin Lu's avatar Libin Lu Committed by GitHub

add opened_from_tray in initialNotificaiton

parent 05d33533
...@@ -332,16 +332,22 @@ RCT_EXPORT_METHOD(isDirectChannelEstablished:(RCTPromiseResolveBlock)resolve rej ...@@ -332,16 +332,22 @@ RCT_EXPORT_METHOD(isDirectChannelEstablished:(RCTPromiseResolveBlock)resolve rej
RCT_EXPORT_METHOD(getInitialNotification:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) RCT_EXPORT_METHOD(getInitialNotification:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
{ {
UILocalNotification *localUserInfo = self.bridge.launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]; NSDictionary* initialNotif;
if (localUserInfo) { NSDictionary *localUserInfo = [[self.bridge.launchOptions[UIApplicationLaunchOptionsLocalNotificationKey] userInfo] mutableCopy];
resolve([[localUserInfo userInfo] copy]); NSDictionary *remoteUserInfo = [self.bridge.launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] mutableCopy];
} else { if(localUserInfo){
resolve([self.bridge.launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] copy]); initialNotif = localUserInfo;
} } else if (remoteUserInfo) {
initialNotif = remoteUserInfo;
}
if (initialNotif) {
[initialNotif setValue:@YES forKey:@"opened_from_tray"];
resolve(initialNotif);
} else {
resolve(nil);
}
} }
RCT_EXPORT_METHOD(getAPNSToken:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) RCT_EXPORT_METHOD(getAPNSToken:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
{ {
NSData * deviceToken = [FIRMessaging messaging].APNSToken; NSData * deviceToken = [FIRMessaging messaging].APNSToken;
......
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