我一直在寻找如何使用SLRequests了解如何在iOS6中集成Facebook.经过一番研究,我能够做到这一点.这里有一些代码片段,展示了它是如何完成的.
{
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
__block ACAccount *facebookAccount = nil;
ACAccountType *facebookAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
// Specify App ID and permissions
NSDictionary *options = @{
ACFacebookAppIdKey: @"012345678912345",
ACFacebookPermissionsKey: @[@"publish_stream", @"publish_actions"],
ACFacebookAudienceKey: ACFacebookAudienceFriends
};
[accountStore requestAccessToAccountsWithType:facebookAccountType
options:options completion:^(BOOL granted, NSError *e)
{
if (granted)
{
NSArray *accounts = [accountStore accountsWithAccountType:facebookAccountType];
facebookAccount = [accounts lastObject];
}
else
{
// Handle Failure
}
}];
NSDictionary *parameters = @{@"message": @"My first iOS 6 Facebook posting "};
NSURL *feedURL = [NSURL URLWithString:@"https://graph.facebook.com/me/feed"]; …Run Code Online (Sandbox Code Playgroud) 我目前正致力于为未来的iOS游戏添加Facebook社交功能的原型.我一直在努力的功能之一是使用新的原生Facebook Composer发布到游戏的链接,然后跟踪帖子并为每个喜欢帖子的人提供玩家硬币.在帖子之后,我得到了他们的Feed,并寻找具有匹配的应用程序ID的帖子.如果我不使用新的原生Facebook Composer(旧式对话框,或者只是没有对话的直接帖子),我已经让这部分工作正常了.
我遇到的问题是当使用新的SLComposeViewController时,帖子似乎来自应用程序"iOS"id"213546525407071"而不是我的应用程序的id.
有没有办法更改属性应用程序,以便它使用我的应用程序ID而不是iOS?