Skip to content

Commit

Permalink
fix(firebase_messaging): Make Web deleteToken() API a Future so it …
Browse files Browse the repository at this point in the history
…resolves only when completed. (#7687)
  • Loading branch information
russellwheatley committed Jan 12, 2022
1 parent 4cc1e45 commit cf59bd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Expand Up @@ -36,9 +36,7 @@ class Messaging extends JsObjectWrapper<messaging_interop.MessagingJsImpl> {

/// To forcibly stop a registration token from being used, delete it by calling this method.
/// Calling this method will stop the periodic data transmission to the FCM backend.
void deleteToken() {
jsObject.deleteToken();
}
Future<void> deleteToken() => handleThenable(jsObject.deleteToken());

/// After calling [requestPermission] you can call this method to get an FCM registration token
/// that can be used to send push messages to this user.
Expand Down
Expand Up @@ -16,7 +16,7 @@ external bool isSupported();

@JS('Messaging')
abstract class MessagingJsImpl {
external void deleteToken();
external PromiseJsImpl<void> deleteToken();
external PromiseJsImpl<String> getToken(dynamic getTokenOptions);
external void Function() onMessage(
dynamic optionsOrObserverOrOnNext,
Expand Down

0 comments on commit cf59bd3

Please sign in to comment.