registerDevice method

  1. @override
Future registerDevice({
  1. String? fcmToken,
  2. String? deviceId,
  3. String? platform,
  4. required int appVersion,
  5. String? googleAdId,
  6. String? clevertapId,
  7. String? appsflyerId,
})
override

Implementation

@override
// ignore: long-parameter-list
Future registerDevice({
  String? fcmToken,
  String? deviceId,
  String? platform,
  required int appVersion,
  String? googleAdId,
  String? clevertapId,
  String? appsflyerId,
}) {
  const path = 'v1/devices/';
  return builder.post(
    uri: Uri.parse('$baseUrl/$path').toString(),
    body: {
      'deviceId': deviceId,
      'fcmToken': fcmToken,
      'platform': platform,
      'appVersion': appVersion,
      if (googleAdId != null)
        'googleAdsMetadata': {
          'advertisingId': googleAdId,
        },
      if (clevertapId != null)
        'clevertapMetadata': {
          'clevertapId': clevertapId,
        },
      if (appsflyerId != null)
        'appsflyerMetadata': {
          'appsflyerId': appsflyerId,
        },
    },
    success: (json) => json,
  );
}