isPushEnabled

Checks if push notifications are enabled for the device.

Syntax 

1Future<bool?> isPushEnabled()

Returns 

  • Future<bool?> - Returns true if push notifications are enabled, false if disabled, or null if the status cannot be determined.

Example 

1bool? isEnabled = await SfmcSdk.isPushEnabled();
2if (isEnabled == true) {
3  print('Push notifications are enabled');
4} else if (isEnabled == false) {
5  print('Push notifications are disabled');
6} else {
7  print('Push notification status unknown');
8}

Related Methods