You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's my code. As you can see that it's simple code for test cloud message.
When the device receive any message, it will show a simple alert box.
And it worked well in iOS simulator. the simulator as iPhone 8 plus, iOS 11.4 ver.
When I send some message in Firebase console, it shows the alert box immediately.
And my real test device is also iPhone 8 plus and the iOS version is also 11.4
But when I send same message, this real device doesn't show the alert box.
And also it doesn't trigger onMessage.
It has same codes and same setting. I checked about notification setting in the device.
But it's allowed notifications. And also checked about permission and token. The device
got permission and token correctly without any problems and I can read the token.
'FCM does not work on the iOS simulator, you must test them using a real device.
This is a restriction enforced by Apple.' I read it in official document but actually it works...
I don't know why it actually works in simulator but not a real device. If it didn't work on
simulator, I tried to find some other problems but it works on simulator. So maybe there
is some other kind of problem I think.
Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.
Issue
It's my code. As you can see that it's simple code for test cloud message.
When the device receive any message, it will show a simple alert box.
And it worked well in iOS simulator. the simulator as iPhone 8 plus, iOS 11.4 ver.
When I send some message in Firebase console, it shows the alert box immediately.
And my real test device is also iPhone 8 plus and the iOS version is also 11.4
But when I send same message, this real device doesn't show the alert box.
And also it doesn't trigger onMessage.
It has same codes and same setting. I checked about notification setting in the device.
But it's allowed notifications. And also checked about permission and token. The device
got permission and token correctly without any problems and I can read the token.
'FCM does not work on the iOS simulator, you must test them using a real device.
This is a restriction enforced by Apple.' I read it in official document but actually it works...
I don't know why it actually works in simulator but not a real device. If it didn't work on
simulator, I tried to find some other problems but it works on simulator. So maybe there
is some other kind of problem I think.
componentDidMount() {
firebase.messaging().hasPermission()
.then(enabled => {
if (enabled) {
this.setState({testState: 'enabled'});
} else {
firebase.messaging().requestPermission()
.then(() => {
this.setState({testState: 'requested'});
})
.catch(error => {
this.setState({testState: 'error'});
});
}
});
this.messageListener = firebase.messaging().onMessage((message: RemoteMessage) => {
Alert.alert('test', 'message');
});
}
componentWillUnmount() {
this.onTokenRefreshListener();
this.messageListener();
}
Environment
iOS (11.4 version)
macOC
Xcode
React Native
version:0.56.0
React Native Firebase
Version:5.0.0
Firebase
Module:messaging(5.9 ver)
typescript
?no
iPhone 8 plus
The text was updated successfully, but these errors were encountered: