0

I have a mobile website and an android app. The android app is created as a container for the same mobile website. I have installed smart app banner package in my website project and when I tried the mobile website using my android device that smart banner is appeared correctly. But I have a challenge now. That is to hide the banner when using my android app. Currently when using my android app there also the same banner is appearing because it was built using the same mobile website. So I am sure I cannot hide it from android project side and only way to hide is from web project side.

My web project is implemented using vue js and smart banner was implemented as in below link. https://github.com/kudago/smart-app-banner/issues/104

I could find some way of hiding for certain browser like this <meta name="smartbanner:exclude-user-agent-regex" content=".*Safari.*">. But how can I hide it for .apk/.ipa instead of filtering by browser. Any working solution is highly appreciated.

Jack
  • 259
  • 4
  • 18
  • Android apps can define methods which can be made accessible as JavaScript methods for websites that are shown in a WebView. You could define a method like `isInApp(): Boolean` and check on your site if this method exists and what it returns. Check the documentation for WebView JS interfaces: https://developer.android.com/guide/webapps/webview#BindingJavaScript – Alexander Hoffmann Dec 02 '21 at 21:17
  • When I tried there's a console log error on web project side saying `Android` is not defined @AlexanderHoffmann – Jack Dec 09 '21 at 08:27
  • 1
    Despite of the console log error in web, it's working fine. Thank you very much @AlexanderHoffmann – Jack Dec 11 '21 at 09:41

0 Answers0