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

React Native Support? #360

Open
AugustoAleGon opened this issue Feb 1, 2019 · 3 comments
Open

React Native Support? #360

AugustoAleGon opened this issue Feb 1, 2019 · 3 comments

Comments

@AugustoAleGon
Copy link

This plugin works for codova/ phonegap versions. But It is on future plans to make it work on React Native?

@da314pc
Copy link
Collaborator

da314pc commented Feb 5, 2019

@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.

@Nits7029
Copy link

@AugustoAleGon react native has already well-featured https://github.com/invertase/react-native-firebase package

@da314pc
Copy link
Collaborator

da314pc commented Aug 13, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants