Skip to content

Why setBackgroundMessageHandler not working in iOS also not able to get remoteMessage? #6241

@ReactNativeDev2296

Description

@ReactNativeDev2296

Hello @felixclack , @jeanregisser , @andymatuschak
I am using React native free-base version v10. 1 and React native firebase messaging version 14.9.1. I got the notification in the background but was not able to get logs(payload) in iOS. is there any solution for this

below the index.js file in I added the setbackgroundhandler.
`import messaging from '@react-native-firebase/messaging';
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
messaging().setBackgroundMessageHandler(async (remoteMessage) => {
console.log(remoteMessage);
})

AppRegistry.registerComponent(appName, () => App);`

I also enabled modes background fetch, remote notifications, background processing but get the remoteMessage in setbackgroundhandler and FCM also provided below body.
-"content_available": true, "priority": "high"
so please help me above issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    help: needs-triageIssue needs additional investigation/triaging.type: bugNew bug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions