sendOptInStatus static method

Future<void> sendOptInStatus(
  1. bool status
)

Implementation

static Future<void> sendOptInStatus(bool status) async {
  // try {
  //   final deviceInfoJson =
  //       await cacheInstance.getValue(KeyConfig.gkDeviceInfo);
  //   final deviceInfo = jsonDecode(deviceInfoJson ?? '{}');

  //   final url =
  //       await cacheInstance.getValue(KeyConfig.kcNotificationEventUrl) ?? '';
  //   final userId = await cacheInstance.getValue(KeyConfig.kcMerchantId);
  //   final token = await cacheInstance.getValue(KeyConfig.kcMerchantToken);

  //   if (userId == null || token == null) return;

  //   final data = {
  //     'subscription_status': status,
  //     'app_domain': deviceInfo[KeyConfig.gkAppDomain],
  //     'device_id': deviceInfo[KeyConfig.gkDeviceUniqueId],
  //   };

  //   final headers = {
  //     'Content-Type': 'application/json',
  //     'id': userId,
  //     'provider': 'kwikchat-dynamic',
  //     'token': token,
  //   };

  //   // final response = await http.post(
  //   //   Uri.parse(url),
  //   //   headers: headers,
  //   //   body: jsonEncode(data),
  //   // );

  //   // if (response.statusCode != 200) {
  //   //   throw Exception('HTTP error! Status: ${response.statusCode}');
  //   // }
  // } catch (e) {}
}