sendOptInStatus static method

Future<void> sendOptInStatus(
  1. bool status
)

Implementation

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

  //   final url = await cacheInstance.getValue(
  //     cdnConfigInstance.getKeys(StorageKeyKeys.kcNotificationEventUrl)!,
  //   ) ?? '';
  //   final userId = await cacheInstance.getValue(
  //     cdnConfigInstance.getKeys(StorageKeyKeys.kcMerchantId)!,
  //   );
  //   final token = await cacheInstance.getValue(
  //     cdnConfigInstance.getKeys(StorageKeyKeys.kcMerchantToken)!,
  //   );

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

  //   final data = {
  //     'subscription_status': status,
  //     'app_domain': deviceInfo[cdnConfigInstance.getKeys(StorageKeyKeys.gkAppDomain)],
  //     'device_id': deviceInfo[cdnConfigInstance.getKeys(StorageKeyKeys.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) {}
}