It is my first time to use FCM.I use Android device.
When I exit my app which does not run in the background ,I send some notification to my device.When I reopen my app,I can`t get any notification which I send before.
So is it normal for FCM? If it`s normal,how can I know my message real reach the device? If it is not normal,what should I do?
I use the FCM Sample which I download from official github.I can get notification successfully when app is active or run in the background.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.firebase.quickstart.fcm">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name="com.google.firebase.quickstart.fcm.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- [START firebase_service] -->
<service android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- [END firebase_service] -->
<!-- [START firebase_iid_service] -->
<service android:name=".MyFirebaseInstanceIDService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<!-- [END firebase_iid_service] -->
<service android:name=".RegistrationIntentService" />
</application>
</manifest>
This is what I send
{
"notification" : {
"body" : "fsdf19",
"title" : "fsdfsd"
},
"data":{
"body":"adfadffdasdfafasdfasf",
"title":"asdfadfaf"
}
"priority":"high",
"registration_ids" : ["dVWKLIPn7J4:APA91bFv1U5IG8-YOrjNsWIDJsj4sCACGOi-f6FRv4ebr-fhQIT1wL6yzyVoK3rMIAfXAYpj2qkumvqf1pqwtIcv18MDdFtt_RCge-t0acN15htbEd_EAHmU41lGHaVAbq_g_58sDewy"]
}