chore(notifications): log push token registration outcome for debugging
Add debugPrint entries before and after POST /universal-notifications/push so we can trace whether a given token was accepted by the backend during debugging of push delivery issues.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:sf_infrastructure/sf_infrastructure.dart';
|
||||
|
||||
import 'notifications_remote_datasource.dart';
|
||||
@@ -19,11 +20,13 @@ class NotificationsRemoteDatasourceImpl
|
||||
|
||||
@override
|
||||
Future<void> registerPushToken(String token) async {
|
||||
debugPrint('[FCM] registering token: $token');
|
||||
try {
|
||||
await _repository.post<Map<String, dynamic>>(
|
||||
'/universal-notifications/push',
|
||||
body: <String, dynamic>{'token': token},
|
||||
);
|
||||
debugPrint('[FCM] token registered successfully');
|
||||
} on DioException catch (error) {
|
||||
final apiMsg = error.response?.data;
|
||||
final msg = apiMsg is String
|
||||
|
||||
Reference in New Issue
Block a user