|
@@ -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);
|
|
|
|
|
|