fb share button asks for fb credential when webpage is loaded from android webview - android-webview

I am loading my website through webview of android. The webpage contains fb share and comment plugins. Now when i try to share page it asks me to login my fb credentials in webview which i don't want to happen. What i want is android fb app to handle my login. Is there any way to redirect the facebook login dialog from webview to android fb app.
Second Approach:
I have also tried loging the user in by using fb android sdk and loading the webpage via webview. Now can i use access token from android sdk to login the user in webview.
here is my code:
setContentView(R.layout.activity_main);
String url ="http://kantipur.ekantipur.com/news/2016-01-10/20160110073954.html";
WebView web = (WebView)findViewById(R.id.webView);
web.getSettings().setJavaScriptEnabled(true);
web.loadUrl(url);
web.setWebViewClient(new WebViewClient() {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
});

Related

Flutter : Crhome view is not clear

I have an app with flutter using facebook auth, when I click facebook login chrome app display with facebook page to login, but the page is not clear like this paic, when I try to use it the emulator not response:
Any one have an Idea tosolve this, I have chnged High Dpi settings and nothing change.

Check if Facebook app is in an iframe tab

I need my application to redirect to the site with the iframe tab (https://www.facebook.com/pages/namepage...idapp) when someone enters the app (https://apps.facebook.com/idapp)
How can I check if the app is open in an iframe tab?
The a page parameter in the signed_request will be present when the app is loaded via a page tab app, and won't be present otherwise.
Use this to determine if the app should render as a canvas app or a page tab app
Set up the canvas page URL in your app settings, and when that URL is called „redirect” the user via JavaScript, top.location.href = "//facebook.com/yourpageid/…"

facebook redirect after app authentication

I am developing a functionality to allow facebook users to register in our web application.
The approach is:
We will create one app on facebook
Facebook authentication plugin (http://developers.facebook.com/docs/guides/web/#login) will be used in our registration page.
When user clicks on facebook button, facebook login page and then app authorization page are shown.
One user allows/disallows facebook app, user will be redirected to a particular page within our website.
I am not able to find a proper even handler to capture app authorization (allow/disallow event) to redirect user. Can someone help me with this?
Using the JS SDK:
FB.login(function(response) {
if (response.status=="connected") {
// authorized the app
} else {
// did not authorized the app
}
}, {
perms: 'email'
});
Trigger a call to this function when the user click the button.
<div class="fb-login-button">Login</div>

Facebook C# SDK for Facebook Connect

How can I use Facebook C# SDK for facebook connect using ASP.NET?
What I am trying to do is:
Provide a "Login with Facebook" button.
Once the user clicks on Login button, get the access token on server side and sign in to my website.
Most articles (I found through google or SO) said use Facebook Javascript SDK for Log in and Authentication and then get the Access token from cookies created on web browser.
What I did so far:
Used Facebook login button in .aspx page with the below code.
<fb:login-button onlogin="window.location.reload();" perms="offline_access">Login with Facebook</fb:login-button>
Problems I am having:
When I click log in button on MY PAGE a window will pop up to log in to facebook. MY PAGE is supposed to reload when I login to facebook but it reloads even I click on Cancel button or close the pop up window. What I need is reloading MY PAGE only when I log in.
From the above step: If I log in and MY PAGE reloads perfectly. In code behind (Page load event) I can see the cookie created and it has the information (access token) what I needed. And from here I want to use Facebook C# SDK to get user information. how to do ?
I used Facebook C# SDK 3 months ago for developing a canvas application in Facebook. The documentation and examples listed on Codeplex are for Apps on Facebook (correct me if I missed to see facebook connect examples). Also, there was a link to documentation which lists all the Facebook C# SDK classes but I could not see that now. Please provide me the link if you know.
Any help will be greatly appreciated.
Thank you.
http://blog.prabir.me/post/Facebook-CSharp-SDK-Writing-your-First-Facebook-Application-v6.aspx
But there is one issue I am not using
parameters.response_type = "token";
Instead of that i have function to update Token
public static void UpdateToken()
{
var fb = new FacebookClient();
dynamic result = fb.Get("oauth/access_token", new
{
client_id = AppId,
client_secret = AppSecret,
redirect_uri = Url,
code = FacebookUtils.FacebookData.Code
});
FacebookData.AccessToken = result.access_token;
}

Facebook login window for Desktop application

I'm working on a desktop facebook application,
to show facebook login window
FB = window.runtime.com.facebook;
fb = new FB.Facebook();
sessionHelper = new FB.utils.DesktopSessionHelper(api_key)
The facebook login window doesn't show the full page height, and there's no scroll.
Also, any clue why the sessionHelper.logout(); doesn't take effect except when user restart the application?