code: private static String getRegistrationId(Context context) {
          final SharedPreferences prefs = getGcmPreferences(context);
          String registrationId = prefs.getString(PROPERTY_REG_ID, "");
          if (registrationId.isEmpty()) {
              return "";
          }
          // Check if app was updated; if so, it must clear the registration ID
          // since the existing regID is not guaranteed to work with the new
          // app version.
          int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
          int currentVersion = getAppVersion(context);
          if (registeredVersion != currentVersion) {
              return "";
          }
  
          if (OrtcClient.getOnRegistrationId() != null){
              OrtcClient.getOnRegistrationId().run(registrationId);
          }
  
          return registrationId;
      }
docs: Gets the current registration ID for application on GCM service, if there is one.
  <p>
  If result is empty, the app needs to register.
  
  @return registration ID, or empty string if there is no existing
  registration ID.