0

I am using a detached react native mobile app for both android and iOS and I have been given the API to call for push notification but I am somehow confused about the 'token' parameter, I just don't know what is the 'token' field, is it a device id unique number? If so how do I generate this token from a react native?

curl -X PUT -H "Content-Type: application/json" 
-H "authorization: Bearer {JWT token}"
"http://localhost:8080/api/token/${JSON.parse(user_id)}/insert" -d 
'{
  "platform": "Android",
  "token": "eCqpQQADBDo:APA91bGb1WkG_p7p3"
}'

I am also kinda confused if the push notification is something that is handled completely from the front-end (react native) or it is a back-end job!

How would an push notification in a real life app is implemented.

Mizlul
  • 1
  • 7
  • 41
  • 100

1 Answers1

0

Working with PushNotifications on React Native is not very straight-forward, and usually you'll need some knowledge about the native side of each platform in order to correctly configure this service.

For iOS, you have to go through a few steps:

Rembember, in order to test push notifications on iOS, you need a real device, simulator is not supporting it.

Regarding Android, you can use any of above libraries and follow the steps to correctly set everything, and you can test it even on simulator.

bra.Scene
  • 628
  • 8
  • 14