How to install an app on a user's page automatically? - java

I am writing an app where I am supposed to make a user to add my app to his page.
Right now if I want a user to make him add the app to his account I am simply redirecting the user to apps.facebook.com/myfunnyapp. From there on, facebook will guide him add the app to his account.
But I am supposed to make him add the app to his page.
Any ideas? Thank you all in advance.

Did you try this url:
http://www.facebook.com/add.php?api_key=<your_api_key>&pages
It will add your app to his fanpage automatically.

I found the answer. This post helped me
redirect on facebook app install
We need to post a request to https://api.facebook.com/method/admin.setAppProperties?access_token=App_Token&properties={'post_authorize_redirect_url':'http://myhost.com/Test/callback.jsp?'}
Your app access token can be found here https://developers.facebook.com/tools/access_token/
Note: you have to use a app_token instead a user_token.
But what I need to know is will this app_token change every time or not?
Any ideas gurus?

Related

Handle facebook confirmation popup from rest service

I have following requirement,Through rest service,I need to fetch feed from facebook and store in db.I have to do this for every one hour.
I have created App in Graph_Api,when i want to communicate with graph api for the first time, below mentioned pop-up is coming. As i told you, i am doing from backend so no manual interaction to click on Continue as DevSample. Is there any way to get out of this through rest? please suggest
Any help would be appreciated.

how to do a facebook like to a given post-id on my android app

I want to integrate my android app with facebook API.
I'm getting from my server a postId and I want the user to be able to
"like" that post on facebook from my android app.
I have search the facebook developers docs
but found nothing regarding such like, only login, share (android)
or like (from html page).
Anyone has an idea?
You need to do a POST request to: https://graph.facebook.com/POST_ID/likes.
Don't forget to include your token.
For this you need to have extended permissions set up properly, to allow liking of posts.

Get Facebook Username using Windows Azure

Hereis my problem,
I make an Android application and i use Windows Azure.
I use Azure to make login activity with Facebook. It works well i can log in.
However i want to get the Name and last name of the guy who log in using Facebook.
I have no idea how to do it using windows azure, i check this web site http://blogs.msdn.com/b/carlosfigueira/archive/2012/10/25/getting-user-information-on-azure-mobile-services.aspx
But i don't understand it. Anyone got an idea on how to get the name and last name of the person who log in using windows azure on android ?
To get user's information from facebook, first User must authorize it. Second, you need to query this information using graphs api from facebook.
Here some tutorials that could help you:
http://blogs.msdn.com/b/carlosfigueira/archive/2012/10/25/getting-user-information-on-azure-mobile-services.aspx
http://chrisrisner.com/Authentication-with-Windows-Azure-Mobile-Services
https://developers.facebook.com/docs/android/getting-started/

facebook login by activity 1 and send post to fb wall by activity 2

i am making an android app which is using Facebook to post status to wall.Integration part is done.I am using Facebook sdk 3.0.
My UI is Tab layout:1st Tab is Home.2nd Tab is settings.(two activities)
Firstly in 2nd tab, i have Facebook Login Button,through which i log in and log out.(same button)
Then in 1st tab,I have postButton,though which i post a status to facebook profile.
I have checked lots of tutorials.But i am not getting any answers related to this.Morevoer all tutorials are having all the workings in single activity,which i don't want.
Please can anyone help with my scenario. Login in one activity and send post to fb wall by second activity
Thanks in advance.
It's much easier under Facebook 3.0 since you have the Session object.
You can call the static Session.getActiveSession() in any activity, then you should make sure the session is open and ready with the required permissions (easily achieved) and publish whatever you want (or open the session and/or request publish permissions).

Registration in app right way

I am want to do registration in my app. So i have made all requests to my web service.
I now when user is registered.
Now i need to save somewhere that he is registered that don't give him registration form again.
How to do this ?
Do i need to save somewhere in my sqlite database and every time when app lunches check if he is registered user. Or maybe in app settings i could save this information.
I am new to developing android app and i am searching for the right way.
Thanks all for help.
You could save that with SharedPreferences. Check the link for sample code.
http://developer.android.com/guide/topics/data/data-storage.html#pref.
This data will be removed if the users uninstalls the app or clears all data from system menu.
Edit: If you really want to remember preferences across installs you should try Backup API. http://developer.android.com/guide/topics/data/backup.html
The best solution is to use Android's Account Manager to handle user account. This aproach is the most secure (credentials are not exposed), however it has two drawbacks:
It's a little bit complocated to set up
It requires at least API version 5
Once the user registered you can save in your sqlite database and you have to check for each time when your application launches. But if the user uninstalled the application and tried to reinstall it ll ask for registration again.. In order to avoid this you have to store the information like the device id and the registered details in some servers and also in sqlite database and have to check when the application launches...

Categories