Nativescript: Android webview enable Cookies not working

Created on 10 Jan 2017  路  3Comments  路  Source: NativeScript/NativeScript

setAcceptThirdPartyCookies on the webview for android is not working

if (android.os.Build.VERSION.SDK_INT >= 21) {            

android.webkit.CookieManager.getInstance().setAcceptThirdPartyCookies(webview, true);
}

getting the following error

Failed resolving method setAcceptThirdPartyCookies on class com.android.webview.chromium.CookieManagerAdapter

I am Using:

  • CLI: 2.4.2
  • Cross-platform modules:
    "ios": "2.3.0",
    "android": "2.3.0"
    "version": "2.4.3"
  • Runtime(s): "tns-android": {
    "version": "2.4.1"
    }

Please tell us how to recreate the issue in as much detail as possible.

question

Most helpful comment

Got it working with following code

if (android.os.Build.VERSION.SDK_INT >= 21) {    
    android.webkit.CookieManager.getInstance().setAcceptThirdPartyCookies(webview.android, true);
}

All 3 comments

Got it working with following code

if (android.os.Build.VERSION.SDK_INT >= 21) {    
    android.webkit.CookieManager.getInstance().setAcceptThirdPartyCookies(webview.android, true);
}

Does someone know how to apply this exactly setting in iOS? I have a Salesforce cookie integration that works ok on Android with this setting but In don't know how to make this on iOS...please help!

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings