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

Commit

Permalink
Issue #295: data.registrationId is empty string "" on register event …
Browse files Browse the repository at this point in the history
…callback
  • Loading branch information
macdonst committed Nov 2, 2015
1 parent 5846757 commit 1ab47d8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/android/com/adobe/phonegap/push/PushPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,15 @@ else if (!savedSenderID.equals(senderID)) {
token = sharedPref.getString(REGISTRATION_ID, "");
}

JSONObject json = new JSONObject().put(REGISTRATION_ID, token);
if (!"".equals(token)) {
JSONObject json = new JSONObject().put(REGISTRATION_ID, token);

Log.v(LOG_TAG, "onRegistered: " + json.toString());
Log.v(LOG_TAG, "onRegistered: " + json.toString());

PushPlugin.sendEvent( json );
PushPlugin.sendEvent( json );
} else {
callbackContext.error("Empty registration ID received from GCM");
}
} catch (JSONException e) {
Log.e(LOG_TAG, "execute: Got JSON Exception " + e.getMessage());
callbackContext.error(e.getMessage());
Expand Down

0 comments on commit 1ab47d8

Please sign in to comment.