This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,13 @@ export function addBackgroundRemoteNotificationHandler(appDelegate) {
177177 } ;
178178
179179 appDelegate . prototype . applicationDidFailToRegisterForRemoteNotificationsWithError = ( application : UIApplication , error : NSError ) => {
180- _rejectWhenDidFailToRegisterForNotifications && _rejectWhenDidFailToRegisterForNotifications ( error . localizedDescription ) ;
180+ if ( error . localizedDescription . indexOf ( "not supported in the simulator" ) > - 1 ) {
181+ // Why? See https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/1277
182+ // Note that this method will also be invoked on a simulator when the consent popup is declined
183+ _resolveWhenDidRegisterForNotifications && _resolveWhenDidRegisterForNotifications ( ) ;
184+ } else {
185+ _rejectWhenDidFailToRegisterForNotifications && _rejectWhenDidFailToRegisterForNotifications ( error . localizedDescription ) ;
186+ }
181187 } ;
182188
183189 appDelegate . prototype . applicationDidReceiveRemoteNotificationFetchCompletionHandler = ( app , notification , completionHandler ) => {
You can’t perform that action at this time.
0 commit comments