Facebook Sharer and Android App - android

Basicly, i want to provide users to share my application's android market url. I do not want to use "facebook api for android" so my way is like that when the user press the button of "share on facebook", web browser opens "www.facebook.com/sharer.php" then user login it and application's market url string paste in "write something" (textbox of facebook sharer.) Is it possible to make like this or must i use facebook api for this work?

Please don't use sharer.php as it is deprecated, Facebook may completely pull it at any time. Try to see if http://developers.facebook.com/docs/reference/dialogs/feed/ will work for you instead.

No, not really, unless you really hack things up.
Look at the dialogs documentation: http://developers.facebook.com/docs/reference/dialogs/, for each dialog they provide a url, but if you try them you'll see at the bottom of the dialog that it's "shared via Cool Social App".
You need to have an application if you want users to share, and if you already have a fb application, and you want to do the share from an android application, then yes you can just open a web browser with the dialog url, but using the android facebook sdk will be a much better choice since it has the Single Sign-On: http://developers.facebook.com/docs/mobile/android/sso/, that will check if the user is already signed in to facebook in the mobile device, and if so will skip the authentication process.

Related

open chrome custom tab in-app rather than in a window

I'm running into some issues with ChromeCustomTabs, although it might just be a misunderstanding on my end. I have an app where I have the option to open three links, an instagram page, facebook page, and a twitter page. Now, I chose to use custom tabs since it shares credentials with the system and so I won't have to ask the user to login when hitting these pages.
The problem is that facebook and twitter open in a new window, when I really need to get it to open in app where my menus are still available. Is this possible, or is a webview the only way to get a webpage to open in-app?
If this is the case, is there a way to get the links to open without prompting a user if they'd rather launch in chrome or in the native app?
I would like to avoid having to implement a webview with OAuth calls for easy logins if possible.
I tried the simple-chrome-custom-tabs for my project. It could be download from https://github.com/novoda/simple-chrome-custom-tabs. There are many parameters which could be used to customize the UI. Hope it works for you.

Native Facebook Login experience via browser

I have seen several flavours of this question going around but nothing exactly specific nor answered so trying it myself.
I am trying to build a Facebook login experience via the browser into my Facebook-based app that will require the users to not remember their passwords as much as possible. This means that if
they log in via their desktop browser and are already logged in, it will only ask them to 'OK' the permissions
they log in from their mobile browser and are logged in via their respective native app (Android/iOS), it will simply redirect them to the native app, ask for the app permissions and redirect them back to the success page on the browser
they log in from any browser and are not currently logged onto Facebook in any form, they have to enter their password and authenticate (whether natively or via browser this does not matter)
I know how the first can be done - that is pretty straightforward using the JS SDK. The second point is the tougher bit.
I am aware of existing custom URL schemes for Android and iOS but nothing specifically really mentions how that can be used for authentication and/or authorisation of Facebook apps. Does anyone have any ideas on how this can be done?
Thanks!
In iOS use iOS facebook SDK. It will handle the login process effectively in different situations depending on the resources available. Check out this answer to know about different login flows
Integrating facebook
You're looking for Single Sign On behavior- in Facebook, use the native SDK, and instructions for setting up SSO. It includes entering your bundle id in the settings and setting up a referring url name (the name of your app usually). So what happens is- if you launch safari mobile, and log into facebook. Then, launch your app, with good integrated SSO. Then, it won't require you to login/pass, because it knows you've authenticated via browser. Same with Android.
I think what you are looking for (at least for Android) is starting an Intent on certain schema that will open Facebook app.
This is answered here Android facebook intent to show profile with class com.facebook.katana.ProfileTabHostActivity doesn't work any more

Integrating facebook to android app

I have a simple question here. What is the need for integrating FB sdk to android app.
I can open the facebook url in web view and login and do whatever to be done on FB. Then what will be the scenario where FB need to be integrated with my app .
With Facebook sdk, you can upload photos directly to your Facebook albums, and also you can get all the user likes, friends and many more.
Compared to work with webview, the use of sdk saves time for your app user - he don't need to login every time he want's to enter his profile (Using sso - Single Sign On) or any other thing, that requires Facebook.
In my case, I activate the native Facebook app directly from my app, with my app page. In my opinion, if you don't need something more sophisticated, just showing page, you can use it.
In case there is no native Facebook app, activate it with the user browser (catch block).
try{
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/" + PROFILE_FACEBOOK_APP_ID));
startActivity(intent);
}catch(Exception e){
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/UserNamePage")));
}
In general, the integration is used when the developer wants to post on a users' behalf, add pictures directly to specified albums, get a user's email address etc.
These can be done when the user authorises the app for the first time, they also authorise the privileges.
It is also seen as a marketing tool, as all the posts will say via (yourAppName), so you can gain some online presence.
Like Ofir A said, it is time saving for the user as they only need to log in once.
Hi Why you are calling webview with facebook link.You should use FaceBook Native Sdk for Android.This giveing your better user experience compare to webview. Refrence for Facebook Integration

Android: Avoiding two logins to Facebook (SDK and Browser) while integrating a page "like" button

I am trying to add a LIKE button to my android app that the user can press to like a fan page.
To my understanding, this is not possible because of Facebook security restrictions.
My alternative is to display a Like button using WebView with the "like social html code" provided by Facebook.
The issue with that approach is that the user will have to re-login to Facebook using the web interface for him to see the like button. That is, after he already logged in using the SDK authentication (which is also a web view).
Is it possible to do all of that using only one login?
How is it that logging in using the SDK does not save the cookies to the default web browser (the SDK uses a web view...) ?
Are there any alternatives to accomplish that?
Try logging into your application with SSO. Non SSO(Normal) authentication uses the Facebook application installed on the app. If you do a SSO FB login into your app and simply pass a url to webView for the "Like" feature, I guess it should work because you are using a SSO FB login for the app and pre installed facebook app on the device to handle the webview's FB.
I am hopeful about this. Please share your feedback.

How to get facebook authentication from Android login form

Is it possible to login into facebook using my own login form in Android & get the facebook user id? I just want to validate the users without need them access their facebook.
In the Android facebook tutorial, the app have to open facebook first so that user can login but there is no automatic close after user login successfully.
Thanks in advance
No, you don't have a way to log the user in through facebook without using their official endpoints.
You can open some sort of browser with the authentication dialog (or the open graph one) but that still mean using their forms/ui (what ever you want to call it).
You should just use the android sdk without using the SSO, that way the sdk won't call the facebook application that is installed on the device (if at all) and will just call the auth dialog for you.
This is a better solution for you since it "abstracts" some things from you, takes care of the access token and more.
Here's a thread about disabling the SSO: How to disable Facebook single sign on for android - Facebook-android-sdk

Categories

Resources