Closed wangjianpeng closed 2 years ago
I found a few problems with this issue:
Hi @wangjianpeng, I tried using the code snippet you've provided in our Firebase quickstarts. Here's the results:
android:priority=-500
on intent filters
onMessageReceived
is called.android:priority=-500
on intent filterscom.google.firebase.iid.FirebaseInstanceIdReceiver
as receiver
Unfortunately, I'm unable to reproduce the same behavior that you're experiencing. Could you provide a minimal repro of this issue? Thanks.
May I also ask why are you adding com.google.firebase.iid.FirebaseInstanceIdReceiver
as receiver?
@argzdev thank you for your reply. and you should add android:process=":light" to the manifest for secondary process with FCM. because I want to reduce the following ANR:
Reason: Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.redtech.hivisualer cmp=com.redtech.hivisualer/com.google.firebase.iid.FirebaseInstanceIdReceiver (has extras) }
I have google too many and find the solution from this blog reduce ANR,but when I modify my manifest with android:process ,onMessageReceived
was not called, FCM didn't work as before.
my project was attached in the below:
hivisualer.zip
Hello @wangjianpeng, thanks for the minimal repro. From what I've tested, I'm still experiencing the same issue (I'm not able to receive any notifications) with your app.
I understand that you're trying to lessen the ANRs in your app, however this type of experimental configuration is not officially documented, hence is not supported.
As to quote from the blog:
There are no official guides or documentation on how to do this and potentially it can be broken at any point in the future.
Unfortunately, there's not much I can do since I don't think the current versions of FCM supports this type of setup. That being said, I'll be closing this now.
As mentioned, this is not officially supported, but I will note that your app-specific FirebaseMessagingService (HiVisualerFCMService) should probably be using the default priority (nothing specifically set in the manifest) instead of being set at -500 priority.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
I found many ANR that related with "Reason: Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x1000010 pkg=com.redtech.hivisualer cmp=com.redtech.hivisualer/com.google.firebase.iid.FirebaseInstanceIdReceiver (has extras) }" . someone said if set FCM Service to seondary process in the manifest , this ANR will be reduced ,So I try this method ,but onMessageReceived was never called when I push msg to my android device, notification icon was not shown on my phone too.
Relevant Code: