• How can we check the difference between Android in-app WebView or just the Android browser, same for iOS

    I want to hide some Adsense code with php when the website is runned from the in-app webview. But when the app is runned just from the mobile browser it can show Adsense. It’s against the terms and conditions running Adsense in a native WebView app (in-app)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter vidaldewit

    (@vidaldewit)

    Thanks, if found that too, for iOS in-app WebView vs safari mobile browser it’s working, but the code for Android is not working..yet ?? There are many app in the Google play store violating this, so there account will be shut down too… as my one was too a while ago running Adsense in a native app (Android or iOS).

    // Android (in-app)
    if($_SERVER['HTTP_X_REQUESTED_WITH'] == "com.company.app") {
        echo 'Android (in-app)';
    }
    Thread Starter vidaldewit

    (@vidaldewit)

    It would be great to find a shortcut code for

    [not_in_app_webview]
    Adsense code here
    [/not_in_app_webview]

    My 15 apps in Android store and iOS store are basically WebView apps showing my WordPress site. But I had to turn of Adsense with [not_mobile] .. [/not_mobile] but this is very bad, because now ads are shown in regular android mobile browsers, and safari mobile on iOS.

    Found a solution?

    I’m interested in outputing a wp backend to webview as well (for a start at least), but html content of it has adsence as well…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Detect with php if WebView (in-app) or mobile browser’ is closed to new replies.