checkApp method

Future<bool> checkApp({
  1. required String uniqueKey,
})

Implementation

Future<bool> checkApp({required String uniqueKey}) async {
  try {
    Response<String> result = await _dio.get(
      "https://mouadzizi.com/envato/app.php",
      options: Options(
        validateStatus: (status) => true,
      ),
      queryParameters: {
        "key": uniqueKey,
        "package": await _getPackageName(),
      },
    );

    if (result.statusCode == 200) {
      final data =
          jsonDecode(result.data ?? "{'status' : 'false' , 'msg': 'ERROR'}");

      if (data['status'] == "true") {
        //  debugPrint("AZUL ENVATO CHECKER IS CORRECT");

        return true;
      } else {
        //   debugPrint("AZUL ENVATO CHCKER ERROR: ${data['msg']}");
        return false;
      }

      //if server not response
    } else if (result.statusCode == 500 || result.statusCode == 404) {
      return true;
    }
    return false;
  } catch (e) {
    // debugPrint("AZUL ENVATO CHCKER ERROR: $e");
    return false;
  }
}