Languages

Menu
Sites
Language
Webview in webapp?

 

I have to get "Auth Code" for getting OAuth Token in account site ( like facebook)

I click the button for Sign in and then, I can see the json code including auth code.

 

In Android, Someone use "webView".

like this.

<pre class="code">

 

@Override
  public void onPageFinished(WebView view, String url) {
    
   
    // the json page is shown after I click the singIn Button.   //When the url is changed, view load the json in html page.
   if (url.contains("https://blahblahbla.com/OAuth2.do")) {
    mWebViewCover.setVisibility(View.VISIBLE);
    view.loadUrl("javascript:window.HtmlOut.showHtml(document.getElementsByTagName('body')[0].innerHTML);");
   }
   
   super.onPageFinished(view, url);
  }

 </pre>

I want to do this in TIZEN.

 

But, If I use "href", I cannot control the page cuz the site is not mine.

I don't know there is something like webview in tizen

and the function for recognizing the change of site(webview or website)

 

so, Is there any solution or webview in Tizen ?

 

 

P.S

You may think I can make login page in tizen(textbox, button and so on).

But, This is not what I want cuz I cannot get the api in the site. (Facebook offer the api. But the site is not opended)

Please remember it.

 

Thanks,

Jenny

 

 

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

6 Replies
Lakshmi Grandhi
In case of Android, its not web application its java based application, you can call webview to load any web page, but tizen is an web application which is running on top of webkit webview, so html page doesn't have reference to web view. I guess you need to use child browser concept to load page for auth token.
Jenny Blossoms
It is like iframe ?? hmn....
Alex Dem
Hi Jenny Tizen [Web Apps] are stored locally on a device hence you unable to use OAuth standart flow for Web apps. You able to use any site's api in Web App if configure 'config.xml' file this way: < access origin="*" subdomains="true"/ > for all sites, or < access origin="https://api.twitter.com" subdomains="true"/ > for individual site (twitter only). But during OAuth in your HTTP GET or POST requests you should set redirect_uri param (OAuth verifier param and tokens should comes there). You unable to configure redirect_uri on your File System. redirect_uri should be hosted on a web server. If you able use xAuth please use xAuth. But you could take a look onto this way: to create [Native App] based on Web View, see 'Tizen NativeProject' -> 'Sample' -> 'WebViewer' example. You will able to control all transitions between local html pages/URLs from Native App and will able to extract OAuth verifier param/tokens which comes to registered redirect_uri. You could use OAuth in this case. I do not know how it was implemented in details but I know this way has been used by someone. Here is useful article about integration with social networks: https://developer.tizen.org/documentation/articles/social-network-services-on-tizen Alexey.
Jenny Blossoms
Thanks Alexey :) Your commenet help me :) Can I create patially native app in Web app ? or How about using iframe to get json in body tag?
Alex Dem
Hi Jenny. In tizen you could create 'Hybrid Application': https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.web.appprogramming%2Fhtml%2Fsample_descriptions%2Fmultiprocess_hybrid_package.htm If you want try to use 'iframe' for 'OAuth' please know: Usually social networks do not allow open "authorize" page in 'iframe' due security. Also you could not get 'iframe' content from [Web App] due 'same origin policy'. Your local page and page which was opened in 'iframe' should be hosted in the same domain. Alexey.
Jenny Blossoms
Thanks for your help Alex !!! :D I'll try it :)