code: private static void storeRegistrationId(Context context, String regId) {
          final int appVersion = GcmUtils.getAppVersion(context);
          Logger.d("Saving regId on app version " + appVersion);
  
          final SharedPreferences.Editor editor = getGcmPreferences(context).edit();
          editor.putString(PROPERTY_REG_ID, regId);
          editor.putInt(PROPERTY_APP_VERSION, appVersion);
          editor.apply();
      }
docs: Stores the registration ID and the app versionCode in the application's
  {@code SharedPreferences}.
  
  @param context application's context.
  @param regId   registration ID