Facebook Connect Open native facebook App, - iphone

I have an iPhone app using facebook connection using FBConnect from github code.
It worked fine in the simulator, however when I installed it in the device with existing facebook app from facebook it didn't work. It opens the existing facebook app instead of returning to my own app.

Checkout this link.
Better you can go with the approach given in the link as it works fine. I have myself tried this code and it has worked for me.
Also the sample project (with Facebook API implemented in it) is given in the below link which will be helpful for you to while implementing the facebook API as per the method given in the below link.
http://www.raywenderlich.com/1488/how-to-use-facebooks-new-graph-api-from-your-iphone-app
Also you can test the sample project on your device before going for this approach
Hope this helps you.
EDIT:

Have you registered a URL handler to respond to return requests from the Facebook app? on iOS 4 the Facebook SDK uses fast app switching which is designed to let the app handle most of the heavy lifting and let the users just hit "Accept" instead of having to re-enter login/passwords

Related

Facebook deeplink doesn't work in web browser

We're trying to implement deep links in facebook ads. Everything works fine when we open ad link in facebook app: if our app is curretly installed then facebook app launches our app and passes the deep link into it. Also if our app is not installed and we open ad link in facebook app then it redirects to AppStore and we recieve deferred deep link from facebook inside our app.
But when we try to reproduce all these scenarios using facebook browser version, none of the cases are working (neither deep link nor deferred deep link)
Is it possible at all to make deep links work in web environment?
Finally I've asked Facebook support and received the answer:
Deep link is designed to work in apps only. It doesn't work with a
browser. Please don't worry because it's working as expected!
https://developers.facebook.com/support/bugs/535030953629446/?disable_redirect=0

Facebook profile picture is not working in ionic hybrid application on ios devices

Facebook graph API tells me I can get a profile picture of a user using
http://graph.facebook.com/100001225634061/picture?type=large
which works fine.
But If I used the same application in iOS devices this link is not working. For Hybrid applications, Graph url is not redirecting in iOS.
Any solution for this? Single solution should work on both the devices.
Thanks!
I had a similar problem recently where a Facebook profile picture wouldn't show up in my Ionic iOS app. I used a similar link you mentioned above.
Investigating the app in Safari showed an error saying:
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.
Turns out, for security reasons you have to use https instead of http in your links. Changing the link like that solved the issue for me.

Link to native app when user get facebook app request

I am implementing facebook app request concept in my app. For that I have used this code Facebook app request
When user send the request to friends who are enabled in iOS device. It is working fine. Friends are getting proper notification. But I also need that when user click on that notification, it should open my iOS native app. Anyone has an idea about this?
How to do this?
Thanks in advance.
Take a look at "deep linking" here: https://developers.facebook.com/docs/ios/link-to-your-native-app-ios-sdk/
You will need to
- add a url scheme
- set up a facebook app
- add the correct info from your facebook app into your Info.plist
- add the code from the examples.
I followed the facebook instructions and there are a lot of steps. But it works for me.
I hope this helps!

App requests successful, but no notification shown

I am using the normal setup for sending invites through the requests dialogue:
FB.ui(
{
method: 'apprequests',
message: "Please add me, I am doing the same, thanks!"
},
function(response) {
console.log(response);
}
);
The response is successful, response.to shows multiple ids. So sending these invites works like it should. The problem is that these apprequests are not shown up as notifications like they usually do, instead the only place to find them here.
Has the API changed? Looking for answers has given me no results, though I did find this bug report from February 15th 2013.
Is Facebook just testing yet again, or has the API changed but not the documentation? I am truly grateful for any insights!
There's two simple things that might cause that problem.
One is that you application is missing the Canvas. Just add it from the your App panel in Facebook Developers.
The second one - make sure your app is NOT in SandBox Mode. If it is it won't send any notifications. I lost hours before figuring that out and changing the code in all possible ways.
Hope that helps.
Its not facebook bug its a problem in your facebook app configuration :
Follow the below configuration and its working like a charm.
You just need to go in to the Facebook developer and select your app and goes in to the setting of your app and click "Add Platform" and select "App On Facebook" and than add canvas url in it. now try to send invitation and it will show the notification.
Thanks
Sagar
or go to facebook developers,
Change 111 to your APP ID
-Fedmich
This was posted yesterday in facebook bugs site.
However, it is still not working for me even though I'm utilizing the exact code that the FB comment is referencing.
I realize this is not complete answer to the question and should be put in the comments. However I am a newbie and don't have enough reputation on StackOverflow to post comments. Emil, could you please let me know if you resolve this issue.
Had same issue, I added Secure Canvas URL, etc. But problem was I haven't provided iPhone Store ID inside iOS section in Settings.
As of Graph API 2.3, Game requests are only available to games.
As mentioned in Game Requests description, you have to create Facebook Web Games in App Portal, then you will get the notification with Game Request. Not for website anymore.
I had to implement facebook ‘apprequests’ instead of the deprecated ‘appinvites’ in an existing cordova app and spent hours debugging.
‘apprequests’ are only available in Facebook Apps categorized as ‘games’.
You can send notifications only to platforms (iOS, Android, Facebook web games) that are involved with the facebook app. That means, you will never receive a notification in your browser if you miss ‘facebook web games’ as platform. My expectation was to be notified in the facebook browser app if I was invited from a Mobile app.
iOS devices don’t get notifications.
In my case, I’ve missed to fill the app store id in the Facebook app platform configuration. After that, notifications appeared instantly.
If you like notifications in the fb browser app, you have to add ‘Facebook web games’ (formerly known as ‘canvas’) as plattform.
You can save yourself a lot trouble by creating test users in the app role category of your facebook app.

Facebook Integration in IOS

i am using FBConnect in my project for integration of Facebook.but now i saw in all apps,when the user tap the Facebook button,it goes directly to the FaceBook App in the device to open for login.i think this is done with URLschema to communicate the App to App in a device.but how can we o this in case of Facebook.
My need is ,i have a sharing option in my app to Facebook,so when the user tap the button it needs to open the Facebook app in the device for login,and after successful login it needs to come back to my app also.how to o this?.is there any sample project or apps to do this.
Thanks in advance.
Look for the FBSessionDelegate. You provide the delegate which gets callbacks when the FB login completes (successfully or not). Also the FBConnect code, see git://github.com/facebook/facebook-ios-sdk.git, has a sample directory with a Hackbook Xcode project. That should get you started!
Here is the Facebook iOS Tutorial (which uses FBConnect).
You can use the Graph API(Uses OAuth 201 authentication protocol) instead of FBConnect , which is newer and a lot easier.You can implement it inthe following steps:-
1>Get unique id and api key from facebook's develooper portal.
2>Display the login page of the facebook in your app.
3>Allow the user to loginthrough following URL
https://graph.facebook.com/oauth/authorize?
client_id=[API key]&
redirect_uri=http://www.facebook.com/connect/login_success.html&
scope=[extended permissions]&
type=user_agent&
display=touch
you can implement the FBLoginView in UIWebView and present it.The code is be large so i am giving a link to Ray Wendelich's Facebook Graph API