update
Build & Deploy iOS to TestFlight / build-and-deploy (push) Waiting to run

This commit is contained in:
efrilm
2026-05-29 21:56:46 +07:00
parent 77651e2e95
commit ded5516bb1
2 changed files with 11 additions and 8 deletions
+9 -1
View File
@@ -194,7 +194,15 @@ class FcmService {
}
/// Returns the FCM registration token for this device.
Future<String?> getToken() => _messaging.getToken();
/// Returns null if token is unavailable (e.g. simulator, APNs not ready).
Future<String?> getToken() async {
try {
return await _messaging.getToken();
} catch (e) {
debugPrint('[FCM] getToken failed: $e');
return null;
}
}
/// Subscribe to a topic (e.g. 'all', 'promo').
Future<void> subscribeToTopic(String topic) =>