Skip to content

Commit 9c7952d

Browse files
sharnikFacebook Github Bot
authored and
Facebook Github Bot
committed
Remove deprecated push notification method info
Summary: This PR seeks to improve the documentation of PushNotificationIOS. The method didReceiveRemoteNotification without a fetch completion handler is deprecated by Apple and they [discourage using it](https://developer.apple.com/reference/uikit/uiapplicationdelegate/1623117-application) in favor of the [version with the handler](https://developer.apple.com/reference/uikit/uiapplicationdelegate/1623013-application). Reasons for this change: 1. Our docs say that this method is required for remote notifications, but it's not. (It's one of possibilities with a recommendation not to use it.) 2. The method is deprecated by Apple and people shouldn't use it. 3. If you use the deprecated method, in 99% of the cases it will behave in a different way from what you'd expect. In particular, you won't get remote notifications when your app is in the background. As there's no benefit (as far as I know) of using the method, I don't think we should even mention it to the users. This is a re-opened PR that was mis Closes #11109 Differential Revision: D4232800 Pulled By: javache fbshipit-source-id: d3b509db41a549aa7fbc41753c648085df43d8ee
1 parent 51efaab commit 9c7952d

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

Libraries/PushNotificationIOS/PushNotificationIOS.js

-10
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,11 @@ export type PushNotificationEventName = $Enum<{
9696
* {
9797
* [RCTPushNotificationManager didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
9898
* }
99-
* // Optionally implement this method over the previous to receive remote notifications. However
100-
* // implement the application:didReceiveRemoteNotification:fetchCompletionHandler: method instead of this one whenever possible.
101-
* // If your delegate implements both methods, the app object calls the `application:didReceiveRemoteNotification:fetchCompletionHandler:` method
102-
* // Either this method or `application:didReceiveRemoteNotification:fetchCompletionHandler:` is required in order to receive remote notifications.
103-
* //
10499
* // Required for the registrationError event.
105100
* - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
106101
* {
107102
* [RCTPushNotificationManager didFailToRegisterForRemoteNotificationsWithError:error];
108103
* }
109-
* // Required for the notification event.
110-
* - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification
111-
* {
112-
* [RCTPushNotificationManager didReceiveRemoteNotification:notification];
113-
* }
114104
* // Required for the localNotification event.
115105
* - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
116106
* {

0 commit comments

Comments
 (0)