addFirebaseNotificationKey method

Future<void> addFirebaseNotificationKey(
  1. String key
)

Implementation

Future<void> addFirebaseNotificationKey(String key) async {
  late int deviceType;

  if (Platform.isIOS) {
    deviceType = 2;
  } else if (Platform.isAndroid) {
    deviceType = 1;
  } else {
    deviceType = 3;
  }

  await HttpRequest().httpRequest(
      HttpIntent("push_token_notification/add",
          {"token": key, "device_type": deviceType}),
      context: context,
      method: HttpMethod.post,
      "Aggiungo chiave notifica",
      dialog: false);
}