React Native Firebase v6,setBackgroundMessageHandler不起作用

时间:2020-01-20 04:36:47

标签: react-native react-native-firebase

这是我在index.js中的代码:

firebase.messaging().setBackgroundMessageHandler(async(remoteMessgae) => {
  console.log('Listening in Background ...')
  await AsyncStorage.setItem('isUserLoggedIn', 'false')
  PushNotification.localNotification({
    title: 'Test Title',
    message: 'Test Message' 
  })
})
AppRegistry.registerComponent(appName, () => App)

虽然我在后台/应用程序关闭时收到通知,但console / AsyncStorage却无法正常工作。

0 个答案:

没有答案