浏览代码

[add] JPush

x 5 年之前
父节点
当前提交
0c4fdc1bbe
共有 1 个文件被更改,包括 21 次插入0 次删除
  1. 21 0
      src/libs/jpush.js

+ 21 - 0
src/libs/jpush.js

@@ -0,0 +1,21 @@
+const JPush = {
+  init: function() {
+    try {
+      if (window.JPush) {
+        window.JPush.init();
+        window.JPush.setDebugMode(true);
+
+        // if (device.platform != "Android") {
+        //   window.JPush.setApplicationIconBadgeNumber(0);
+        // }
+        console.log("JPush init success !");
+      } else {
+        console.log("JPush is not defined !");
+      }
+    } catch (exception) {
+      console.log("Jpsuh init faield ! exception: ", exception);
+    }
+  }
+};
+
+export default JPush;