addPusher method

Future<bool> addPusher(
  1. String appId,
  2. String token,
  3. String deviceName,
  4. String appName,
  5. String serverUrl,
  6. bool withIosDefault,
  7. String? lang,
)

add another http pusher to the notification system

Implementation

Future<bool> addPusher(
  String appId,
  String token,
  String deviceName,
  String appName,
  String serverUrl,
  bool withIosDefault,
  String? lang,
) {
  final tmp1 = appId;
  final tmp5 = token;
  final tmp9 = deviceName;
  final tmp13 = appName;
  final tmp17 = serverUrl;
  final tmp21 = withIosDefault;
  final tmp23 = lang;
  var tmp0 = 0;
  var tmp2 = 0;
  var tmp3 = 0;
  var tmp4 = 0;
  var tmp6 = 0;
  var tmp7 = 0;
  var tmp8 = 0;
  var tmp10 = 0;
  var tmp11 = 0;
  var tmp12 = 0;
  var tmp14 = 0;
  var tmp15 = 0;
  var tmp16 = 0;
  var tmp18 = 0;
  var tmp19 = 0;
  var tmp20 = 0;
  var tmp22 = 0;
  var tmp24 = 0;
  var tmp26 = 0;
  var tmp27 = 0;
  var tmp28 = 0;
  tmp0 = _box.borrow();
  final tmp1_0 = utf8.encode(tmp1);
  tmp3 = tmp1_0.length;

  final ffi.Pointer<ffi.Uint8> tmp2_0 = _api.__allocate(tmp3 * 1, 1);
  final Uint8List tmp2_1 = tmp2_0.asTypedList(tmp3);
  tmp2_1.setAll(0, tmp1_0);
  tmp2 = tmp2_0.address;
  tmp4 = tmp3;
  final tmp5_0 = utf8.encode(tmp5);
  tmp7 = tmp5_0.length;

  final ffi.Pointer<ffi.Uint8> tmp6_0 = _api.__allocate(tmp7 * 1, 1);
  final Uint8List tmp6_1 = tmp6_0.asTypedList(tmp7);
  tmp6_1.setAll(0, tmp5_0);
  tmp6 = tmp6_0.address;
  tmp8 = tmp7;
  final tmp9_0 = utf8.encode(tmp9);
  tmp11 = tmp9_0.length;

  final ffi.Pointer<ffi.Uint8> tmp10_0 = _api.__allocate(tmp11 * 1, 1);
  final Uint8List tmp10_1 = tmp10_0.asTypedList(tmp11);
  tmp10_1.setAll(0, tmp9_0);
  tmp10 = tmp10_0.address;
  tmp12 = tmp11;
  final tmp13_0 = utf8.encode(tmp13);
  tmp15 = tmp13_0.length;

  final ffi.Pointer<ffi.Uint8> tmp14_0 = _api.__allocate(tmp15 * 1, 1);
  final Uint8List tmp14_1 = tmp14_0.asTypedList(tmp15);
  tmp14_1.setAll(0, tmp13_0);
  tmp14 = tmp14_0.address;
  tmp16 = tmp15;
  final tmp17_0 = utf8.encode(tmp17);
  tmp19 = tmp17_0.length;

  final ffi.Pointer<ffi.Uint8> tmp18_0 = _api.__allocate(tmp19 * 1, 1);
  final Uint8List tmp18_1 = tmp18_0.asTypedList(tmp19);
  tmp18_1.setAll(0, tmp17_0);
  tmp18 = tmp18_0.address;
  tmp20 = tmp19;
  tmp22 = tmp21 ? 1 : 0;
  if (tmp23 == null) {
    tmp24 = 0;
  } else {
    tmp24 = 1;
    final tmp25 = tmp23;
    final tmp25_0 = utf8.encode(tmp25);
    tmp27 = tmp25_0.length;

    final ffi.Pointer<ffi.Uint8> tmp26_0 = _api.__allocate(tmp27 * 1, 1);
    final Uint8List tmp26_1 = tmp26_0.asTypedList(tmp27);
    tmp26_1.setAll(0, tmp25_0);
    tmp26 = tmp26_0.address;
    tmp28 = tmp27;
  }
  final tmp29 = _api._clientAddPusher(
    tmp0,
    tmp2,
    tmp3,
    tmp4,
    tmp6,
    tmp7,
    tmp8,
    tmp10,
    tmp11,
    tmp12,
    tmp14,
    tmp15,
    tmp16,
    tmp18,
    tmp19,
    tmp20,
    tmp22,
    tmp24,
    tmp26,
    tmp27,
    tmp28,
  );
  final tmp31 = tmp29;
  final ffi.Pointer<ffi.Void> tmp31_0 = ffi.Pointer.fromAddress(tmp31);
  final tmp31_1 = _Box(_api, tmp31_0, "__Client_add_pusher_future_drop");
  tmp31_1._finalizer = _api._registerFinalizer(tmp31_1);
  final tmp30 = _nativeFuture(tmp31_1, _api.__clientAddPusherFuturePoll);
  return tmp30;
}