Tag: Facebook

ios,Facebook和获取个人资料图片

我想获得Facebook朋友的个人资料图片。 我知道我可以在代码中通过获取用户id和使用此链接:userID / picture“> http://graph.facebook.com/ userID / picture。有没有更容易的方法来从Facebook的SDK获取个人资料图像?

在Facebook上添加当前位置发布video

我需要使用place密钥在Fac​​ebook中发布place 。 如图所示 起初我以为我不得不把经纬度的一个物体放到一个称为键的位置。 然后我意识到你必须在一个place发送关键的place_id pipe理得到与此最接近的place_id NSMutableDictionary *params2 = [NSMutableDictionary dictionaryWithCapacity:4L]; [params2 setObject:@"37.416382,-122.152659" forKey:@"center"]; //Hard code coordinates for test [params2 setObject:@"place" forKey:@"type"]; [params2 setObject:@"1000" forKey:@"distance"]; [[[FBSDKGraphRequest alloc] initWithGraphPath:@"/search" parameters:params2 HTTPMethod:@"GET"] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { NSLog(@"RESPONSE!!! /search"); NSLog(@"result %@",result); NSLog(@"error %@",error); }]; 所以,当我试图发送一个职位使用/me/videos的位置,出现一个错误。 (#3) Application does not have the capability to make this […]

有没有办法强制parse.com单设备login?

我正在开发一个应用程序,我需要非常节俭的API请求,要求越less越好。 问题是每个用户都有设置和消息,我想避免每次唤醒时都可能发生的变化。 我不能依靠每个用户都能启用推送通知。 我的做法是强制执行一个用户只能使用一个设备login的折衷办法。 如果他们尝试使用其他设备(通过Facebook)login,他们会收到错误消息,他们可以select取消login或继续远程登出其他设备。 这可能吗?

FBSDKAppInviteDialog的closures和结果总是奇怪的行为(null)

我正在尝试在我的Ios应用程序中实现应用程序邀请stream程。 这是我使用的代码: -(void)Invite{ FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init]; content.appLinkURL = [NSURL URLWithString:@"http://www.sdfsdfadfa.net"]; // present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate` [FBSDKAppInviteDialog showFromViewController:self withContent:content delegate:self]; } -(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results { NSLog(@"result::%@",results); } -(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error { NSLog(@"error::%@",error); } 这是我的应用程序链接如下所示: <html> <head> <meta property="al:ios:url" content="my-app://" /> <meta property="al:ios:app_store_id" content="fake2342" /> <meta property="al:ios:app_name" content="Myapp" /> […]

在Facebooklogin之后,麻烦推到PFQueryTableViewController

我成功loginFacebook。 login视图是一个UIViewController。 我只能通过使用访问Parse的loginfunction @interface LoginViewController : UIViewController <PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate> 问题是,一旦我成功login,我想用户看到一个PFQueryTableViewController。 该应用程序都是基于列表,所以推动这一点是有道理的。 我试过这个: – (void)logInViewController:(PFLogInViewController *)logInController didLogInUser:(PFUser *)user { [self dismissViewControllerAnimated:YES completion:^{ NSLog(@"Successfully logged in."); MyPFQueryTableViewController *controller = [[MyPFQueryTableViewController alloc] init]; //Not sure what to do here… }]; } 原来我推到了TableView。 我已经删除了这个代码,坦率地说,我不知道我是怎么做到的。 但是,发生了什么事,我看到UIViewController一秒钟,然后出现PFQueryTableViewController。 不仅如此,PFQueryTableViewController也不显示导航栏,即使表格embedded在导航控制器中。 这是我的LoginViewController.m的代码 #import "LoginViewController.h" #import <Parse/Parse.h> #import "MyPFQueryTableViewController.h" @interface LoginViewController () @end @implementation LoginViewController […]

PFFVideosUtilslogin后台无法将值转换为PFUserResultBlock

用下面的代码: @IBAction func FBLogin(sender: AnyObject) { @IBAction func FBLogin(sender: AnyObject) { PFFacebookUtils.logInInBackgroundWithReadPermissions(self.permissions){ (user: PFUser!, error: NSError!) -> Void in if user == nil { NSLog("Login Canceled") } else if user.isNew { NSLog ("user signed up and logged in through FB") } else { NSLog ("user logged in through FB") } } } 我收到以下错误: “无法将types的值(PFUser!,NSError!) – […]

无法获得user_events脸书的权限

我正在尝试获取用户所创build的所有事件,我试图请求访问user_events的权限。 不过到目前为止,facebook并没有要求用户访问事件的权限。 我已经检查了testing用户应用权限configuration文件,我的应用只获取configuration文件信息,但不是事件设置。 我使用的Facebook的SDK是3.19 if ([FBSession.activeSession.permissions indexOfObject:@"user_events"]==NSNotFound) { [FBSession.activeSession requestNewReadPermissions:@[@"user_events"] completionHandler:^(FBSession *session, NSError *error) { if (!error) { action(); } else if (error.fberrorCategory != FBErrorCategoryUserCancelled) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Permission denied" message:@"Unable to get permission to post" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; } }]; } else { action(); }

使用会话处理Facebook iOS中的取消button

我试图search这个,但找不到任何有用的东西。 [FBSession setActiveSession:[[FBSession alloc] initWithPermissions:[NSArray arrayWithObjects:@"publish_actions,read_stream,user_hometown,user_birthday,email", nil]]]; [[FBSession activeSession] openWithBehavior:FBSessionLoginBehaviorForcingWebView completionHandler: ^(FBSession *session,FBSessionState state,NSError *error) { if(state == FBSessionStateOpen) { // use user's detail and post on Facebook } }]; 现在这对我来说工作得很好。 但是,如果用户在loginFacebook之前按下closures/取消button,该怎么办? 如果用户按下取消button,我需要执行一组语句。 我怎样才能做到这一点。 任何帮助,将不胜感激。

iOS用最新的FBSDK获取用户的家乡

我找不到Facebook SDK的快速文档。 我正在使用最新版本,并设法检索用户的姓名,年龄,邮件和个人资料图片。 我找不到如何find家乡。 当我尝试这个: conn.addRequest(req, completionHandler: { (connection: FBSDKGraphRequestConnection!, result: AnyObject!, error: NSError!) -> Void in if(error != nil){ println(error) } else { let loc = result.objectForKey("hometown") // loc is nil } }) conn.start() 我发现零。 我知道“.objectForKey(”hometown“)”应该返回一个“Page”而不是一个“string”,但我不知道如何处理一个页面。 谢谢你的帮助! 干杯 编辑:(感谢托比)我需要在login权限添加user_location ,然后,find的位置,我用: let obj = result.objectForKey("location") let location = obj.objectForKey("name") as! String

Facebook iOS SDK 4.0.1“您必须将此应用升级到Graph API v2.x”

我正在尝试升级一个Facebook应用程序使用即将被弃用的1.0 API到当前的。 我用当前的(4.0.1)replace了框架(FBSDKCoreKit,FBSDKLoginKit)。 当我使用web-fallbacklogin时,这样做会升级应用程序。 但是,当我通过Facebook应用程序login时,我仍然得到弃用警告。 这是我的(抽象)代码: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog(@"SDK version: %@", [FBSDKSettings sdkVersion]); // Prints "SDK version: 4.0.1 UIViewController *vc = [UIViewController new]; FBSDKLoginButton *loginButton = [FBSDKLoginButton new]; loginButton.frame = CGRectMake(10, 200, 300, 50); [vc.view addSubview:loginButton]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = vc; [self.window makeKeyAndVisible]; return YES; } […]