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
Related
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
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;
}
I'm creating a script that logs a user into a site. Everything works but for some reason when the user clicks on the link to go to their profile the link opens in a new window and at first redirects before going to the correct page.
For example:
The correct link is: https://sites.google.com/site/examplelehan/Jan_Moolman but the moment the link is clicked the link that is actually executed in the address bar changes to: http://www.google.com/url?q=https%3A%2F%2Fsites.google.com%2Fsite%2Fexamplelehan%2FJan_Moolman&sa=D&usd=2&usg=AFQjCNFXLLswDh2AWCBpYi54jNXxpZVGPQ
So it seems as if www.google.co.za is being pre-pended to the url. I've seen other posts as well but none of them seem to be offering working solutions. A few posts have said that this occurs when the link is created without the http:// prefix but I've tested that and the same problem occurs.
I've also tried using .createHTML in order to create the link but for some reason the link doesn't show, any other HTML I use seems to work so I guess that's why Google created the Anchor function.
Thank you in advance for your help.
In this issue tracker comment Eric Koleda suggested a workaround using UrlShortener Services . I tested it with your link (http://goo.gl/HRPfU) and it seems to be a working solution.
EDIT : to answer your comment, here is a working example :
function test(){
var shorturl=short('https://sites.google.com/site/examplelehan/Jan_Moolman');
Logger.log(shorturl);
}
//
function short(longurl){
var toShorten = UrlShortener.newUrl().setLongUrl(longurl);
var short = UrlShortener.Url.insert(toShorten).getId();
return short
}
note that this API has to be activated before it can be used (see docs)
I'm trying to figure out how to use the iPhoneKeyboard function in Unity3D. I want to be able to run a function when a user hits the button "OK" in the keyboard. I just simply can't figure this out.
The second question in this matter is how I can change the "OK" to "Search"?
check out IPhoneKeyboard.Open in the Reference.. there is one example
After you can process the user input using the IPhoneKeybard.done attribute (also one example)
I have looked and searched for an answer for that question and I found an answer in Nathan Totten blog you can find the answer here:
https://gist.github.com/820881
The problem is I am trying to get the application settings according to the application which the user uses, which comes from the url by seeing your app name or id if you were in fan page.
It works with me within the user profile context by using:
var CurrentUrl = HttpContext.Current.Request.UrlReferrer;
and i can get the application name but within facebook fan page when using the same way it gives me a strange url :
http://static.ak.facebook.com/platform/page_proxy.php?v=4
However, it is supposed to give me:
http://www.facebook.com/pages/Mypagename/130736200342432?sk=app_myappId
Any help will be great and any new way to get which app id or tap url the user clicked will be even better.
this problem was exist within the user profile before ,and i think that you use the ifacebookapplication current method that will not give you the chance to get any thing about the context it only take you to an infinite loop ,i think that you have to send to Nathan Totten him self may be he has an answer because in the article he mentioned :
private IFacebookApplication GetCurrent()
{
var url = HttpContext.Current.Request.Url;
// Get the settings based on the url or whatever
var simpleApp = new DefaultFacebookApplication();
// Set the settings
return simpleApp;
}
may be he has a way to get the url within fan page or another way which i am sure it is not exist at least in my mind now .
Thanks ,I found an answer to my case :) now i can get my application id the way is i have to applications i try to decode the sign request with the app secret of each one if the decode result was clear then it is my target app if not then i will try the other one