Spi*_*ire 5 android firebase google-cloud-messaging firebase-cloud-messaging
我强行关闭应用程序(模拟)后收到推送消息时遇到问题.
现在,如果我发送推送消息,我会进入adb:
GCM-DMM : broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=THE_PACKAGE_NAME (has extras) }
Run Code Online (Sandbox Code Playgroud)
这来自com.google.android.gms.persistent服务
我试图创建一个adb命令来手动调试它,但它仍然无法正常工作
adb shell am broadcast -a com.google.android.c2dm.intent.RECEIVE -c THE_PACKAGE_NAME
Run Code Online (Sandbox Code Playgroud)
结果:
Broadcasting: Intent { act=com.google.android.c2dm.intent.RECEIVE cat=[THE_PACKAGE_NAME] }
Broadcast completed: result=0
Run Code Online (Sandbox Code Playgroud)
我猜这会导致结果= 0
AndroidManifest.xml中
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="THE_PACKAGE_NAME">
......
<application android:label="@string/app_name"
android:theme="@style/AlmanappTheme"
android:icon="@drawable/ic_launcher"
android:name="AppController">
....
<!-- [START firebase_service] -->
<service
android:exported="true"
android:name=".push.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<!-- [END firebase_service] -->
<!-- [START firebase_iid_service] -->
<service
android:name=".push.MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<!-- [END firebase_iid_service] -->
....
Run Code Online (Sandbox Code Playgroud)
我现在有点无能为力.
也许我需要添加一个<receiver或者是否有一些我看过的神奇方式?因为我无法想象没有办法不接收新消息
一些可能的想法:
| 归档时间: |
|
| 查看次数: |
916 次 |
| 最近记录: |