Commit c3b2c718 authored by Libin Lu's avatar Libin Lu

fix java warning

parent 59e22454
...@@ -238,14 +238,13 @@ public class FIRLocalMessagingHelper { ...@@ -238,14 +238,13 @@ public class FIRLocalMessagingHelper {
//store intent //store intent
SharedPreferences.Editor editor = sharedPreferences.edit(); SharedPreferences.Editor editor = sharedPreferences.edit();
JSONObject json = null;
try { try {
json = BundleJSONConverter.convertToJSON(bundle); JSONObject json = BundleJSONConverter.convertToJSON(bundle);
editor.putString(notificationId, json.toString());
editor.apply();
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} }
editor.putString(notificationId, json.toString());
editor.apply();
} }
public void cancelLocalNotification(String notificationId) { public void cancelLocalNotification(String notificationId) {
......
...@@ -144,7 +144,7 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li ...@@ -144,7 +144,7 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li
Map<String, String> data = message.getData(); Map<String, String> data = message.getData();
Set<String> keysIterator = data.keySet(); Set<String> keysIterator = data.keySet();
for(String key: keysIterator){ for(String key: keysIterator){
params.putString(key, (String) data.get(key)); params.putString(key, data.get(key));
} }
} }
sendEvent("FCMNotificationReceived", params); sendEvent("FCMNotificationReceived", params);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment