registerDevice method
Future
registerDevice({
- String? fcmToken,
- String? deviceId,
- String? platform,
- required int appVersion,
- String? googleAdId,
- String? clevertapId,
- 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,
);
}