Browse Source

极光推送,添加测试环境。

liujq 6 months ago
parent
commit
719e68342d
2 changed files with 16 additions and 8 deletions
  1. 14 8
      android/app/build.gradle
  2. 2 0
      lib/config/app_config.dart

+ 14 - 8
android/app/build.gradle

@@ -47,12 +47,6 @@ android {
47 47
         versionCode flutterVersionCode.toInteger()
48 48
         versionName flutterVersionName
49 49
 
50
-        // 极光
51
-        manifestPlaceholders = [
52
-                JPUSH_PKGNAME : "com.szls.lszlgl",
53
-                JPUSH_APPKEY : "bdf569ea1c5774d48b55c4c8",
54
-                JPUSH_CHANNEL : "developer-default",
55
-        ]
56 50
 
57 51
 //        ndk {
58 52
 //            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
@@ -109,12 +103,24 @@ android {
109 103
     productFlavors {
110 104
         develop {
111 105
             dimension "default"
112
-            manifestPlaceholders = [APP_NAME: "国粮质检-测试"]
106
+            manifestPlaceholders = [
107
+                    APP_NAME     : "国粮质检-测试",
108
+                    // 极光 注意测试环境的 packagename 和appkey 均不一样
109
+                    JPUSH_PKGNAME: "com.szls.lszlgl.debug",
110
+                    JPUSH_APPKEY : "2f42e3db4d0083b0bc5a3f6c",
111
+                    JPUSH_CHANNEL: "developer-default"
112
+            ]
113 113
             applicationIdSuffix ".debug"
114 114
         }
115 115
         product {
116 116
             dimension "default"
117
-            manifestPlaceholders = [APP_NAME: "国粮质检"]
117
+            manifestPlaceholders = [
118
+                    APP_NAME     : "国粮质检",
119
+                    // 极光 注意测试环境的 packagename 和appkey 均不一样
120
+                    JPUSH_PKGNAME: "com.szls.lszlgl",
121
+                    JPUSH_APPKEY : "???", // 正式环境appkey需要再申请
122
+                    JPUSH_CHANNEL: "developer-default"
123
+            ]
118 124
         }
119 125
     }
120 126
 

+ 2 - 0
lib/config/app_config.dart

@@ -28,6 +28,8 @@ class AppConfig {
28 28
 
29 29
     /// 初始化网络请求
30 30
     MyApi.init(env);
31
+
32
+    /// 初始化极光推送
31 33
     JGPushService.jgInit(env);
32 34
   }
33 35