Tag: 社交框架

Facebook和Twitter分享错误Swift

尝试在Facebook或Twitter上分享时遇到此错误。 2015-04-12 17:49:42.208 TestShareApp[1069:30252] *** Assertion failure in -[UICGColor encodeWithCoder:], /SourceCache/UIKit_Sim/UIKit-3347.44/UIColor.m:1448 2015-04-12 17:49:42.359 TestShareApp[1069:30252] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Only RGBA or White color spaces are supported in this situation.' *** First throw call stack: ( 0 CoreFoundation 0x0000000110424c65 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010fce0bb7 objc_exception_throw + 45 2 CoreFoundation 0x0000000110424aca […]

iOS Facebook框架login过程

我正在开发一个iOS应用程序,我正在提供通过Facebooklogin的function。 为此,我正在使用Facebook框架。 我已经通过了developers.facebook.com并实现了在那里描述的loginfunction。 FBlogin工作正常。 FBloginfunction是这样工作的: FB框架将尝试findFB应用程序,如果它存在,那么它将使用FB应用程序凭证进行authentication。 如果FB应用程序不存在,则会尝试使用iPhone设备设置FB凭证进行身份validation。 如果FB系统帐户不存在,则会打开Safari进行身份validation。 我希望在第三步,而不是safari Facebook Web视图popup。 以下是我正在使用的代码。 #import "AppDelegate.h" NSString *const FBSessionStateChangedNotification = @"com.sampleapp.facebook:FBSessionStateChangedNotification"; @implementation AppDelegate @synthesize loggedInUserID = _loggedInUserID, loggedInSession = _loggedInSession; static NSString* kAppId = **FBAPPID**; -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.loginViewControlObj = [[LoginViewController alloc] init]; UINavigationController *nav = [[UINavigationController alloc] […]

SLComposeViewController获取推文和消息的用户

我真的想用iOS社交框架和SLComposeViewController从我的应用程序鸣叫,但我需要用户推特的Twitter处理和完成鸣叫文本(没有我从所有用户的Twitter帐户获取最新的鸣叫,并检测哪一个他用过的)。 我能做到吗? 如果没有,是否有一个很好的select,与twitter处理自动完成,字符计数器和Twitter帐户selecttextView?

Twitter SLRequest performRequestWithHandler – 无法准备URL请求

我正在尝试在我的iOS应用中实现“关注我们的Twitter”。 这是我的代码。 但它给错误“无法准备URL请求”。 请帮忙! ACAccountStore *accountStore = [[ACAccountStore alloc] init]; ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; [accountStore requestAccessToAccountsWithType:accountType options:NULL completion:^(BOOL granted, NSError *error) { if (granted) { NSMutableDictionary *tempDict = [[NSMutableDictionary alloc] init]; [tempDict setValue:@"a4arpan" forKey:@"screen_name"]; [tempDict setValue:@"true" forKey:@"follow"]; SLRequest *postRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:[NSURL URLWithString:@"https://api.twitter.com/1.1/friendships/create.json"] parameters:tempDict]; ACAccount * twitterAccount = [[ACAccount alloc] initWithAccountType:accountType]; twitterAccount.username […]

如何在iOS社交框架中使用SLRequest获取Facebook的电子邮件参数

我试着下面的代码获取loginiOS设置Facebook的人的电子邮件。 请帮助我如何从SLRequest获取电子邮件。 – (void) getMyDetails { if (! _accountStore) { _accountStore = [[ACAccountStore alloc] init]; } if (! _facebookAccountType) { _facebookAccountType = [_accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; } NSDictionary *options = @{ ACFacebookAppIdKey: FB_APP_ID }; [_accountStore requestAccessToAccountsWithType: _facebookAccountType options: options completion: ^(BOOL granted, NSError *error) { if (granted) { NSArray *accounts = [_accountStore accountsWithAccountType:_facebookAccountType]; _facebookAccount = [accounts lastObject]; […]

如果Twitter或Facebook帐户没有在iOS 6上configuration,该怎么办?

是否有人知道一个聪明的方法,让用户input他们的Facebook或Twitter帐户login信息,如果他们还没有login? 例如,用户尝试使用Facebooklogin我的应用程序,而无需在iOS设置中configurationFacebook帐户。 例如,我可以让他以警报的方式做到这一点吗?但是我怎样才能把他带到这个设定的确切部分呢?

通过使用社交框架 – 源代码和截图,从Facebook获取基本信息(id,first_name)

对于后来的文字游戏,我试图通过使用Social框架获取有关玩家的基本信息: ID 名字 性别 位置 (即没有像email敏感,我不使用Facebook的iOS SDK)。 所以在Xcode 5.0.2中,我为iPhone创build了一个空白的单一视图应用程序,并将Social.framework添加到构build阶段选项卡。 然后我将下面的代码添加到ViewController.m中 : #import "ViewController.h" #import <Social/Social.h> #import <Accounts/Accounts.h> #define FB_APP_ID @"432298283565593" //#define FB_APP_ID @"262571703638" @interface ViewController () @property (strong, nonatomic) ACAccountStore *accountStore; @end @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; NSLog(@"Facebook is available: %d", [SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]); [self getMyDetails]; } – (void) getMyDetails { if (!_accountStore) { […]

通过iOS App在Twitter上分享video

是否有可能使用SLRequest共享video? 我可以使用相同的图像分享图像 SLRequest *postRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:requestURL parameters:message]; if (isImage) { NSData *data = UIImagePNGRepresentation(imgSelected); [postRequest addMultipartData:data withName:@"media" type:@"image/png" filename:@"TestImage.png"]; } postRequest.account = account; [postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { if (!error) { NSLog(@"Upload Sucess !"); } }];

使用社交框架检索Twitter OAuth令牌(iOS6)

我有点困惑,我如何使用iOS社交框架获得Twitter OAuth令牌。 假设我在iOS6上有Facebook和Twitter帐户设置,我可以获得ACAccount。 当我检查Facebook ACAccount的ACAccountCredential时,设置了OAuthToken属性,但对于Twitter ACAccount,则不是。 对于Twitter ACAccount的每个其他细节设置只是ACAccountCredential不是。 为了增加混淆,我遇到了一篇关于使用Reverse Auth获取OAuth令牌的文章( https://dev.twitter.com/docs/ios/using-reverse-auth )。 本文讨论如何调用https://api.twitter.com/oauth/request_token并传入oauth_ * params参数(例如consumer_key,nononce等)的字典。但是,将我的ACAccount确实附加到SLRequest中是否可以达到这个目的? 无论如何,当我尝试这个时,我会收到错误“无法validationoauth签名和令牌”。 所以我的问题是我应该在ACAccountCredential中看到Twitter OAuth Token,还是应该使用Reverse Auth? 如果是的话,我需要显式传递包含oauth_ *参数的NSDictionary或附加ACAccount足够?

防止用户修改SLComposeViewController中的部分文本

现在,我们的代码被设置为从UITextField的 setInitialText获取Facebook / Twitterpost的文本。 我们想要做的是:添加额外的永久消息或URL到Facebook / Twitter的post。 我们应该怎么做? 这是我们目前的代码: [slComposeThirdViewController setInitialText:[[self QText]text]]; [self presentViewController:slComposeThirdViewController animated:YES completion:nil];