title: GCM Sender_ID not registering in Australia (getting an error - Invalid_Sender)
body: <p>Could a GCM registration with a specific sender id get a response "Invalid_Sender" for one country but in another country it would work?</p>
  
  <p>I am using a senderID that works in europe and the US but does not work in Australia, how could that be?</p>
  
  <p>I tried registering in Australia with a new SenderID that I opened and it works, but when trying with the old one it does not work, although it works in the US and some places I tried in Europe.</p>
  
  <p>Would greatly appreciate if someone knows anything about this.</p>
  
  <p>Thanks</p>
  
  <p>This is the methods I use to register:</p>
  
  <pre><code>public void startGCMRegistration() {
      if (checkPlayServices()) {
           mGCM = GoogleCloudMessaging.getInstance(this);
           String regId = getRegistrationId();
  
      if (regId.isEmpty()) {
             registerInBackground();
      } else {
             Logger.write("GCM startGCMRegistration(): Already registered. RegID: " + regId, null);
      }
      }
   }
  
  
  public boolean checkPlayServices() {
      boolean retVal = true;
      int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
      if (resultCode != ConnectionResult.SUCCESS) {
          retVal = false;
          if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
  
          } else {
  
          }
          Logger.write("GCM checkPlayServices(): This device does not support new GCM implementation.", null);
      }
      return retVal;
  }
  
  
  public String getRegistrationId() {
      final SharedPreferences prefs = getGCMPreferences(mContext);
      String registrationId = prefs.getString(PROPERTY_REG_ID, App.NULL);
      if (registrationId.isEmpty()) {
          Logger.write("GCM getRegistrationId() Registration not found.", null);
          return App.NULL;
      }
  
      int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
      int currentVersion = getAppVersion(mContext);
      if (registeredVersion != currentVersion) {
          Logger.write("GCM getRegistrationId() App version changed.", null);
          return App.NULL;
      }
      return registrationId;
  }
  
  private static int getAppVersion(Context context) {
      try {
          PackageInfo packageInfo = context.getPackageManager()
                  .getPackageInfo(context.getPackageName(), 0);
          return packageInfo.versionCode;
      } catch (NameNotFoundException e) {           
          throw new RuntimeException("GCM Could not get package name: " + e);
      }
  }
  
  
    private void registerInBackground() {
  
      new AsyncTask&lt;Void, Void, Void&gt;() {
          @Override
          protected Void doInBackground(Void... params) {
              try {
                  if (mGCM == null) {
                      mGCM = GoogleCloudMessaging.getInstance(mContext);
                  }
                  Logger.write("GCM registerInBackground(): SenderID: " + getSenderID(), null);
                  mGCM.unregister();
                  String regId = mGCM.register(getSenderID());
                  Logger.write("GCM registerInBackground: Successfully registered... RegistrationID:" + regId, null);
  
                  storeRegistrationId(mContext, regId);
  
              } catch (IOException ex) {
                  handleGcmError(ex);
              }
              return null;
          }
      }.execute();
  }
  
  
       public void storeRegistrationId(Context context, String regId) {
      final SharedPreferences prefs = getGCMPreferences(context);
      int appVersion = getAppVersion(context);
      Logger.write("GCM storeRegistrationId() Saving regId on app version " + appVersion, null);
      SharedPreferences.Editor editor = prefs.edit();
      editor.putString(PROPERTY_REG_ID, regId);
      editor.putInt(PROPERTY_APP_VERSION, appVersion);
      editor.commit();
  
  }
  
  
       private void handleGcmError(IOException ex) {
      String error = ex == null ? "" : ex.getMessage();
  
      Logger.write("GCM handleGcmError() error: " + error, null);
  
      if (App.getApp().isNetworkingAllowed()) {
          final int gcmRetryCounter = getGCMRetryCount();
          if (gcmRetryCounter &lt; GCM_RETRY_MAX_COUNT) {
              new Thread(new Runnable() {
                  @Override
                  public void run() {
                      sleepThread(60 * 1000);
                      Logger.write("GCM handleGcmError() retry counter = " + gcmRetryCounter, null);
  
                      startGCMRegistration();
                  }
              }).start();
          }
      }
  }
  </code></pre>