Hello @Neeraj_Kumar,
To handle notifications in the foreground you can add this method to the AppDelegate.
More info and example can be found here.
Maybe this topic could also be useful.
Regards,
Olha
Hello @Neeraj_Kumar,
To handle notifications in the foreground you can add this method to the AppDelegate.
More info and example can be found here.
Maybe this topic could also be useful.
Regards,
Olha
@olhadanylova I thought It’s been already handled by the piece of code given in the Backendless doc (How to Setup Push Notifications In a React Native App (iOS) | Backendless ), is it not handled ?
The piece of code from the doc doesn’t contain the willPresent..()
method, only the didReceive..()
one.
We’ll discuss adding that method to the documentation.
Regards,
Olha
can you please share the updated method which will handle the foreground notifications ? @olhadanylova
@olhadanylova Is it look like this ?
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(nonnull UNNotificationResponse *)notification withCompletionHandler:(nonnull void (^)(UNNotificationPresentationOptions))completionHandler
{
[RNBackendless didReceiveNotificationResponse:notification];
completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}
Sorry for the delay. We need to discuss the changes in the RN lib and make some fixes to make this method work correctly.
We’ll notify you here as soon as possible.
Regards,
Olha
Please just add this method to the AppDelegate.m:
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler {
completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}
Regards,
Olha