Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The document of PushNotificationIOS enhancement #3224

Closed
oney opened this issue Oct 4, 2015 · 2 comments
Closed

The document of PushNotificationIOS enhancement #3224

oney opened this issue Oct 4, 2015 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@oney
Copy link

oney commented Oct 4, 2015

If I miss anything, please correct me.
I try to use PushNotificationIOS, and I face many problems. Now, I resolve these problems.

  1. I have to add RCTPushNotification.xcodeproj to Libraries and add libRCTPushNotification.a to Link Binary with Libraries. Otherwise, I will get error RCTPushNotificationManager is undefined in PushNotificationIOS.js
  2. I have to add these code to AppDelegate.m
#import "RCTPushNotificationManager.h"
...
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
  [RCTPushNotificationManager application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
  [RCTPushNotificationManager application:application didRegisterUserNotificationSettings:notificationSettings];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
  [RCTPushNotificationManager application:application didReceiveRemoteNotification:userInfo];
}

Otherwise, this listener will be never called.

PushNotificationIOS.addEventListener('register', function(token){
});

However, these things are not mentioned in the document. Can you add it to the document? It will be helpful. Or, it is in the document, and I miss it?

@satya164
Copy link
Contributor

satya164 commented Oct 4, 2015

If it's not in the docs, may be you can send a pull request?

@oney
Copy link
Author

oney commented Oct 6, 2015

OK, I'll try 😏

@oney oney closed this as completed Oct 6, 2015
@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants