registerForPushNotifications static method

Future<Map<String, dynamic>> registerForPushNotifications(
  1. String? title,
  2. String? message
)

Implementation

static Future<Map<String, dynamic>> registerForPushNotifications(
    String? title, String? message) async {
  final result = await methodChannel.invokeMethod('registerForPush', <String, dynamic>{
    'title': title,
    'message': message,
  });

  // Convert the result to a Map<String, dynamic>
  if (result is Map) {
    return Map<String, dynamic>.from(result);
  }

  // Return a default response if the result is not a map
  return {'granted': false, 'authorizationStatus': 'unknown'};
}