Push notification implementation in React native

I want to implement push notifications for both Android and iOS in my React Native app using Amity SDK.

I first generate the Firebase token in my app and send it to the Amity server using the following function:
const payload = {
deviceId: deviceId,
platform: platform === ‘ios’ ? ‘ios’ : ‘android’,
token: fcmToken,
userId: userId,
provider: ‘fcm’,
};

const response = await fetch(‘https://apix.us.amity.co/v1/notification’, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
},
body: JSON.stringify(payload),
});

I’ve also uploaded the notification certificates for both platforms in the Amity Notification settings.

However, I’m not receiving any notifications when a user starts a live stream (or in similar cases).

Can someone please confirm if there are additional steps or configurations required to make notifications work with Amity on both Android and iOS?

Hello @pravat04, please refer to the guide for instructions on how to set up and implement push notifications in React Native

Link: React Native Push Notifications - social.plus

when i tried to hit the api with fcm to token to send in amity server i got this error
:cross_mark: [PushNotificationService] Amity API registration failed: [Error: API request failed: 422 - {
“status”: “error”,
“message”: “Parameters validation error!”,
“code”: 500000,
“data”: {
“detail”: [
“The ‘apiKey’ field is required.”
]
}
}]

what is the api key is here ?

Hello @pravat04 , The error indicates that the apiKey parameter is missing in your request.
You can find instructions on how to obtain your API Key from the Social+ Console here:

:backhand_index_pointing_right: How to Get Your API Key

Please add this key to your request and try again.