java - GCM android client not working -


i'm trying use gcm receive messages our server when user not in app.

the porblem gcmlistenerservice doesn't seem work whilst registeration works fine. our server should working fine since receive confirmation gcm server every time send our server gcm.

this manifest (only gcm section)

<receiver     android:name="com.google.android.gms.gcm.gcmreceiver"     android:exported="false"     android:permission="com.google.android.c2dm.permission.send">     <intent-filter>         <action android:name="com.google.android.c2dm.intent.receive"/>         <category android:name="my.package.package"/>     </intent-filter>      <intent-filter>         <action android:name="com.google.android.c2dm.intent.registration"/>         <category android:name="my.package.package"/>     </intent-filter> </receiver>  <service     android:name=".services.mygcmlistenerservice"     android:exported="false">     <intent-filter>         <action android:name="com.google.android.c2dm.intent.receive"/>     </intent-filter> </service>  <service     android:name=".services.mygcmregisterationservice"     android:exported="false">     <intent-filter>         <action android:name="com.google.android.gms.iid.instanceid"/>     </intent-filter> </service> 

and simplified onmessagereceived

@override public void onmessagereceived(string from, bundle data) {     savedatatodatabase(data);     datareceivednotification(); } 

i managed resolve this.

i had

<uses-permission android:name="com.google.android.c2dm.permission.send" /> 

twice in android manifest , missing

<uses-permission android:name="com.google.android.c2dm.permission.receive" /> 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -