From c3b2c718cdcbaeae059e5d582b58690e8147dc5d Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Fri, 30 Sep 2016 17:52:39 -0400 Subject: [PATCH] fix java warning --- .../java/com/evollu/react/fcm/FIRLocalMessagingHelper.java | 7 +++---- .../main/java/com/evollu/react/fcm/FIRMessagingModule.java | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java index cb2faa7..befe106 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRLocalMessagingHelper.java @@ -238,14 +238,13 @@ public class FIRLocalMessagingHelper { //store intent SharedPreferences.Editor editor = sharedPreferences.edit(); - JSONObject json = null; try { - json = BundleJSONConverter.convertToJSON(bundle); + JSONObject json = BundleJSONConverter.convertToJSON(bundle); + editor.putString(notificationId, json.toString()); + editor.apply(); } catch (JSONException e) { e.printStackTrace(); } - editor.putString(notificationId, json.toString()); - editor.apply(); } public void cancelLocalNotification(String notificationId) { diff --git a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java index 6f62c54..ae0322c 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java @@ -144,7 +144,7 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li Map data = message.getData(); Set keysIterator = data.keySet(); for(String key: keysIterator){ - params.putString(key, (String) data.get(key)); + params.putString(key, data.get(key)); } } sendEvent("FCMNotificationReceived", params); -- 2.26.2