setBackgroundHandler not triggered in specific IOS device

Viewed 161

I'm using react-native-firebase for notifications and facing a problem. When the app is in background mode, somehow it cannot trigger the function callingAPIS() on an 14.4 IOS device (android, IOS 14.4.2 working fine).

I figured out that when I connect the release version of app with Xcode, it working but when plug out callingAPIS is not triggered.

messaging().setBackgroundMessageHandler(async remoteMessage => {
  console.log('Message handled in the background!', remoteMessage);
  callingAPIS();
});

if (Platform.OS === 'ios') {
  messaging().onNotificationOpenedApp(remoteMessage => {
    console.log('FIREBASE IOS Background', remoteMessage);
  });
}

function HeadlessCheck({isHeadless}) {
  if (isHeadless) {
    // App has been launched in the background by iOS, ignore
    return null;
  }

  return <MyApp />;
}

AppRegistry.registerComponent(appName, () => HeadlessCheck);

Anyone facing this problem?

0 Answers
Related