Xamarin Gcm Onmessagereceived Is Not Called
I implemented Xamarin Remote notification using this link, but I can't get messages from GCM. What did I miss? My ListenerService: [Service(Exported = false), IntentFilter(new[] {
Solution 1:
I find the solution. It's my mistake
<applicationandroid:label="MYAPP"android:icon="@drawable/Icon">/application>
<receiverandroid:name="com.google.android.gms.gcm.GcmReceiver"android:exported="true"android:permission="com.google.android.c2dm.permission.SEND"><intent-filter><actionandroid:name="com.google.android.c2dm.intent.RECEIVE" /><actionandroid:name="com.google.android.c2dm.intent.REGISTRATION" /><categoryandroid:name="MYPACKGAGE NAME" /></intent-filter></receiver></manifest>
it should be
<applicationandroid:label="MYAPP"android:icon="@drawable/Icon"><receiverandroid:name="com.google.android.gms.gcm.GcmReceiver"android:exported="true"android:permission="com.google.android.c2dm.permission.SEND"><intent-filter><actionandroid:name="com.google.android.c2dm.intent.RECEIVE" /><actionandroid:name="com.google.android.c2dm.intent.REGISTRATION" /><categoryandroid:name="MYPACKGAGE NAME" /></intent-filter></receiver></application></manifest>
application tag is parent of reciever
Solution 2:
Application tag is parent of Receiver at AndroidMenifest.xml !
For FCM and GCM are having the same case.
< application android:allowBackup="true" android:icon="@mipmap/icon" android:label="@string/app_name">
-- START Manual Firebase Additions --
< receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"...........................
-- END Manual Firebase Additions -- < / application>
Post a Comment for "Xamarin Gcm Onmessagereceived Is Not Called"