GCM not registering when changing package name with Gradle

后端 未结 2 1367
一生所求
一生所求 2021-01-15 20:23

In my regular build gcm works fine, but when I use flavors to change the com name things stop working. My IntentService is never being initialized. How should I set up my

2条回答
  •  日久生厌
    2021-01-15 20:57

    This was my solution:

    
     
    

    ...

    
        
            
                
                
    
                
            
        
    

    in my manifest and mybroadcastReceiver

    ...

       public class MyBroadcastReceiver extends GCMBroadcastReceiver
       {
        @Override
        protected String getGCMIntentServiceClassName(Context context)
        {
            return GCMIntentService.class.getName();
        }
        }
    

提交回复
热议问题