notifications - how to get regID using pushwoosh android native SDK -


i using pushwoosh android native sdk push notifications. want reuse regid provided gcm on successful registration. how can regid using android native sdk ?

when regid gcm registration, store in sharedpreferences access later.

to store it

googlecloudmessaging gcm = googlecloudmessaging.getinstance(getapplicationcontext()); string regid = gcm.register(id); sharedpreferences shp = getapplicationcontext().getsharedpreferences("prefkey",         getapplicationcontext().mode_private); shp.edit().putstring("regid",regid).commit(); 

to it

sharedpreferences shp = getapplicationcontext().getsharedpreferences("prefkey",         getapplicationcontext().mode_private); if (shp != null && shp.contains("regid"))     regid = shp.getstring("regid", null); 

Comments

Popular posts from this blog

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

javascript - Can Piwik report referrer in real time? -