pushInteractionEvent function
Future
pushInteractionEvent(
- dynamic instanceId,
- dynamic type
)
Implementation
Future<dynamic> pushInteractionEvent(instanceId, type) async {
var dio = ApiService().createDio();
final apiKey = await getApiKey();
final user = await getUser();
final userId = user['userId'];
final dataCenterPushUrl = await getDataCenterPushUrl();
final deviceInformation = await getDeviceInformation();
final deviceType = deviceInformation['deviceType'];
Map<String, dynamic> data = {
'instanceId': instanceId,
'type': type,
'os': deviceType,
'userId': userId,
};
final jsonData = convert.jsonEncode(data);
final response = await dio.post(
'$dataCenterPushUrl$pushNotificationInteractionUrl?apiKey=$apiKey',
data: jsonData);
return response.data;
}