I am learning how to send and receive push notifications via GCM, I followed this tutorial
and there is a class called GCMRegistrationIntentService posted below. concerning the following line:
InstanceID instanceID = InstanceID.getInstance(getApplicationContext());
//Getting the token from the instance id
token = instanceID.getToken(getString(R.string.gcm_defaultSenderId), GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
what is R.string.gcm_defaultSenderId)? I tried to find it in strings.xml, but such an entry was not available
could please clarify and explain?
You can use FirebaseInstanceIdService to get token.. like bellow
Don't forget to add bellow code to andoridmainfest.xml