Ray Zhang 7 éve
szülő
commit
5e7ebcaf0f
24 módosított fájl, 49 hozzáadás és 10 törlés
  1. 1 1
      ApexDrivers/apexcrm/build.gradle
  2. BIN
      ApexDrivers/apexcrm/src/main/ic_launcher-web.png
  3. 32 4
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/MainActivity.java
  4. 7 0
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/RAJSInterface.java
  5. 3 3
      ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/dataProvider/DataProvider.java
  6. BIN
      ApexDrivers/apexcrm/src/main/res/drawable/ic_notification_large.png
  7. 1 1
      ApexDrivers/apexcrm/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  8. 1 1
      ApexDrivers/apexcrm/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  9. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher.png
  10. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
  11. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher_round.png
  12. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher.png
  13. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
  14. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher_round.png
  15. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher.png
  16. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
  17. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  18. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher.png
  19. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
  20. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  21. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  22. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
  23. BIN
      ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  24. 4 0
      ApexDrivers/apexcrm/src/main/res/values/ic_launcher_background.xml

+ 1 - 1
ApexDrivers/apexcrm/build.gradle

@@ -17,7 +17,7 @@ android {
         minSdkVersion 23
         targetSdkVersion 26
         versionCode 1
-        versionName "1.11.40511"
+        versionName "1.16.40511"
 
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 

BIN
ApexDrivers/apexcrm/src/main/ic_launcher-web.png


+ 32 - 4
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/MainActivity.java

@@ -165,7 +165,8 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
                 try {
                     JSONObject notificationobj = new JSONObject(notifistr);
                     notificationobj.put("launch_app",true);
-                    Notificationstr = notificationobj.toString();
+                    launchNotificationstr = notificationobj.toString();
+//                    Notificationstr = notificationobj.toString();
                     intent.removeExtra("aps");
                 } catch (JSONException e) {
                     e.printStackTrace();
@@ -1317,7 +1318,29 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
 //                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
         public void RequestAppInfo(String msg) {
@@ -1521,6 +1544,10 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
         mWebView.evaluateJavascript(js, new ValueCallback<String>() {
             @Override
             public void onReceiveValue(String value) {
+                if(value.equals("success"))
+                {
+                    MainActivity.this.Notificationstr = null;
+                }
                 Log.d(TAG, "onReceiveValue: " + value);
             }
         });
@@ -1552,7 +1579,7 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
             // 否则立即处理通知
             if (!loading) {
                 handleNotificationByJS(Notificationstr);
-                this.Notificationstr = null;
+
             }
         }
         setIntent(intent);
@@ -1561,6 +1588,7 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
 //    private int notificationId = -1;
 
     String Notificationstr=null;
+    String launchNotificationstr=null;
     @Override
     protected void onStart() {
         super.onStart();
@@ -1575,7 +1603,7 @@ public class MainActivity extends AppCompatActivity implements RAWebView.WebView
             // 否则立即处理通知
             if (!loading) {
                 handleNotificationByJS(Notificationstr);
-                this.Notificationstr = null;
+//                this.Notificationstr = null;
             }
         }
     }

+ 7 - 0
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/RAJSInterface.java

@@ -23,6 +23,7 @@ public class RAJSInterface extends Object {
         void SelectContact(String msg);
 //        void RequestAppVersion(String msg);
         void RequestAppInfo(String msg);
+        void QueryLaunchNotification(String msg);
         void CleanCache(String msg);
         String FileBase64(String msg);
         void Login(String user, String password);
@@ -156,6 +157,12 @@ public class RAJSInterface extends Object {
 //            delegate.RequestAppVersion(msg);
 //        }
 //    }
+@android.webkit.JavascriptInterface
+public void QueryLaunchNotification(String msg) {
+    if (delegate != null) {
+        delegate.QueryLaunchNotification(msg);
+    }
+}
     @android.webkit.JavascriptInterface
     public void requestApplicationInfo(String msg) {
         if (delegate != null) {

+ 3 - 3
ApexDrivers/apexcrm/src/main/java/com/usai/apex/apexcrm/dataProvider/DataProvider.java

@@ -23,9 +23,9 @@ public class DataProvider {
     public static final int PUSH_TIME_OUT_INTERVAL = 5 * 1000;
     // region URL
 
-//    private static final String URL_PULL_NOTIFICATION = "http://192.168.1.108:8081/j/crm/mobile/getAndroidNotifications.mo/";
-//    private static final String URL_UPLOAD_DEVICEID = "http://192.168.1.108:8081/j/crm/mobile/token.mo/";
-//private static final String URL_LOGIN = "http://192.168.1.108:8081/j/crm/mobile/login";
+//    public static final String URL_PULL_NOTIFICATION = "http://192.168.1.108:8081/j/crm/mobile/getAndroidNotifications.mo/";
+//    public static final String URL_UPLOAD_DEVICEID = "http://192.168.1.108:8081/j/crm/mobile/token.mo/";
+//    public static final String URL_LOGIN = "http://192.168.1.108:8081/j/crm/mobile/login";
 
     public static final String URL_PULL_NOTIFICATION = "https://ra.apexshipping.com/apexcrm/crm/mobile/getAndroidNotifications.mo/";
     public static final String URL_UPLOAD_DEVICEID = "https://ra.apexshipping.com/apexcrm/crm/mobile/token.mo/";

BIN
ApexDrivers/apexcrm/src/main/res/drawable/ic_notification_large.png


+ 1 - 1
ApexDrivers/apexcrm/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
-    <background android:drawable="@drawable/ic_launcher_background"/>
+    <background android:drawable="@color/ic_launcher_background"/>
     <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
 </adaptive-icon>

+ 1 - 1
ApexDrivers/apexcrm/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
-    <background android:drawable="@drawable/ic_launcher_background"/>
+    <background android:drawable="@color/ic_launcher_background"/>
     <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
 </adaptive-icon>

BIN
ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-hdpi/ic_launcher_round.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-mdpi/ic_launcher_round.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xhdpi/ic_launcher_round.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxhdpi/ic_launcher_round.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png


BIN
ApexDrivers/apexcrm/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png


+ 4 - 0
ApexDrivers/apexcrm/src/main/res/values/ic_launcher_background.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="ic_launcher_background">#FFFFFF</color>
+</resources>