updatePermissionStatus method
Updates the push notification permission status for the current subscription.
Should be called whenever the permission status changes.
Parameters:
status
: Current permission status granted by the user
Example:
final status = await Permission.notification.request();
await SuperFCM.instance.updatePermissionStatus(
status.isGranted ? PermissionStatus.authorized : PermissionStatus.denied
);
Implementation
Future<bool> updatePermissionStatus(PermissionStatus status) async {
return _queueOrExecute("updatePermissionStatus", () async {
logger.d('Updating permission status to: $status');
final response = await _patch(
'subscriptions/${subscription?.id}',
{
'permission': status.toString(),
},
_config!.cacheOnOffline);
return _handleResponse(response, 'update permission status');
});
}