feat(mobile,deploy): 接入安卓极光与华为通道并准备公网部署配置
客户端默认指向 jxd.jinniu.ink 的 HTTPS/WSS;登录后把 OpenIM userID 设为极光 alias。 华为 agconnect-services.json 不伪造、不入库。Master Secret 只从服务器文件注入。 Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -6,6 +6,7 @@ import '../config.dart';
|
||||
import '../services/auth_api.dart';
|
||||
import '../services/call_service.dart';
|
||||
import '../services/im_service.dart';
|
||||
import '../services/push_service.dart';
|
||||
import '../theme.dart';
|
||||
import 'home_screen.dart';
|
||||
|
||||
@@ -92,7 +93,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
);
|
||||
// 3. 启动通话信令监听
|
||||
CallService.instance.start();
|
||||
// 4. 存凭证用于下次自动登录
|
||||
// 4. 极光 alias = OpenIM userID,供服务端离线推送
|
||||
await PushService.instance.bindUser(result.userID);
|
||||
// 5. 存凭证用于下次自动登录
|
||||
await LoginScreen.saveCredential(result.userID, result.token, result.nickname);
|
||||
if (!mounted) return;
|
||||
Navigator.of(context).pushReplacement(
|
||||
@@ -150,7 +153,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
final results = await Future.wait([
|
||||
probe('账号服务', '$authApiBase/api/health'),
|
||||
probe('消息接口', '$apiAddr/'),
|
||||
probe('消息长连接', 'http://$serverHost:$wsPort/'),
|
||||
probe('消息长连接', wsProbeUrl),
|
||||
]);
|
||||
return '自检:${results.join(',')}';
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
import '../services/im_service.dart';
|
||||
import '../services/push_service.dart';
|
||||
import '../theme.dart';
|
||||
import '../widgets/avatar.dart';
|
||||
import 'login_screen.dart';
|
||||
@@ -166,6 +167,7 @@ class _MineScreenState extends State<MineScreen> {
|
||||
onPressed: () async {
|
||||
Navigator.of(ctx).pop();
|
||||
await LoginScreen.clearCredential();
|
||||
await PushService.instance.unbindUser();
|
||||
await IMService.instance.logout();
|
||||
if (!mounted) return;
|
||||
Navigator.of(context).pushAndRemoveUntil(
|
||||
|
||||
Reference in New Issue
Block a user