onImageTapped method

Future<void> onImageTapped(
  1. AdResponse response
)

Implementation

Future<void> onImageTapped(AdResponse response) async {
  String clickURL = response.clickURL?.replaceAll("DOCEREE_CLICK_URL_UNESC", "") ?? "";
  var urlLaunchable = await canLaunchUrl(Uri.parse(clickURL));// canLaunch(clickURL!); //canLaunch is from url_launcher package
  if(urlLaunchable){
    sendViewTime("mrc");
    await launchUrl(Uri.parse(clickURL));// launch(clickURL); //launch is from url_launcher package to launch URL
  }else{
    Log('DocereeAdView').i("URL can't be launched.");
  }
}