react-native-fcm: Don't receive push notification when user kill app (Android & IOS)
Hi @evollu, My app can receive push notifcation on fourground and background. But app don’t receive push notification when user kill app. Can you help me?
"react-native-fcm": "^9.1.0"
"react": "16.0.0-alpha.12"
"react-native": "^0.47.2",
Environment:
OS: macOS Sierra 10.12.5
Node: 8.1.2
Yarn: 0.24.6
npm: 5.3.0
Watchman: 4.7.0
Xcode: Xcode 8.3.3 Build version 8E3004b
Android Studio: 2.3 AI-162.4069837
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (11 by maintainers)
Any updates on how to take auto-start permission for phones like xiaomi, asus, etc. in react native ? Or How to list your app in white listed apps?
checked some Chinese forums and looks like it is by design by like xiaomi, asus, oppo, Flyme etc for “better bootup speed and battery life”. They provides their own whitelist activities. more details might be found here https://github.com/ttdevs/KillMe
One simple solution might be adding a Toast to ask users to enable auto start themselves.
I already follow that code on my xiaomi phone. What does it do is only show Autostart OS Settings and let user enable autostart on selected app, not enable autostart on selected app automatically.
Why some popular apps like FB and WhatsApp have autostart automatically? Does it do programmatically? No, these apps has been on whitelist by vendor (xiaomi, asus, etc). Other popular apps like Slack is not in whitelist, so user must enable manually.
AFAIK, the only option on this case is:
Currently, there is no way to check if my app is already on autostart or not programmatically.
And the bad news is: my app is crash when showing autostart programmatically on xiaomi (it show autostart setting, but my app immediately crash although it already on autostart or not) 😦
Now app can receive when user kill app, but app run foreground, app IOS receive 2 notifications when server push 1 time??? Can you help me? @evollu