create method

Future<List<QBSubscription?>> create(
  1. String deviceToken,
  2. String pushChannel
)

Implementation

Future<List<QBSubscription?>> create(
    String deviceToken, String pushChannel) async {
  Map<String, Object> data = Map();

  data["deviceToken"] = deviceToken;
  data["pushChannel"] = pushChannel;

  List<Object?> list = await _pushModule.invokeMethod(CREATE_METHOD, data);

  List<QBSubscription?> subscriptionList = [];

  for (final item in list) {
    QBSubscription? subscription = QBSubscriptionMapper.mapToQBSubscription(
        item as Map<dynamic, dynamic>);
    subscriptionList.add(subscription);
  }

  return subscriptionList;
}