inloop / easygcm

Android Library for easy GCM integration in few lines of code.
Apache License 2.0
261 stars 43 forks source link

Getting it to work not as simple as expected, or documentation issue? #66

Open polaski opened 8 years ago

polaski commented 8 years ago

Maybe it's just me, but I had to try all kinds of things to get this to work properly. First of all, the init command in the README file didn't even work. I already made one pull request that updated the init command.

Also, even before reaching this point I had to spend some time figuring out how to get it to build correctly. More specifically, I had to:

  1. add classpath 'com.google.gms:google-services:1.5.0-beta2' to root gradle file
  2. add apply plugin: 'com.google.gms.google-services' to module gradle file, and compile 'com.google.android.gms:play-services-gcm:8.3.0' under dependencies.

Are these simply not documented on README, or did I miss something?

Epholl commented 8 years ago

Hello @polaski , I have checked your pull request and the comments. The missing classpath, plugin and dependency are not in the readme, has to and will be fixed. However, from the way you suggest using EasyGcm.setGcmListener(this) instead of EasyGcm.init(Context context) in your pull request, it seems you might be implementing the GcmListener in a different place than the readme suggests. The EasyGcm.setGcmListener(GcmListener listener) needs you to pass an object implementing the interface whereas EasyGcm.init(Context context) requires you to implement the GcmListener in your Application class. What is the structure of the application you are using easygcm with?