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 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
 //        ndk {
51 58
 //            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
52 59
 //        }

+ 2 - 0
lib/config/app_config.dart

@@ -1,4 +1,5 @@
1 1
 import 'package:lszlgl/plugin/flavor_plugin.dart';
2
+import 'package:lszlgl/service/jgpush_service.dart';
2 3
 import 'package:package_info_plus/package_info_plus.dart';
3 4
 
4 5
 import '../network/my_api.dart';
@@ -27,6 +28,7 @@ class AppConfig {
27 28
 
28 29
     /// 初始化网络请求
29 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 9
   /// 生产url
10 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 15
   /// 测试url
13 16
   static String testUrl = 'http://121.36.17.6:19090';
14 17
 

+ 2 - 0
pubspec.yaml

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