简体   繁体   中英

Rails backend with React Native

I'm building a React Native mobile marketplace app with Rails as backend. Buyers're able to sign up both via mobile and web, sellers too.

When the buyers want to buy, seller recieve an email notification and a PUSH notification mobile.

I want to know wich is the best strategy to get only the sellers that download the app so only them recieve the push.

Thank you.

You can use react-native-fcm . It's a module that lets you connect with Google's firebase cloud messaging. From there, you can send a push notification to a specific user using their unique token.

To get that token, you must create a different API function that will receive the token when the user registers a new account.

For example:

FCM.getFCMToken().then(token => {
    console.log(token)
    // call the registeration api here
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM