From c18dcee63830d9e3d5c6cae78134a35951700f35 Mon Sep 17 00:00:00 2001 From: Dan Galpin Date: Sun, 24 May 2015 23:57:47 -0700 Subject: [PATCH] Switched to using the Google Developer lingo for project number. --- .../android/sunshine/app/MainActivity.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/example/android/sunshine/app/MainActivity.java b/app/src/main/java/com/example/android/sunshine/app/MainActivity.java index 07068f5..deee6f9 100644 --- a/app/src/main/java/com/example/android/sunshine/app/MainActivity.java +++ b/app/src/main/java/com/example/android/sunshine/app/MainActivity.java @@ -46,10 +46,10 @@ public class MainActivity extends ActionBarActivity implements ForecastFragment. private static final String PROPERTY_APP_VERSION = "appVersion"; /** - * Substitute you own sender ID here. This is the project number you got - * from the API Console. + * Substitute you own project number here. This project number comes + * from the Google Developers Console. */ - String SENDER_ID = "Your-Sender-ID"; + static final String PROJECT_NUMBER = "Your Project Number"; private boolean mTwoPane; private String mLocation; @@ -91,10 +91,10 @@ public class MainActivity extends ActionBarActivity implements ForecastFragment. mGcm = GoogleCloudMessaging.getInstance(this); String regId = getRegistrationId(this); - if (SENDER_ID.equals("Your-Sender-ID")) { + if (PROJECT_NUMBER.equals("Your Project Number")) { new AlertDialog.Builder(this) - .setTitle("Needs Sender ID") - .setMessage("GCM will not function in Sunshine until you replace your Sender ID with a Sender ID from the Google Developers Console.") + .setTitle("Needs Project Number") + .setMessage("GCM will not function in Sunshine until you set the Project Number to the one from the Google Developers Console.") .setPositiveButton(android.R.string.ok, null) .create().show(); } else if (regId.isEmpty()) { @@ -263,7 +263,7 @@ public class MainActivity extends ActionBarActivity implements ForecastFragment. if (mGcm == null) { mGcm = GoogleCloudMessaging.getInstance(context); } - String regId = mGcm.register(SENDER_ID); + String regId = mGcm.register(PROJECT_NUMBER); msg = "Device registered, registration ID=" + regId; // You should send the registration ID to your server over HTTP, @@ -279,7 +279,7 @@ public class MainActivity extends ActionBarActivity implements ForecastFragment. storeRegistrationId(context, regId); } catch (IOException ex) { msg = "Error :" + ex.getMessage(); - // TODO(joannasmith): If there is an error, don't just keep trying to register. + // TODO: If there is an error, don't just keep trying to register. // Require the user to click a button again, or perform // exponential back-off. }