小编Feb*_*n P的帖子

获取Facebook的App链接主机API

我正在尝试使用facebook图形版本方法为IOS获取app_link_hosts,但我收到错误消息.任何人都可以帮我解决这个问题.Facebook和App Link的文档不清楚.

这是代码,

 NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
                        @"app name", @"name",
                        theUrl, @"al:ios:url",
                        @"app store id", @"al:ios_id",
                        @"app name", @"al:ios:app_name",
                        @"{\"should_fallback\": false}", @"web",
                        fbAccessToken, @"access_token",
                        nil
                        ];

/* make the API call */

[FBRequestConnection startWithGraphPath:@"/(fb app id)/app_link_hosts"
                             parameters:params
                             HTTPMethod:@"POST"
                      completionHandler:^(
                                          FBRequestConnection *connection,
                                          id result,
                                          NSError *error
                                          ) {
                          /* handle the result */
                          NSLog(@"Result = %@",result);
                          if(error) NSLog(@"error = %@",error);
                      }];
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误,

 error = Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x8c7d4b0 {com.facebook.sdk:HTTPStatusCode=403, com.facebook.sdk:ParsedJSONResponseKey={
body = …
Run Code Online (Sandbox Code Playgroud)

facebook-graph-api ios

6
推荐指数
1
解决办法
485
查看次数

IOS 6和IOS 5中的FaceBook签入

我有一些不同商店的预定义位置.我想通过我的IOS应用程序登录这些位置.我该怎么办?

这是我用于IOS 5的代码

AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
SBJSON *jsonWriter = [SBJSON new];
NSMutableDictionary *coordinatesDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                              [NSString stringWithFormat: @"%f", latitude], @"latitude",
                                              [NSString stringWithFormat: @"%f", longitude], @"longitude",
                                              nil];
NSString *coordinates = [jsonWriter stringWithObject:coordinatesDictionary];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               [[placesArray objectAtIndex:indexPath.row] objectForKey:@"id"], @"place", //The PlaceID
                               coordinates, @"coordinates", // The latitude and longitude in string format (JSON)
                               @"Testing check in", @"message", // The status message
                               nil];
//                                       tags, @"tags", // The user's friends who are being checked in

[[appDelegate …
Run Code Online (Sandbox Code Playgroud)

xcode facebook ios ios5 ios6

5
推荐指数
0
解决办法
455
查看次数

标签 统计

ios ×2

facebook ×1

facebook-graph-api ×1

ios5 ×1

ios6 ×1

xcode ×1