Last active
December 27, 2015 11:59
-
-
Save cirocosta/7322260 to your computer and use it in GitHub Desktop.
BAsic Implem MainActivity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onCreate(Bundle savedInstanceState){ | |
//... | |
if(checkPlayServices()){ | |
gcm = GoogleCloudMessaging.getInstance(this); | |
registration_id = getRegistrationId(context); | |
if(registration_id.equals("")){ | |
registerInBackground(); | |
} else { | |
// não foi encontrato APK Google Play Services | |
} | |
} | |
private String getRegistrationId(Context context){ | |
//Obtem REGID já obtido ... | |
regid = preferences.getString("key","default"); | |
if(nao_tem_regid){ | |
return ""; | |
} | |
return regid; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment