|
|
|
|
@ -31,7 +31,6 @@ import 'package:test_sa/modules/tm_module/gas_refill/gas_refill_details.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pragma('vm:entry-point')
|
|
|
|
|
Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message) async {
|
|
|
|
|
if (message.notification == null && message.data != null) {
|
|
|
|
|
@ -62,6 +61,7 @@ Future<void> onBackgroundMessage(CallEvent event) async {
|
|
|
|
|
|
|
|
|
|
/// Tells the caller the call was declined (same signalling as `_handleCallDeclined` in land_page.dart).
|
|
|
|
|
Future<void> notifyCallerDeclined(Map<String, dynamic> extra, {String? reason}) async {
|
|
|
|
|
print("notifyCallerDeclined:$extra");
|
|
|
|
|
final callee = extra["calleeEmployeeNumber"]?.toString() ?? '';
|
|
|
|
|
final caller = extra["callerEmployeeNumber"]?.toString() ?? '';
|
|
|
|
|
if (callee.isEmpty || caller.isEmpty) return;
|
|
|
|
|
@ -93,6 +93,7 @@ class FirebaseNotificationManger {
|
|
|
|
|
try {
|
|
|
|
|
final value = await FlutterCallkitIncoming.getDevicePushTokenVoIP();
|
|
|
|
|
if (value != null && value.isNotEmpty) voipToken = value;
|
|
|
|
|
print("voipToken:$voipToken");
|
|
|
|
|
} catch (_) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -112,7 +113,6 @@ class FirebaseNotificationManger {
|
|
|
|
|
|
|
|
|
|
static FirebaseNotificationManger getInstance() => _instance;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Future<void> getToken() async {
|
|
|
|
|
NotificationSettings settings = await messaging.requestPermission(alert: true, announcement: false, badge: true, carPlay: false, criticalAlert: false, provisional: false, sound: true);
|
|
|
|
|
|
|
|
|
|
@ -487,7 +487,6 @@ Future<void> handleDataMessage(Map<String, dynamic> messageData, bool isFromBack
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await FlutterCallkitIncoming.requestNotificationPermission({
|
|
|
|
|
// // "title": "Notification permission",
|
|
|
|
|
// // "rationaleMessagePermission": "Notification permission is required, to show notification.",
|
|
|
|
|
@ -605,4 +604,3 @@ String _uuidV4() {
|
|
|
|
|
final h = b.map((x) => x.toRadixString(16).padLeft(2, '0')).join();
|
|
|
|
|
return '${h.substring(0, 8)}-${h.substring(8, 12)}-${h.substring(12, 16)}-${h.substring(16, 20)}-${h.substring(20)}';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|