I want to implement GCM Client on Android.
Following the guide here
https://developers.google.com/cloud-messaging/android/client
I have downloaded the configuration file and copied the google-services.json file into the app/ directory of the project.
I have also added the dependencies in the project's build.gradle
classpath 'com.google.gms:google-services:1.3.0-beta1'
and plugin in the app level build.gradle
apply plugin: 'com.google.gms.google-services'
I have also included the Google Play Services SDK
compile 'com.google.android.gms:play-services:6.+'
I have also updated the AndroidManifest.xml file as shown here https://developers.google.com/cloud-messaging/android/client
To get the Registration Token, when I use the following code
InstanceID instanceID = InstanceID.getInstance(this);
Android Studio does not recognize the class. I get a "Cannot resolve symbol 'InstaceID'". Any reason as to why this is happening?
Update your Play services SDK to
compile 'com.google.android.gms:play-services:7.5.0'
Then clean your Project.
Worked for me. Hope it works for you too!
you are missing the gcm
add on your gradle:
compile "com.google.android.gms:play-services-gcm:10.2.6"
Basically, you have to use the latest version of the Google Play Services, Android Support Repository and Google Repository for this to work, and then include the latest version of the Google Play Services
compile 'com.google.android.gms:play-services:7.5.0'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With