Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Issue #291: Reregister on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Nov 2, 2015
1 parent 180c241 commit 5846757
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/android/com/adobe/phonegap/push/PushPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,18 @@ public void run() {
try {
InstanceID.getInstance(getApplicationContext()).deleteInstanceID();
Log.v(LOG_TAG, "UNREGISTER");

// Remove shared prefs
SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.remove(SOUND);
editor.remove(VIBRATE);
editor.remove(CLEAR_NOTIFICATIONS);
editor.remove(FORCE_SHOW);
editor.remove(SENDER_ID);
editor.remove(REGISTRATION_ID);
editor.commit();

callbackContext.success();
} catch (IOException e) {
Log.e(LOG_TAG, "execute: Got JSON Exception " + e.getMessage());
Expand Down

0 comments on commit 5846757

Please sign in to comment.