[英]How do integrate FaceBook/Twitter button's into my iOS app game
I'm not asking how to create a button, i'm asking how to integrate FaceBook and Twitter into my iOS game. 我不是在问如何创建按钮,而是在问如何将FaceBook和Twitter集成到我的iOS游戏中。 I see games that let you click on a FaceBook button and a Twitter button.
我看到一些游戏,可让您单击FaceBook按钮和Twitter按钮。 When you click on Twitter button there's a custom message of your score and a SHARE button to post your results on Twitter.
当您单击Twitter按钮时,会显示一条有关您的得分的自定义消息,以及一个SHARE按钮将您的结果发布到Twitter上。
How do I do this? 我该怎么做呢? Mr. Jump game does this.
跳先生游戏可以做到这一点。 I want to do the same.
我也想这样做 My app is for iOS 7 and iOS 8
我的应用程序适用于iOS 7和iOS 8
So what i'd like to happen is when the user reaches a score of 10 for example. 所以我想发生的事情是,例如,当用户达到10分时。 When user clicks on the Twitter button a custom message pops up like "you've got 10 points" or something and then a SHARE button to post this on the user's twitter page.
当用户单击Twitter按钮时,会弹出一条自定义消息,例如“您得10分”之类的消息,然后单击SHARE按钮将其发布到用户的Twitter页面上。 This is what i'm looking for.
这就是我要的东西。
One easy way you could accomplish this is using the Social Framework with SLComposeServiceViewController. 实现此目的的一种简单方法是将Social Framework与SLComposeServiceViewController一起使用。 It has been available since iOS 6.
自iOS 6起已可用。
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:@"I got 10 points!"];
[self presentViewController:tweetSheet animated:YES completion:nil];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.