修复退出登录后依然可以收到本地呼叫通知问题
This commit is contained in:
parent
e94be5a718
commit
3422033ed4
@ -106,9 +106,10 @@ class CallTalk {
|
||||
|
||||
// 如果收到的包数等于总包数,说明这一帧数据已经接收完毕
|
||||
if (iframe!.bagNum == iframe!.bagReceive) {
|
||||
// print('播放第${iframe!.iframeIndex}帧 一帧图片的hexStringData: ${Uint8List.fromList(growableList)}');
|
||||
// print(
|
||||
// '播放第${iframe!.iframeIndex}帧 一帧图片的hexStringData: ${Uint8List.fromList(growableList)}');
|
||||
// print('得到的一张图片的数据长度为${iframe!.bb!.length}');
|
||||
DateTime now = DateTime.now();
|
||||
// DateTime now = DateTime.now();
|
||||
// String formattedTime = "${now.hour}:${now.minute}:${now.second}";
|
||||
// print('$formattedTime得到了一张图片共${iframe!.bagReceive}个数据包');
|
||||
eventBus.fire(GetTVDataRefreshUI(iframe!.bb!));
|
||||
|
||||
@ -43,16 +43,30 @@ class UdpHelp {
|
||||
|
||||
var uid = await Storage.getUid();
|
||||
udpHeartTimer = Timer.periodic(1.seconds, (timer) async {
|
||||
UDPSenderManage.sendHeart(
|
||||
userName: uid,
|
||||
ipList: serversList,
|
||||
tokenStr: "b989fa15f75c2ac02718b7c9bb64f80e",
|
||||
);
|
||||
// print('发送心跳了');
|
||||
getLoginStatus().then((value) {
|
||||
if (value) {
|
||||
UDPSenderManage.sendHeart(
|
||||
userName: uid,
|
||||
ipList: serversList,
|
||||
tokenStr: "b989fa15f75c2ac02718b7c9bb64f80e",
|
||||
);
|
||||
// print('发送心跳了');
|
||||
} else {
|
||||
timer.cancel();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> getLoginStatus() async {
|
||||
final data = await Storage.getString(saveUserLoginData);
|
||||
if (data != null && data.isNotEmpty) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void closeUDP() {
|
||||
if (udpHeartTimer != null) {
|
||||
udpHeartTimer!.cancel();
|
||||
|
||||
@ -103,7 +103,7 @@ class UDPManage {
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
bool exit() {
|
||||
bool exitUdpSocket() {
|
||||
if (null != _udpSocket) {
|
||||
print('❌ Udp ----> close');
|
||||
_udpSocket?.close();
|
||||
|
||||
@ -59,6 +59,7 @@ class XSJPushProvider {
|
||||
}
|
||||
}
|
||||
|
||||
//本地通知初始化 isCancelLocalPush 是否取消所有本地通知
|
||||
initLocalNotification(bool isCancelLocalPush) async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user