[InAppBrowser Plugin] InAppBrowser Plugin error wile opening url - ERR_CLEARTEXT_NOT_PERMITTED

Forge Component
(9)
Published on 9 Jan by OutSystems R&D
9 votes
Published on 9 Jan by OutSystems R&D

Hi,


I am facing error while trying to open url in plugin - ERR_CLEARTEXT_NOT_PERMITTED.

It was working before.

Anyone else is also facing the same ?

Thanks,

Vani

Solution

Hi Vani,


Are you using MABS 5 to build your app?

In MABS 5 we introduced the support for Android P which disables blocks the communications over HTTP. To overcome that you can follow the Plugin documentation available here


Thanks.

Solution

I figured that Http urls are not getting opened in In App browser. But when you change to Entities.Target.SYSTEM it works.


I want to open HTTP url in "Entities.Target.IN_APP_BROWSER". Anyone has a solution for this ?

Thanks Vitor Oliveira :)

As mentioned in documentation, i followed this and it worked :

For MABS 5 or upper versions

Plugin Versions

  • O10:  >= 1.1.0
  • O11: >= 2.1.0

Android P blocks the usage of HTTP requests by default, in case of need to open a URL with HTTP a preference can be specified in the application extensibility configuration:

{ "preferences": { "android": [ { "name": "InAppBrowserCleartextTrafficPermitted", "value": "true" } ] } }

Sorry to use this old thread, but since im facing the same issue i hope you dont mind. Which inapp plugin  version are you using? i already updated mine to 3.1.0-os2 but im still facing the clear text issue even after adding the preferences.


This is my extensability code


{
    "plugin": {
        "url": "https://github.com/OutSystems/cordova-plugin-inappbrowser.git#3.1.0-OS2"
       
    },
    "preferences": {
        "android": [
            {
                "name": "InAppBrowserCleartextTrafficPermitted",
                "value": "true"
            }
            ]
    }
}

Vitor David wrote:

Sorry to use this old thread, but since im facing the same issue i hope you dont mind. Which inapp plugin  version are you using? i already updated mine to 3.1.0-os2 but im still facing the clear text issue even after adding the preferences.


This is my extensability code


{
    "plugin": {
        "url": "https://github.com/OutSystems/cordova-plugin-inappbrowser.git#3.1.0-OS2"
       
    },
    "preferences": {
        "android": [
            {
                "name": "InAppBrowserCleartextTrafficPermitted",
                "value": "true"
            }
            ]
    }
}

Just managed to fix it, there was some conflict errors having multiple preferences android.