Skip to content

Commit

Permalink
Log NotificationsApi exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirtex committed Oct 25, 2023
1 parent 576dd89 commit 5afea1c
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,27 @@ class NotificationsRepository {
if (activityPushToken != state.activityToken) {
activityPushToken = state.activityToken;

await _notificationsApi
.sendLiveActivityPushToken(state.activityToken);
try {
await _notificationsApi
.sendLiveActivityPushToken(state.activityToken);
} catch (e) {
log('Failed to send push token', error: e);

rethrow;
}
}
},
// ignore: body_might_complete_normally_nullable
ended: (state) async {
log('Activity is inactive, invalidating token');

await _notificationsApi.invalidateLiveActivityPushToken(id);
try {
await _notificationsApi.invalidateLiveActivityPushToken(id);
} catch (e) {
log('Failed to invalidate push token', error: e);

rethrow;
}
},
),
);
Expand Down

0 comments on commit 5afea1c

Please sign in to comment.