React-native-push-notification: 57.3 PushNotificationIOS.FetchResult.NoData incorrect configure

Created on 25 Oct 2018  路  12Comments  路  Source: zo0r/react-native-push-notification

Hi, since updating to 57.3, I get an error when I call finish. It says UIBackgroundFetchResultNewData should be backgroundFetchResultNewData
notification.finish(PushNotificationIOS.FetchResult.NewData);

It seems like PushNotificationIOS.FetchResult.NewData has the incorrect config as when I use the following code it seems fine.
notification.finish("backgroundFetchResultNewData");

Maybe this is a change with IOS?

Most helpful comment

I was having same error. =((

Invalid UIBackgroundFetchResult 'UIBackgroundFetchResultNoData'. should be one of: (
backgroundFetchResultFailed,
backgroundFetchResultNewData,
backgroundFetchResultNoData
)

All 12 comments

I'm getting this as well. Has there been movement?

I'm getting this issue also

I was having same error.
solved by using delegate method:

- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
 {
    [RNFIRMessaging willPresentNotification:notification withCompletionHandler:completionHandler];
 }

 #if defined(__IPHONE_11_0)
 - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler
 {
     [RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
   }
 #else
 - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler
 {
     [RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
   }
 #endif

I was having same error. =((

Invalid UIBackgroundFetchResult 'UIBackgroundFetchResultNoData'. should be one of: (
backgroundFetchResultFailed,
backgroundFetchResultNewData,
backgroundFetchResultNoData
)

I have the same issue. Any updates on this?

Same issue when using notification.finish(PushNotificationIOS.FetchResult.NewData)

I believe this needs to be a string for it to work so I have been using the following

notification.finish('backgroundFetchResultNewData)

I made following changes here push-notification-ios/js/index.js and worked perfectly.

static FetchResult: FetchResult = {
    NewData: 'UIBackgroundFetchResultNewData',
    NoData: 'UIBackgroundFetchResultNoData',
    ResultFailed: 'UIBackgroundFetchResultFailed',
  };

to

static FetchResult: FetchResult = {
    NewData: 'backgroundFetchResultNewData',
    NoData: 'backgroundFetchResultNoData',
    ResultFailed: 'backgroundFetchResultFailed',
  };

i am also having the same issue. +1
Is this final solution?

@fspider I believe so, it has worked for me too.

It working perfect

Did someone made a PR on the iOS repository ?
It would be helpful

Was this page helpful?
0 / 5 - 0 ratings