IOS "how to" facebook application page how to do?

Possible duplicate:
Like a button in an iOS app

I am trying to make it easier for the user of my application to β€œlike” my facebook application.

Scenario: the user is already logged in and authorized my application, so I have the oauth user token. Since the Graph API does not allow this, I tried several other methods, all to no avail.

Methods: 1) Go to the facebook page on facebook in UIWebView 2) Make your application to launch the Facebook application on my facebook application page.

In method 1, the main problem is that in many cases the user will have to log into the web view again, because I did not find a way to somehow transfer the token to the web browsing session. For example, in the Foursquare api, all you have to do is add a token to the URL as a query string ( http: //foursquare.com/blabla? Access_token = 52521 .... ), This does not work on facebook.

In method 2, which can be performed using this method:

NSString * fbAppUrl = [NSString stringWithFormat: @ "fb: // applications /% @", [App facebookAppId]],
BOOL didOpenOtherApp = [[UIApplication sharedApplication] openURL: [NSURL URLWithString: fbAppUrl]];

No matter what I try, i.e. fb: // applications /% @ or fb: // pages /% @ or fb: // profile /% @ or fb: // feed /% @, the facebook application just opens to a blank page.

Any hints or tips from anyone?

I would really like to use method 2 and return to method 1 if the facebook application is not installed, but in fact, method 1 will lead to a very low conversion speed, so we hope to avoid this.

+6
source share
2 answers

The Facebook iPhone app does not currently support this, nor is it a graphical api. The only way Facebook supported the β€œhow to” URL is their iFrame code. There is halfway to a blog post on how to make option number 1, but he is looking to see if they logged into Facebook through Safari. Not the best user interface, but everything that Facebook allows at the moment.

+4
source

There seems to be an agreement on the impossibility of this. However, this post shows that you can: Use 'Like' with the Facebook API for iOS

To create a backup, here is an excerpt from the FB Graph API documentation:

You can comment or like any object that has / comments or / likes the connection by posting at https://graph.facebook.com/OBJECT_ID/comments and https://graph.facebook.com/OBJECT_ID/likes respectively:

(source: http://developers.facebook.com/docs/reference/api/ )

0
source

Source: https://habr.com/ru/post/885644/


All Articles