From bccc1ba887603b8577c01ee5b885bffa0d406028 Mon Sep 17 00:00:00 2001 From: Simon MacDonald Date: Tue, 22 Nov 2016 11:06:48 -0500 Subject: [PATCH] Fix rebase errors --- .../com/adobe/phonegap/push/PushPlugin.java | 68 ++++--------------- 1 file changed, 12 insertions(+), 56 deletions(-) diff --git a/src/android/com/adobe/phonegap/push/PushPlugin.java b/src/android/com/adobe/phonegap/push/PushPlugin.java index ecc4b9623..0f74d49ce 100644 --- a/src/android/com/adobe/phonegap/push/PushPlugin.java +++ b/src/android/com/adobe/phonegap/push/PushPlugin.java @@ -59,6 +59,7 @@ public void run() { Log.v(LOG_TAG, "execute: data=" + data.toString()); SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); + String token = null; String senderID = null; try { @@ -224,8 +225,6 @@ public void run() { callbackContext.success(); } catch (JSONException e) { callbackContext.error(e.getMessage()); - } catch (IOException e) { - callbackContext.error(e.getMessage()); } } }); @@ -239,8 +238,6 @@ public void run() { callbackContext.success(); } catch (JSONException e) { callbackContext.error(e.getMessage()); - } catch (IOException e) { - callbackContext.error(e.getMessage()); } } }); @@ -343,52 +340,20 @@ private void clearAllNotifications() { notificationManager.cancelAll(); } - /** - * Transform `topic name` to `topic path` - * Normally, the `topic` inputed from end-user is `topic name` only. - * We should convert them to GCM `topic path` - * Example: - * when topic name = 'my-topic' - * then topic path = '/topics/my-topic' - * - * @param String topic The topic name - * @return The topic path - */ - private String getTopicPath(String topic) { - if (topic.startsWith("/topics/")) { - return topic; - } else if (topic.startsWith("/topic/")) { - return topic.replace("/topic/", "/topics/"); - } else { - return "/topics/" + topic; - } - } - - private void subscribeToTopics(JSONArray topics, String registrationToken) throws IOException { + private void subscribeToTopics(JSONArray topics, String registrationToken) { if (topics != null) { String topic = null; for (int i=0; i