Skip to content

Sending Custom Data in FCM not working #212

@imarc7

Description

@imarc7

Sending custom data with FCM is not working. When trying to log the notification received in Expo React Native, no custom data is received.
Here's the code:

const settings = {
  fcm: {
        appName: 'xxxxx',
        serviceAccountKey: jsonKey, 
        credential: null,
   }
}
const push = new PushNotifications(settings);
const deviceToken = 'xxxxxxxxxx';
const data = {
      title: 'XXXX',
      body: 'Message',
      custom: {
        // Additional data to send with the notification for android
        name: 'test'
      },
    };
push.send(deviceToken, data, (error: Error, result: any) => {
});

The notification is received but the custom param "name" is not there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions