[notifications][ios] Handle plain text alert #963
This commit is contained in:
parent
0645d179b3
commit
cd5c616a93
|
@ -676,6 +676,8 @@ RCT_EXPORT_METHOD(jsInitialised:(RCTPromiseResolveBlock)resolve rejecter:(RCTPro
|
|||
NSDictionary *aps = userInfo[k1];
|
||||
for (id k2 in aps) {
|
||||
if ([k2 isEqualToString:@"alert"]) {
|
||||
// alert can be a plain text string rather than a dictionary
|
||||
if ([aps[k2] isKindOfClass:[NSDictionary class]]) {
|
||||
NSDictionary *alert = aps[k2];
|
||||
for (id k3 in alert) {
|
||||
if ([k3 isEqualToString:@"body"]) {
|
||||
|
@ -693,6 +695,9 @@ RCT_EXPORT_METHOD(jsInitialised:(RCTPromiseResolveBlock)resolve rejecter:(RCTPro
|
|||
NSLog(@"Unknown alert key: %@", k2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notification[@"title"] = aps[k2];
|
||||
}
|
||||
} else if ([k2 isEqualToString:@"badge"]) {
|
||||
ios[@"badge"] = aps[k2];
|
||||
} else if ([k2 isEqualToString:@"category"]) {
|
||||
|
|
Loading…
Reference in New Issue