How to implement facebook App Link Host - android

I want to integrate facebook SDK to my android app. After reading the fb doc and samples, I can let the user login with fb account, post status update with my app's shared link. I see the fb support deep link. I really want to use this feature, but I am stuck here, I read the Open Graph doc, can not find android app samples. My app is mobile only, so I plan to use fb's App Links Host service.
Here is my question:
How can I implement App Link Host API through FacebookDialog or WebDialog when fallback.
I can make request to read the app link data follow the document. But how to produce my own app link meatadata and link to my app's each shared post?
I will continue to do this work on my own and I really hope someone can share this here. Tons of thanks!

Related

Retrieving list of Facebook friends who use iOS/Android

I'd like to target a message to my Facebook friends who use iOS, and separately, Android. If I'm going to recommend them a particular app, for example, I'd like to ping only those who have the right OS. Presumably Facebook has this information. Is there a way for me to retrieve it?
I do not think Facebook would expose this kind of information on their API. What you could do is use Parse and its Installation class. By doing so, you will get specific device information of each of your users. Then you can use the Parse Push SDK to target specific users based on this information. As an added bonus, Parse also offers Facebook integration, so it might be the tool you are looking for.
You can use the Facebook Message dialog for iOS and Android to let people send messages to their friends via Facebook Messenger. See https://developers.facebook.com/docs/android/share#message-dialog and https://developers.facebook.com/docs/ios/share#message-dialog
However, in v2.0 of the API there is no way to find out which of a users non-app-using friends are using Facebook on which platform - and in any case, the dialogs don't let you pre-fill the recipients.
If you want people to invite their friends, but want the recipient to end up being redirected to the correct (iOS or Android) version of your app, I suggest sharing the same URL, and then doing user-agent detection when someone clicks on the link to determine if you want to redirect the users to Google Play or the Apple App Store. Services like Deeplink.me may provide this as a hosted service: https://www.deeplink.me/

Is possible to synchronize a particular facebook page onto an android app?

I was wondering if it is possible to catch feed of a particular facebook page without any authentication and just display all the posts posted by the admin of the page (possibly along with all comments and likes).
I took a look the facebook developers page but could not find anything relevant.
You can access the public information of any Facebook page without any permissions.
However, You do need to register your app on FB first. They only allow access to their Data from registered apps. It's FB's way of making sure they know who's using which data and how much of it.
You can create a new app at this URL
https://developers.facebook.com/apps
Here are links to mobile/web docs for using Facebook's API
https://developers.facebook.com/docs/

Android Facebook howto Post

i have the following problem: I tried to post sth. to Facebook by using ACTION_SEND Intent to pass a String to the Facebook application.
Now I know this is currently not possible.
I don't want to code my own Facebook login, logout, session handling stuff in my application.
Question is:
If someone has the Facebook App installed and is logged in,
can I use the authentification information to post sth. on his Facebook wall?
Or, what is the easiest way to get sth. posted?
thanks
I would recommend using the Spring Social Facebook library. It will take care of all the OAuth stuff for you and provide you with a nice Facebook API you can interact with. The API allows you to do a lot more things than just post.
The downside is you have to install the jar files with your app and do a little setup. There is a good example of how to do this for Android in the spring-android-showcase-client in the spring-android-samples project.

Facebook authentication from android using secret key and app id but not signature

Basically I am developing an android application which can post updates to my facebook wall through my web application server. So actually my web application post my updates in facebook. I am authorizing my android application like a webapp and not as a native android app. I downloaded the facebook for android SDK and tried examples by creating signature using keytool. I am able to post the updates from android as native app. From my web application, I am not able to post my updates through the access token I get.
I am not able to find an android example for facebook SDK which uses the secret key and app id for getting the access token. Can you please give me some pointers on how to achieve the same using facebook SDK..
Thanks.
I haven't tried this yet but there is documentation online and it's quite clear:
You can find the description for al the methods at the following link
https://developers.facebook.com/docs/reference/androidsdk/authentication/
You can also have a look at the code, if something isn't clear enough
https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/com/facebook/android/Facebook.java
As far as I can tell you don't actually need the app secret in order to authenticate, only the app id. This is because it would be quite insecure to put the app secret on the phone(in the apk) since someone could retrieve it. So the resulting token will expire after a fairly short amount of time(couple of hours or so).
Also here's the complete guide to using the Facebook SDK on Android for authentication:
https://developers.facebook.com/docs/mobile/android/build

twitter in android

Is there any SDK of Twitter available through which we can implement Twitter in our application? I want that my application would load on his/her Twitter account and then the tweet should be sent to his/her account, but I cannot find any simple examples.
Something like the Facebook Android SDK is what I'm look for.
You can use twitter4j. This site also contains some usage examples.
Unfortunately with the introduction of oAuth, login is no longer trivial. You have to register your application with Twitter (go to your account, then applications and add the app there). This will give you a consumer key/token pair, that you need for logging in and that you need to keep secret.
I've implemented this in my Android-Client called Zwitscher.
You can have a look at the Login procedure in the LoginActivity (of the v0.65 tag).
If you just want to post a tweet to twitter, use the Android SEND Intent. That way, the user can choose what he want's to do with the post himself. It's much easier for you as well. No worrying about OAuth etc.
As #Heiko said, twitter4j is quite good. You should use it.
For an example of how it works, I have created a simple sample app that can be found here.
Check that out, maybe it helps you.
AFAIK there is no sdk provided for twitter. You can however use XAUTH for twitter.
It is fairly easy to implement it.
This post might be able to help you.
xAuth Authentication for Twitter Share in Android?

Categories

Resources