Failed to resolve target intent service, Error while delivering the message: ServiceIntent not found

前端 未结 4 1247
予麋鹿
予麋鹿 2020-12-18 19:58

I try to make gcm work.

When our server sends a push notification I got these two errors in my app\'s log:

E/GcmReceiver(8049

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 20:37

    Hey You need to add MyGcmListenerService class for receive notification:

    public class MyGcmListenerService extends GcmListenerService {
    
    @Override
    public void onMessageReceived(String from, Bundle data) {
        String message = data.getString("message");
    }
    

    you need add this class as service in AndroidMaifest.xml

      
        
            
        
        
    

提交回复
热议问题