|
@@ -165,7 +165,8 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
|
|
|
try {
|
|
try {
|
|
|
JSONObject notificationobj = new JSONObject(notifistr);
|
|
JSONObject notificationobj = new JSONObject(notifistr);
|
|
|
notificationobj.put("launch_app",true);
|
|
notificationobj.put("launch_app",true);
|
|
|
- Notificationstr = notificationobj.toString();
|
|
|
|
|
|
|
+ launchNotificationstr = notificationobj.toString();
|
|
|
|
|
+// Notificationstr = notificationobj.toString();
|
|
|
intent.removeExtra("aps");
|
|
intent.removeExtra("aps");
|
|
|
} catch (JSONException e) {
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -1317,7 +1318,29 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
|
|
|
// e.printStackTrace();
|
|
// e.printStackTrace();
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
-
|
|
|
|
|
|
|
+@Override
|
|
|
|
|
+public void QueryLaunchNotification(String msg) {
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+// PackageManager pm = mCtx.getPackageManager();
|
|
|
|
|
+// PackageInfo pi = pm.getPackageInfo(mCtx.getApplicationContext().getPackageName(), 0);
|
|
|
|
|
+// String ver_name = pi.versionName;
|
|
|
|
|
+// int ver_code = pi.versionCode;
|
|
|
|
|
+// String appVer = "Ver:" + ver_name + " build " + ver_code;
|
|
|
|
|
+//
|
|
|
|
|
+// JSONObject appinfo= new JSONObject();
|
|
|
|
|
+// appinfo.put("appVer",appVer);
|
|
|
|
|
+// appinfo.put("appToken",DataProvider.getToken());
|
|
|
|
|
+// String strinfo=appinfo.toString();
|
|
|
|
|
+ JSONObject json = new JSONObject(msg);
|
|
|
|
|
+ String js = mJSInterface.returnToWebPage(json, launchNotificationstr);
|
|
|
|
|
+ evaluateJavaScript(js);
|
|
|
|
|
+ launchNotificationstr=null;
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void RequestAppInfo(String msg) {
|
|
public void RequestAppInfo(String msg) {
|
|
@@ -1521,6 +1544,10 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
|
|
|
mWebView.evaluateJavascript(js, new ValueCallback<String>() {
|
|
mWebView.evaluateJavascript(js, new ValueCallback<String>() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onReceiveValue(String value) {
|
|
public void onReceiveValue(String value) {
|
|
|
|
|
+ if(value.equals("success"))
|
|
|
|
|
+ {
|
|
|
|
|
+ MainActivity.this.Notificationstr = null;
|
|
|
|
|
+ }
|
|
|
Log.d(TAG, "onReceiveValue: " + value);
|
|
Log.d(TAG, "onReceiveValue: " + value);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1552,7 +1579,7 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
|
|
|
// 否则立即处理通知
|
|
// 否则立即处理通知
|
|
|
if (!loading) {
|
|
if (!loading) {
|
|
|
handleNotificationByJS(Notificationstr);
|
|
handleNotificationByJS(Notificationstr);
|
|
|
- this.Notificationstr = null;
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
setIntent(intent);
|
|
setIntent(intent);
|
|
@@ -1561,6 +1588,7 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
|
|
|
// private int notificationId = -1;
|
|
// private int notificationId = -1;
|
|
|
|
|
|
|
|
String Notificationstr=null;
|
|
String Notificationstr=null;
|
|
|
|
|
+ String launchNotificationstr=null;
|
|
|
@Override
|
|
@Override
|
|
|
protected void onStart() {
|
|
protected void onStart() {
|
|
|
super.onStart();
|
|
super.onStart();
|
|
@@ -1575,7 +1603,7 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
|
|
|
// 否则立即处理通知
|
|
// 否则立即处理通知
|
|
|
if (!loading) {
|
|
if (!loading) {
|
|
|
handleNotificationByJS(Notificationstr);
|
|
handleNotificationByJS(Notificationstr);
|
|
|
- this.Notificationstr = null;
|
|
|
|
|
|
|
+// this.Notificationstr = null;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|