mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 05:45:10 +00:00
chore: Set data_message in pusher properties for hedwig
This commit is contained in:
parent
9fcb5cce19
commit
be69672d41
1 changed files with 13 additions and 3 deletions
|
@ -20,9 +20,8 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_app_badger/flutter_app_badger.dart';
|
||||
|
@ -174,7 +173,11 @@ class BackgroundPush {
|
|||
currentPushers.first.lang == 'en' &&
|
||||
currentPushers.first.data.url.toString() == gatewayUrl &&
|
||||
currentPushers.first.data.format ==
|
||||
AppConfig.pushNotificationsPusherFormat) {
|
||||
AppConfig.pushNotificationsPusherFormat &&
|
||||
mapEquals(
|
||||
currentPushers.single.data.additionalProperties,
|
||||
{"data_message": pusherDataMessageFormat},
|
||||
)) {
|
||||
Logs().i('[Push] Pusher already set');
|
||||
} else {
|
||||
Logs().i('Need to set new pusher');
|
||||
|
@ -211,6 +214,7 @@ class BackgroundPush {
|
|||
data: PusherData(
|
||||
url: Uri.parse(gatewayUrl!),
|
||||
format: AppConfig.pushNotificationsPusherFormat,
|
||||
additionalProperties: {"data_message": pusherDataMessageFormat},
|
||||
),
|
||||
kind: 'http',
|
||||
),
|
||||
|
@ -222,6 +226,12 @@ class BackgroundPush {
|
|||
}
|
||||
}
|
||||
|
||||
final pusherDataMessageFormat = Platform.isAndroid
|
||||
? 'android'
|
||||
: Platform.isIOS
|
||||
? 'ios'
|
||||
: null;
|
||||
|
||||
bool _wentToRoomOnStartup = false;
|
||||
|
||||
Future<void> setupPush() async {
|
||||
|
|
Loading…
Reference in a new issue