Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
Posts: 26
Registered: ‎06-17-2013
My Device: Z10
My Carrier: Bell
Accepted Solution

WebView cookies issue

 

I am adding a webview into my app.  It loads most of webpage properly, but for certain login page, it shows an ERROR of this kind "The service requires cookies.  Please enrue that they are enabled..."

 

I tried to enable the cookies and javascript in QML and c++, but didn't help on this issue.

 

QML code

settings.javaScriptEnabled: true

settings.cookiesEnabled: true

 

C++

    webView_->settings()->setCookiesEnabled(true);

    webView_->settings()->setJavaScriptEnabled(true);

 

By reading the WebView API document, those settings are actually enabled by default.

 

Thanks for any help.

 

Tyler

Contributor
Posts: 26
Registered: ‎06-17-2013
My Device: Z10
My Carrier: Bell

Re: WebView cookies issue

I actaully found out the root cause, the URL I pass to webview is double encoded.

 

It was fixed by using

QUrl::fromEncoded(url_.toUtf8())

 

where url_ is a QString.