I need to get device Google messaging registration ID from service. however, when I call
GCMRegistrar.getRegistrationId(this)
from service, it complain that GCMRegistrar.getRegistrationId(service) is not applicable.
Is there away to get device registartion ID from a service.
Yes, but you’ll have to do it in a different way. Assuming your device is already registered, you can change your Service constructor to take Context as a parameter. That way your service will have the correct application context to pass to GCMRegistrar. If your service is bound, then you could always use ContextWrapper to get the same result.