Facebook SDK for android - android

I'm getting confused trying to use the Facebook SDK. A few points where things are beyond my understanding are:
How does the Facebook SDK work in a larger sense (ie. work flow)?
What is the use of facebook.apk if it does not make any difference whether its installed on the device or not?
Any help as to links of blogs would be great!

Assuming you've already completed the Facebook SDK tutorial on native development with Android, I'd start with the following link that provides a 30 minute tutorial on adding Facebook integration to your Android application step by step.
As for the reason you're installing the Facebook.apk, check out section 6.3 of the Facebook tutorial where it states:
Your app will still work without installing this image, but we will default to using Platform Dialogs for sign-in rather than using the Facebook App requiring user to sign-in every time you run your app in the emulator.
So, if you don't install the Facebook.apk, your users would have to sign-in each and every time you run your application. Essentially, it provides additional functionality for you!
Hope that helps.

Related

Ionic : Can't display facebook embedded posts in a iFrame on Android

I have some issue with ionic and facebook for displaying a post with the facebook iFrame. It bothers me a little because this method was working 2 months ago and now it seems that it has changed.
I have followed the method provided by Facebook Developers at this link.
The post display very well on a browser but not on a real device. However, I don't have any console error while making request on the phone. Just an iFrame saying the post doesn't exist (It is the one of the example given by Facebook).
I have already install the cordova whitelist plugin for the allow-origins problem.
I really don't see what has changed since the last time. Did facebook made a change in their plugins ? Or am I forgetting something on the device side ?
Thanks for your advice.
i think as it says in the facebook developers faqs
for the web simple copy paste works but for ios/android you have to register for a developer's account and register an app as well
this guide might also be of help
https://ionicframework.com/docs/native/facebook

Facebook app breaks deep linking on Android

I have an Android application already set up for deep linking via Facebook. Deep links, in particular, work fine when sharing by the Facebook SDK, when the Facebook Android app is not installed on the device. However, deep links are broken when sharing happens through the Facebook Android app: in particular, the Intent that is fired when clicking on a deep linked post from within the Facebook app carries an URL that has http as its scheme instead of the custom scheme that is used in the al:android:url meta property of the web page that can be downloaded at the shared URL.
I am using Facebook app version 37.0.0.48.234 and Facebook SDK 3.21.1.
Of course, everything worked fine... some weeks - or maybe months - ago. Yes, I know I am using an old SDK version. But, instead of blindly updating the library, only to discover that it still does not work, I would like to make a slightly more informed decision about it. So, I'm asking the following:
does a specific, documented, or at least advertised incompatibility exist between the SDK version I'm using and the latest Facebook Android app? It almost seems that the URL set by ShareDialogBuilder.setLink is not correctly processed or recognized by the Facebook app, and therefore used as it is, instead of triggering deep linking by means of the al:android:url meta property which the page at that URL contains.
Does a specific, documented bug exist that prevents the latest Facebook Android app to process deep links as they used to be set up some time ago, that will hopefully be fixed in the future, so that application developers do not have to jump here and there trying to work around the problem?
Does a workaround for this problem exist? And, if the workaround involves updating the Facebook SDK, which specific mechanism (a name of an attribute that the Facebook application expects to receive, or what else?) has unexpectedly changed (such as that attribute being renamed, e.g. from link to contentUrl, or whatever) in the last weeks/months?
Could it be the same issue on iOS SDK?
Look at this sad answer from FB:
https://stackoverflow.com/a/30617527/2707000
I had the same problem but using a different iOS device where open the link on FB app from the one that share the link lets it works!
ps: sometimes I needed to relaunch the FB app, probably in this way the app will re-pull the posts from the servers avoiding some sort of cache.
Cheers.

Facebook Android SDK - Friends Picker not working

I have started learning FB integration in android tutorials from the facebook developers site. But what I have observed is that the Pick Friends activity in the provided example projects (Sample Projects Scrumptious and HelloFbSample) doesn't work either in the emulator or the smart phone. Is either anybody experiencing the same problem ?
The Graph API v2.0 shows only friends who are also using your app. See Don't get all friends of facebook in my ios app?
Even though The Facebook Platform v2.0 shows only friends who are also using your app, you still may be able to see the entire list of friends provided:
1) You are using older version of facebook sdk, as I am using 3.5, it's working well for me.
2) You must have registered your app in your facebook developer account before April 2014.
This will work only till April 30, 2015. After that the friends who are using the same app only would be visible.
Reference:
https://developers.facebook.com/docs/apps/upgrading
https://developers.facebook.com/docs/apps/changelog
I have found a few workarounds that will show a users friends, however you cannot interact with them. Like inviting them to your app. Facebook has bascically restricted this kind of behavior to games only but if you read my issue request here on HelloJS you will see i have a few solutions that might help. In no means is this for Java (Android) its for web based/cordova mobile apps not native android (java)
https://github.com/MrSwitch/hello.js/issues/57

facebooksdk's FBAndroid-2.0.apk are we supposed to install this along with our app?

First, let me apologize if this is a repeat question. I did a search but didn't see a similar one. My question is this. Are we supposed to somehow always include FBAndroid-2.0.apk alongside the app that we develop for android that needs to use Facebook? So let's say I put MyCoolAppWithFacebook.apk on GooglePlay, am I supposed to package it together with FBAndroid-2.0.apk ? If so how can this be done? The facebook developer site have you install it using 'adb' too, as in 'adb install'. If I was to put FBAndroid-2.0.apk inside MyCoolAppWithFacebook/bin folder, it gets deleted every time I do a clean from Eclipse. Maybe I am missing something. Thanks for any pointers.
No. They have you install it on the simulator for testing purposes. When a user attempts to use facebook from your app the facebook SDK will either open the native facebook app (if it is installed on the users device) or it will open the browser and handle the authentication through their website.

Android app facebook integration failure

I have a problem with my app and I don't know if the problem is obvious.
I have managed to post things to my facebook wall using the app I have created for Android.
But when I distribute this app to my testers, they don't get to the login window. The app is terminated before the screen appears.
I have used the tutorial:
http://developers.facebook.com/docs/mobile/android/build/
Can somebody help me. Are some things I can check or is there a more thorough explanation available on the internet?
you need to follow following steps,
1.) go to https://github.com/facebook/facebook-android-sdk/tree/master/examples
2.) download the example named Hackbook.
and execute it , this is working example of facebook integration with android
Here condition is that you must have App ID and App secret.
if is there any problem let me know.

Categories

Resources