Browse Source

集成极光推送。

liujq 6 months ago
parent
commit
23a7f51e76
4 changed files with 14 additions and 0 deletions
  1. 7 0
      android/app/build.gradle
  2. 2 0
      lib/config/app_config.dart
  3. 3 0
      lib/network/my_api.dart
  4. 2 0
      pubspec.yaml

+ 7 - 0
android/app/build.gradle

@@ -47,6 +47,13 @@ android {
47
         versionCode flutterVersionCode.toInteger()
47
         versionCode flutterVersionCode.toInteger()
48
         versionName flutterVersionName
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
 //        ndk {
57
 //        ndk {
51
 //            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
58
 //            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
52
 //        }
59
 //        }

+ 2 - 0
lib/config/app_config.dart

@@ -1,4 +1,5 @@
1
 import 'package:lszlgl/plugin/flavor_plugin.dart';
1
 import 'package:lszlgl/plugin/flavor_plugin.dart';
2
+import 'package:lszlgl/service/jgpush_service.dart';
2
 import 'package:package_info_plus/package_info_plus.dart';
3
 import 'package:package_info_plus/package_info_plus.dart';
3
 
4
 
4
 import '../network/my_api.dart';
5
 import '../network/my_api.dart';
@@ -27,6 +28,7 @@ class AppConfig {
27
 
28
 
28
     /// 初始化网络请求
29
     /// 初始化网络请求
29
     MyApi.init(env);
30
     MyApi.init(env);
31
+    JGPushService.jgInit(env);
30
   }
32
   }
31
 
33
 
32
   /// 初始化环境
34
   /// 初始化环境

+ 3 - 0
lib/network/my_api.dart

@@ -9,6 +9,9 @@ class MyApi {
9
   /// 生产url
9
   /// 生产url
10
   static String productUrl = 'http://121.36.17.6:39099';
10
   static String productUrl = 'http://121.36.17.6:39099';
11
 
11
 
12
+  /// 紫光正式
13
+  //static String productUrl = 'http://101.36.160.117:39099';
14
+
12
   /// 测试url
15
   /// 测试url
13
   static String testUrl = 'http://121.36.17.6:19090';
16
   static String testUrl = 'http://121.36.17.6:19090';
14
 
17
 

+ 2 - 0
pubspec.yaml

@@ -95,6 +95,8 @@ dependencies:
95
   sqlite3_flutter_libs: ^0.5.0
95
   sqlite3_flutter_libs: ^0.5.0
96
   # 打开系统设置
96
   # 打开系统设置
97
   app_settings: ^5.1.1
97
   app_settings: ^5.1.1
98
+  # 极光推送
99
+  jpush_flutter: 3.0.3
98
 
100
 
99
 dev_dependencies:
101
 dev_dependencies:
100
   flutter_test:
102
   flutter_test: