如何解决setBackgroundHandler 未在特定 IOS 设备中触发
我正在使用 react-native-firebase 进行通知并遇到问题。 当应用程序处于后台模式时,它无法在 14.4 IOS 设备上触发函数调用 APIS()(android,IOS 14.4.2 工作正常)。
我发现当我将应用程序的发布版本与 Xcode 连接时,它可以工作,但是当插入调用 APIS 时不会触发。
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);
有人遇到过这个问题吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。