PushNotificationService constructor
PushNotificationService(
- Getter<
BuildContext?> context, - AppInfo appInfo, {
- required Stream<
AuthUserProfile> userStateStream, - required Future<
bool> sendDevicePushToken(- BuildContext context,
- User user,
- String token
- required dynamic convertMessage(),
Implementation
PushNotificationService(
Getter<BuildContext?> context,
this.appInfo, {
required this.userStateStream,
required this.sendDevicePushToken,
required this.convertMessage,
}) : _platform = pushPlatform() {
onLogout(() async {
/// Reset the state by copying the current token to _pendingToken. That way
/// when the next user logs in, they can immediately register for notifications
_pendingToken = _pushNotificationToken;
});
initialize(context, context()!.userChanges).whenComplete(() {
_bindListeners(context);
});
}