我在我的应用中使用Firebase进行聊天。但是当我发送一条消息时,我会收到一条通知。没关系。但是在2-3分钟后,我将逐一接收所有旧通知。这是我的接收代码。我删除了所有通知处理代码,但在此之后,我仍然反复收到通知: -
public class FirebaseNotificationReceiver extends WakefulBroadcastReceiver {
private final String NOTIFICATION_BODY_KEY = "gcm.notification.body";
@Override
public void onReceive(Context context, Intent intent) {
Log.e("NOTIFICATION RECEIVED", "RECEIVED");
}
in menifest:
<receiver
android:name=".firebase.FirebaseNotificationReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</receiver>