Xiaomi didn't receive notification on killed although enable autostart in miui
See original GitHub issueThis behavior is Xiaomi only (tested to MIUI 8). When I test on other non-Xiaomi devices, it has no problem.
I already enable autostart on my app, add “lock” to app, enable app notification, and restart device. But it still didn’t receive notification. But other apps like WhatsApp is receive notification although it has been killed. Maybe the problem is on react-native-fcm itself?
This is my AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.foobar"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="1"
android:versionName="1.0">
...
<!-- compatible with tab -->
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<!-- /compatible with tab -->
<!-- react-native-fcm -->
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- /react-native-fcm -->
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:largeHeap="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<!-- react-native-fcm -->
<service android:name="com.evollu.react.fcm.MessagingService" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:name="com.evollu.react.fcm.InstanceIdService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<receiver android:name="com.evollu.react.fcm.FIRLocalMessagingPublisher" />
<receiver android:enabled="true" android:exported="true" android:name="com.evollu.react.fcm.FIRSystemBootEventReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON"/>
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<!-- /react-native-fcm -->
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="sensorPortrait"
android:launchMode="singleTask"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- react-native-fcm -->
<intent-filter>
<action android:name="fcm.ACTION.HELLO" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- /react-native-fcm -->
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to fix MIUI push notifications - Android Central
Tap Autostart. Choose the apps that aren't sending push notifications. Toggle the slider to ensure the apps always start in the background.
Read more >How To Fix Push Notifications On Xiaomi's MIUI 8, For Real
2: Go to settings --> permissions --> autostart. From there, pick the apps you want to receive notifications, and toggle the switch to...
Read more >Xiaomi | Don't kill my app!
When you open the recent apps tray, drag your app downwards (it will be locked). So, even if you clear recent apps, it...
Read more >Xiaomi does not receive notification when application is not ...
If we want to receive notification if application is killed then we need to allow auto restart app manually from security app of...
Read more >MIUI Killing Apps : r/Xiaomi - Reddit
Some of my apps even when I enabled their autostart, set their battery ... However, some later, it's permanent notification will just ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You could try auto start feature of mi.
I have this issue. Xiaomi Redmi 5a and Redmi 4X push doesnt work with app closed. (With app in bg all works fine).
Some suggest to fix it?
PD: If on xiaomi phone go to Security>Permissions>Autostart and allow your app to autostart all works fine