removePushChannels method

Future<RemovePushChannelsResult> removePushChannels(
  1. String deviceId,
  2. PushGateway gateway,
  3. Set<String> channels, {
  4. String? topic,
  5. Environment? environment,
  6. Keyset? keyset,
  7. String? using,
})
inherited

It removes registration of device deviceId from channels So device deviceId will not get push notifications from channels

deviceId is the id/token of the device gateway indicates the backend to use for push service it can be

  • apns or apns2 for apple service
  • gcm for google service
  • mpns for microsoft service

If gateway is PushGateway.apns2 then topic is mandatory to provide topic is bundle id of the mobile application environment denoting the environment of the mobile application for PushGateway.apns2 it can be either Environment.development or Environment.production default value for environment is Environment.development

Implementation

Future<RemovePushChannelsResult> removePushChannels(
    String deviceId, PushGateway gateway, Set<String> channels,
    {String? topic,
    Environment? environment,
    Keyset? keyset,
    String? using}) async {
  keyset ??= keysets[using];

  Ensure(deviceId).isNotEmpty('deviceId');
  if (gateway == PushGateway.apns2) Ensure(topic).isNotNull('topic');

  var params = RemovePushChannelsParams(keyset, deviceId, gateway, channels,
      topic: topic, environment: environment);
  return defaultFlow<RemovePushChannelsParams, RemovePushChannelsResult>(
      keyset: keyset,
      core: this,
      params: params,
      serialize: (object, [_]) => RemovePushChannelsResult.fromJson(object));
}