mirror of
https://github.com/jpush/jpush-phonegap-plugin.git
synced 2025-01-19 05:22:57 +08:00
修改点击通知的参数传递方式(android)
This commit is contained in:
parent
219ae72758
commit
70e2d6d9e2
@ -67,7 +67,14 @@ public class JPushPlugin extends CordovaPlugin {
|
||||
JSONObject data = new JSONObject();
|
||||
try {
|
||||
data.put("message", message);
|
||||
data.put("extras", new JSONObject(extras));
|
||||
JSONObject jExtras = new JSONObject();
|
||||
for(Entry<String,Object> entry:extras.entrySet()){
|
||||
jExtras.put(entry.getKey(),entry.getValue());
|
||||
}
|
||||
if(jExtras.length()>0)
|
||||
{
|
||||
data.put("extras", jExtras);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
|
||||
}
|
||||
@ -77,9 +84,16 @@ public class JPushPlugin extends CordovaPlugin {
|
||||
private static JSONObject openNotificationObject(String alert,
|
||||
Map<String, Object> extras){
|
||||
JSONObject data = new JSONObject();
|
||||
try {
|
||||
try{
|
||||
data.put("alert", alert);
|
||||
data.put("extras", new JSONObject(extras));
|
||||
JSONObject jExtras = new JSONObject();
|
||||
for(Entry<String,Object> entry:extras.entrySet()){
|
||||
jExtras.put(entry.getKey(),entry.getValue());
|
||||
}
|
||||
if(jExtras.length()>0)
|
||||
{
|
||||
data.put("extras", jExtras);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user