Skip to content

Commit

Permalink
notif: Implement NotificationService.unregisterToken
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Oct 12, 2024
1 parent a271863 commit 3e11686
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/notifications/receive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,22 @@ class NotificationService {
}
}

static Future<void> unregisterToken(ApiConnection connection, {required String token}) async {
switch (defaultTargetPlatform) {
case TargetPlatform.android:
await unregisterFcmToken(connection, token: token);

case TargetPlatform.iOS:
await unregisterApnsToken(connection, token: token);

case TargetPlatform.linux:
case TargetPlatform.macOS:
case TargetPlatform.windows:
case TargetPlatform.fuchsia:
assert(false);
}
}

static void _onForegroundMessage(FirebaseRemoteMessage message) {
assert(debugLog("notif message: ${message.data}"));
_onRemoteMessage(message);
Expand Down

0 comments on commit 3e11686

Please sign in to comment.