Trying to add the Facebook Like Button to an iOS App. Followed the directions online and am seeing an issue.
Without the Facebook App Installed on Simulator (8.x, 7,x):
When pressing the F Like button, we see a transition to Facebook.com but then quickly returns to the iOS App. It does not go to the proper Facebook Like page where the user can like the URL passed.
In the iOS app, the openURL method is being called and the Facebook
wasHandled = [FBAppCall handleOpenURL: url sourceApplication: sourceApplication];
is being called and it returns YES.
Please note that we are also using the Facebook Login Button that is working fine in this app.
The user has already been authenticated with the Facebook Login Button at this point.
Any hints on this would be appreciated.
We are using Facebook iOS SDK 3.21.1
[Addition]
See this article
http://stackoverflow.com/questions/26529314/android-likeview-error
This is what we are seeing in the the URL Error Message in openURL
The like dialog is only available to developers and testers
Which kinda does not make sense? Regular users should be able to see the like dialog to like the item?
For Facebook Like Buttons on iOS and Android.
After you have integrated the latest SDK and you want to test....
1) You must use a Facebook Account that is either the Developer account for the app (the account that the Facebook ID for the app was created) OR a linked tester Facebook account to the Facebook Developer account.
2) You have to use this account to login with on for the App.
3) When testing a "BETA" banner will be on the target page.
4) If these are not in place, for iOS at least you will get an error message in the URL in the openURL routine in the AppDelegate. For Android you will get a "CANCEL" status in your onActivityResult routine.
The like dialog is only available to developers and testers
Hope this helps.
To fully enable the like button for production, please see Ming Li comments above.
Related
My project is in SWIFT
User receives an email with Change Password link and the link is going to be like this http://foobar.com/something/reset_token=barfoo
When user taps on link 'Change Password' it should take him to my iOS app to that particular view controller. I know deeplinking but my URL is going to be like this http://foobar.com/something/reset_token=barfoo and not deeplink://
Please help
If you are targeting iOS9 and newer, you can use Universal links
It allows you to redirect the user to your app from an URL (classic http/s), but he can stay in Safari if he really wants to.
You can found the result in action and a good article about your specific case here:
https://blog.curtisherbert.com/ios-9-universal-links-and-forgotten-passwords/
I am trying to implement like in my Objective C application. If I am not logged into Facebook, then after tapping Like button, application opens login screen. I will log into my account. Then screen goes light gray with gray logo of Facebook for a while (with 2 shortly showed grey facebook screens before that) and then I am redirected back into my app. If I am logged into Facebook when running application, everything is the same except not showing login screen.
So my problem is, that I am not getting correct confirmation dialog that should appear after logging into FB account and I am redirected back into my app. Like is not placed.
What can be cause of this behaviour?
I have placed all 3 needed rows into .plist and this is how I am creating like button (p_webView is my subclass of UIWebView):
if (p_webView.fbLikeButton == nil) {
p_webView.fbLikeButton = [[FBSDKLikeControl alloc] init];
}
p_webView.fbLikeButton.objectID = p_webView.article.url;
[p_webView.fbLikeButton setFrame:CGRectMake(p_webView.fbLikeButton.frame.origin.x, height + 5, p_webView.fbLikeButton.frame.size.width, p_webView.fbLikeButton.frame.size.height)];
[p_webView.fbLikeButton setCenter:CGPointMake(p_webView.frame.size.width / 2, p_webView.fbLikeButton.center.y)];
[p_webView.scrollView addSubview:p_webView.fbLikeButton];
More information - I have tried this on simulator (there I do not have FB app, so it was using Safari only). After loggin in, I have got error:
"The page you requested cannot be displayed at the moment. It may be temporarily unavailable, the link you clicked on may be broken or expired, or you may not have permission to view this page."
As it might be difficult to find solution - one needs to be in FB app as administrator, developer or tester for like button to work when testing app that has not been approved by Apple for using native like button yet.
You are doing right.
Maybe you are missing something:
You have to create fb app id and add it to iOS app. So you can open fb app when tap on Like button.(I think you did this)
You have to add your fb acc (using to login) to dev/test roles in your fb app. If not you will be pushed back to iOS app after login to fb (in fb app or safari). <--- I think your problem is here.
Ref: https://developers.facebook.com/docs/apps/test-users
If you want everyone can login and like, you have to Submit Your App for Review (with Native Like button). After that, everyone can use Like button.
For the fb app setting, in the "Status & Review" tab, turn on "Do you want to make this app and all its live features available to the general public?"
After that you can see this "This app is public and available to all users" in Dashboard tab, instead of "This app is in development mode and can only be used by app admins, developers and testers"
How do I use the url scheme to open a facebook post in facebook ios app?
I got a thing while goolgling like "fb://post/"id""
but it does not work, it just opened the facebook app.
http://wiki.akosma.com/IPhone_URL_Schemes
This "works" but, then again, doesn't:
fb://post/
It only works if the Facebook app has previously loaded the particular post, otherwise it draws a blank.
u can use this link. this might help you
What are all the custom URL schemes supported by the Facebook iPhone app?
fb://profile – Open Facebook app to the user’s profile
fb://friends – Open Facebook app to the friends list
fb://feed – Open Facebook app to the News Feed
fb://events – Open Facebook app to the Events page
fb://requests – Open Facebook app to the Requests list
fb://notes- Open Facebook app to the Notes page
fb://albums – - Open Facebook app to Photo Albums list
Hi I have a requirement in my app. From my ios Application(myapp),i share a link to facebook. Then I opened up my facebook account in browser or Facebook application and clicked the link, link should open in myapp if myapp is installed in the device otherwise link should open in browser. How can I achieve this ? Please suggest me step by step. Thanks in advance for your consideration and help.
I am not sure if this is possible. I have looked at various questions including
Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
as I am sure you might have already done but these questions target their own app, mainly web app, but you want that behavior to occur from an app that is not yours like twitter or facebook. But what you can do is show them two links on facebook/twitter, if they have installed press link 1 and if they want to install, press link 2 and you can pass parameters in link 1 as you might already know.
I will also keep checking answer of this question if some one comes and gives a better solution.
There is an option called custom URL scheme in iOS. It will help you to create a URL scheme which identifies your application. You can post link with this URL scheme and when you tap on this link on your iOS device it will open up your mobile app. Please see the link below to know how to setup this.
Custom URL Scheme in iOS
This is called 'deep URL linking'. Facebook have built a service called 'App Links', which seems pretty cool.
https://developers.facebook.com/docs/ios/app-links
I've been trying to make phonegap-plugin-facebook-connect cordova plugin Simple example work, and i've experienced a weired problem.
First I had the Facebook iOS application on my iphone:
On my test application based on the Simple example, when i click the Login button, it just switches to the Facebook iOS app, and switches back to my application.
Clicking the "Me" button gives me an error "an active access token must be used to query information about the current user" which means the login was not successful
Then I removed the Facebook iOS application from my iPhone:
It worked. It opens Safari with Facebook authorisation page, when i click OK it switches back to my application and the auth.login events are successfully fired.
Is this a known issue ? Is there a way to fix it ?
Thank you
I found a workaround:
in Facebook.m
- (void)authorize:(NSArray *)permissions {
self.permissions = permissions;
[self authorizeWithFBAppAuth: NO safariAuth:YES]; //Use Safari Auth instead of FB App
}
With this workaround Facebook iOS authorization will not be used, wheter installed or not.
Github issue#25