Commit baac9191 authored by Ran Greenberg's avatar Ran Greenberg

add isRegisteredForRemoteNotifications to iOS native side

parent 43a4c895
......@@ -549,4 +549,17 @@ RCT_EXPORT_METHOD(cancelAllLocalNotifications)
[RCTSharedApplication() cancelAllLocalNotifications];
}
RCT_EXPORT_METHOD(isRegisteredForRemoteNotifications:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
{
BOOL ans;
if (TARGET_IPHONE_SIMULATOR) {
ans = [[[UIApplication sharedApplication] currentUserNotificationSettings] types] != 0;
}
else {
ans = [[UIApplication sharedApplication] isRegisteredForRemoteNotifications];
}
resolve(@(ans));
}
@end
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