Bladeren bron

change jpush appid

x1ongzhu 6 jaren geleden
bovenliggende
commit
d220a9b0ea
3 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 1 1
      android/app/build.gradle
  2. 2 4
      lib/main.dart
  3. 3 1
      lib/pages/HomePage.dart

+ 1 - 1
android/app/build.gradle

@@ -45,7 +45,7 @@ android {
         multiDexEnabled true
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         ndk {
         ndk {
-            // abiFilters 'armeabi-v7a'
+            abiFilters 'armeabi-v7a'
         }
         }
         manifestPlaceholders = [
         manifestPlaceholders = [
                 JPUSH_PKGNAME: applicationId,
                 JPUSH_PKGNAME: applicationId,

+ 2 - 4
lib/main.dart

@@ -70,22 +70,20 @@ Future<void> main() async {
   await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
   await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
   final JPush jpush = JPush();
   final JPush jpush = JPush();
   jpush.setup(
   jpush.setup(
-    appKey: '868cc9036e14c71e2b698f46',
+    appKey: '52209c854c4d7bfc14c0e60b',
     channel: 'theChannel',
     channel: 'theChannel',
     production: true,
     production: true,
     debug: true,
     debug: true,
   );
   );
   jpush.applyPushAuthority(NotificationSettingsIOS(sound: true, alert: true, badge: true));
   jpush.applyPushAuthority(NotificationSettingsIOS(sound: true, alert: true, badge: true));
   final prefs = await SharedPreferences.getInstance();
   final prefs = await SharedPreferences.getInstance();
-  print(prefs.getString('token'));
   HttpManager.token = prefs.getString('token') ?? '';
   HttpManager.token = prefs.getString('token') ?? '';
   Result result = await HttpManager.get('userInfo/getUserInfo');
   Result result = await HttpManager.get('userInfo/getUserInfo');
   AppState state = AppState.empty();
   AppState state = AppState.empty();
   if (result.success && result.data != null) {
   if (result.success && result.data != null) {
     UserInfo userInfo = UserInfo.fromJson(result.data);
     UserInfo userInfo = UserInfo.fromJson(result.data);
     state.userInfo = userInfo;
     state.userInfo = userInfo;
-     FlutterBugly.setUserId("user id");
-    // jpush.setAlias(userInfo.id.toString()).then((map) {});
+    jpush.setAlias(userInfo.id.toString()).then((map) {});
   }
   }
   final Store<AppState> store = Store<AppState>(appReducer, initialState: state);
   final Store<AppState> store = Store<AppState>(appReducer, initialState: state);
 
 

+ 3 - 1
lib/pages/HomePage.dart

@@ -17,6 +17,7 @@ import '../redux/AppState.dart';
 import 'Setting.dart';
 import 'Setting.dart';
 import '../widget/Dialog.dart';
 import '../widget/Dialog.dart';
 import '../pages/openRoom.dart';
 import '../pages/openRoom.dart';
+import 'package:flutter_bugly/flutter_bugly.dart';
 
 
 class HomePage extends StatefulWidget {
 class HomePage extends StatefulWidget {
   @override
   @override
@@ -352,7 +353,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                       //     pageBuilder: (BuildContext context, _, __) {
                       //     pageBuilder: (BuildContext context, _, __) {
                       //       return CreateRoom();
                       //       return CreateRoom();
                       //     }));
                       //     }));
-                      Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomList()));
+                      // Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomList()));
+                      FlutterBugly.checkUpgrade();
                     },
                     },
                   ),
                   ),
                   HomeMenu(
                   HomeMenu(