我在Facebook上创建了新的APP ID,但是我无法在Facebook上发布带有旧app ID的照片

时间:2013-10-18 07:31:28

标签: ios facebook facebook-graph-api

我在Facebook上创建了新的APP ID但是我无法在Facebook上发布这些照片,但是我在几个月后创建的其他APP ID我可以发布它 为什么会这样? APP ID是否需要任何许可?

- (void) startPosting {
spinnerView.labelText = @"Sharing";
[spinnerView startAnimating];

[self takeScreenshot];

FBRequest *request = [[[FBRequest alloc] initWithSession:FBSession.activeSession
               graphPath:@"me/albums"
               parameters:nil
               HTTPMethod:nil] autorelease];

FBRequestConnection *newConnection = [[[FBRequestConnection alloc] init] autorelease];

//1 step - get all albums from user's profile
FBRequestHandler handler = ^(FBRequestConnection *connection, id result, NSError *error) {

    if (error) {
        NSLog ( @"%@", [error localizedDescription]);
        [spinnerView stopAnimating];
    } else {
        NSDictionary *dictionary = (NSDictionary *)result;
        NSArray* albums = [dictionary objectForKey:@"data"];

        NSString* path = @"me/photos";
        for (NSUInteger i = 0; i < [albums count]; ++i)
        {
            NSDictionary* album = [albums objectAtIndex:i];

            NSString* albumType = [album objectForKey:@"type"];
            if ([albumType isEqualToString:@"wall"])
            {
                // publish the image onto the wall
                path = [NSString stringWithFormat:@"%@/photos", [album objectForKey:@"id"]];
                break;
            }
        }

        [self postScreenshot:path];
    }
};
[newConnection addRequest:request completionHandler:handler];
[newConnection start];
}

- (void) postScreenshot:(NSString*)path {
NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                   screenShot, @"picture",
                   [NSString stringWithFormat:@"Check out this %@ chart : %@", [SurveyManager appName],((UILabel*)self.navigationItem.titleView).text], @"message",
                   nil];

FBRequest *request = [[[FBRequest alloc] initWithSession:FBSession.activeSession
               graphPath:path
               parameters:parameters
               HTTPMethod:@"POST"] autorelease];

FBRequestConnection *newConnection = [[[FBRequestConnection alloc] init] autorelease];

FBRequestHandler handler = ^(FBRequestConnection *connection, id result, NSError *error) {
    [spinnerView stopAnimating];
};
[newConnection addRequest:request completionHandler:handler];
[newConnection start];

}

0 个答案:

没有答案