Open AugustoAleGon opened 5 years ago
@AugustoAleGon I have looked at the https://github.com/zo0r/react-native-push-notification
The only difference I see is to configure:
PushNotification.configure({
// (optional) Called when Token is generated (iOS and Android)
onRegister: function(token) {
console.log( 'TOKEN:', token );
},
// (required) Called when a remote or local notification is opened or received
onNotification: function(notification) {
console.log( 'NOTIFICATION:', notification );
// process the notification
// required on iOS only (see fetchCompletionHandler docs: https://facebook.github.io/react-native/docs/pushnotificationios.html)
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
// ANDROID ONLY: GCM or FCM Sender ID (product_number) (optional - not required for local notifications, but is need to receive remote push notifications)
senderID: "YOUR GCM (OR FCM) SENDER ID",
// IOS ONLY (optional): default: all - Permissions to register.
permissions: {
alert: true,
badge: true,
sound: true
},
// Should the initial notification be popped automatically
// default: true
popInitialNotification: true,
/**
* (optional) default: true
* - Specified if permissions (ios) and token (android and ios) will requested or not,
* - if not, you must call PushNotificationsHandler.requestPermissions() later
*/
requestPermissions: true,
});
so that it listens to changes from the server.. I dont have any react native projects setup, but I can assist you with what you may have to change on the client.
@AugustoAleGon react native has already well-featured https://github.com/invertase/react-native-firebase package
@Nits7029 I'm migrating my app to react native now, This project is good for the meteor back-end support, to send messages with APN / FCM
This plugin works for codova/ phonegap versions. But It is on future plans to make it work on React Native?