Follow the docs ios like-button I can create facebook's like button into my app. My code as below:
FBLikeControl *like = [[FBLikeControl alloc] initWithFrame:CGRectMake(200, 110, 250, 250)];
like.likeControlStyle = FBLikeControlStyleBoxCount;
like.objectID = #"https://openmerchantaccount.com/img/8a0e730c-bba3-43f4-9ea1-525c13917980-original.jpg";
[self.view addSubview:like];
Then I can like the page which had objectID as above. But I have a question that, will it (like button) have any value when the image link as above I never post to Facebook page? And what is the purpose of the like button when let users click the like button into my app?(sorry,it maybe a naive question but I really don't understand).
From what I can understand of your question.
The purpose of the like button is that the user "likes" the image, but it is seen as a page. Facebook may display the user's activity to their friends news feeds as well as the user's activity feed.
You can also use the like feature as a small widget on a page to show that "x people like this page including a, b and c" where x is the total number of likes for the objectID and a, b and c being friends of the logged in user. This helps Facebook with advertising based on similar interests.
Just because the page is not posted to Facebook, doesn't mean that it will not appear on Facebook in other means
Related
I have latitude, longitude of the center of map view and zoom of the view. How can I generate the URL like this https://goo.gl/maps/twqcy in iOS? So that I can send my friend message like this: "Please go to this place: https://goo.gl/maps/twqcy".
I searched for the answer, and here is what I got: I can build a string like:
https://www.google.com/maps/place/#20.982375,105.7903495,17z to send to my friends.
However, there are 2 issues:
1) When user tap/click in the link, I want to show a marker. Currently it only center at the point with certain zoom degree that I put in. How can I generate a link, so that when my friend click on the link, he will see a marker?
2) How to change the form of the url to shortened one i.e from https://www.google.com/maps/place/#20.982375,105.7903495,17z to https://goo.gl/maps/twqcy.
Please answer with code in iOS, preferably in Swift.
UPDATE: This answer my question: Get url shortened with Google API, AFNetworking in Swift
returns directly a shortened NSURL
https://github.com/H2CO3/Shortener/blob/master/NSURL+Shortener.m
I'm trying to integrate like button inside my application and i want to reward the user for the like with the code below.
How can i see if the user has liked or unliked the facebook page?..(i can add an target to button for UIEventValueChanged but it's a little bit ugly)
self.pageLikeControl.likeControlAuxiliaryPosition = FBLikeControlAuxiliaryPositionBottom;
self.pageLikeControl.likeControlHorizontalAlignment = FBLikeControlHorizontalAlignmentCenter;
self.pageLikeControl.objectID = #"https://www.facebook.com/pages/JocTemp/379725092198791";
I saw on a similar question this answer FBLikeControl callback but it doesn't find that class anymore...so i guess you can't
I know how to create a "Follow me" button on Twitter, but I only want to display it if the user is not already following me. Is there a way to do this properly?
You can get a list of your own followers' ids using this endpoint: https://dev.twitter.com/docs/api/1/get/followers/ids
If you know their twitter handle, you can get the id of someone using your app using this endpoint: https://dev.twitter.com/docs/api/1/get/users/lookup
Then your button display code will look something like:
if ([arrayOfFollowerIds containsObject:idOfAppUser]){
followButton.hidden = YES;
}
If I create a facebook like button with data-href = "www.ohohohoho.com"
and ... some people like it.
How can I know if my logged user likes it with the SDK or Graph or FDK ? I saw that I can only retrieve the kind of
referenced page with :
https://stackoverflow.com/questions/11671094/retrieve-non-facebook-liked-pages-from-a-facebook-user
by doing :
https://graph.facebook.com/?ids=http://www.imdb.com/title/tt0117500/
But the rest not :(
Thank you
You cant get users that liked it. But you can know if determined user liked this.
I have successfully posted now. I have successfully set the privacy params and they work fine. Next, I would like to be able to add people tags like you can do in the Facebook website, where it adds to your message such as: with Bill Smith and Joe Blow. I've read the documentation on Post's. There it includes an item called message_tags, but that seems to refer to a location in the message. So, I created a message on the FB website on my wall where I added a couple of friends and the message has the 'with x and y' on the screen. Then, in my app, I downloaded my posts to see what they looked like in the logging view. No message_tags, but two other places, 'to' and 'with_tags' have the friends there. So, I modified my posting code to use each of these and even tried using both. They post with no error, but viewing on the FB website, no mention of the friends.
When I download these posts using my app, no mention of 'to' or 'message_tags' or 'with_tags'.
Any help would be appreciated.
In addition, I have tried to specify a place in the params. I used data taken from a post which I created on the FB website and downloaded into my app, so the data should be valid. Here is the JSON:
place = "{\"id\":\"171321908789\",\"name\":\"City O City\",\"location\":{\"street\":\"206 E. 13th Ave.\",\"longitude\":\"-104.9845\",\"latitude\":\"39.7367\",\"zip\":\"80203\"}}";
When I include this for key: place, I get this:
0 : {contents = "message"} = {contents = "(#100) {"id":"171321908789","name":"City O City","location":{"street":"206 E. 13th Ave.","longitude":"-104.9845","latitude":"39.7367","zip":"80203"}} does not resolve to a valid user ID"}
To post
Hi -- in PLACE with FRIEND1 and FRIEND2
you only need the ids of the place and friends. Try the following parameters :
message : "Hi",
place : "PLACE-id",
tags : "FRIEND1-id, FRIEND2-id"
It works for me in the graph explorer (
http://developers.facebook.com/tools/explorer) with the publish_actions permissions, when I post to https://graph.facebook.com/ME-id/feed
Hope it helps some people and is not too late for you.
A.