Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSMutableDictionary* params = [NSMutableDictionary NictionaryWithObjectsAndKeys:_facebook.accessToken,@"access_token",nil];
- [_facebook requestWithGraphPath:@"me/albums" andParams:params andDelegate:self];
- NSURL *url1 = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/photos&access_token=AAACeFkezepQBANpoFq9I3Hts0JdE6Xis3UpZBqNxpgw62zWSlhSYyYcluGaaxH3IlKIh9w8OYrXYF9MsAxhk6ta1ANZClCaznpdSaERgZDZD",A_ID]];
- URLWithString:@"https://graph.facebook.com/114750591966408/photos&access_token=//AAACeFkezepQBANpoFq9I3Hts0JdE6Xis3UyYcluGaaxH3IlKIh9w8OYrXYF9MsAxhk6ta1ANZClCaznpdSaERgZDZD"];
- NSData *data1 = [NSData dataWithContentsOfURL:url1];
- NSString *str1=[[NSString alloc] initWithData:data1 encoding:NSASCIIStringEncoding];
- // NSString *str1=[[NSString alloc]ini]
- NSDictionary *userData1 = [str1 JSONValue];
- NSArray *arrOfimages=[userData1 objectForKey:@"data"];
- NSMutableArray *sourceUrls = [[NSMutableArray alloc] initWithCapacity:0];
- for(NSDictionary *subDictionary in arrOfimages)
- {
- [sourceUrls addObject:[subDictionary objectForKey:@"picture"]];
- }
- [FBRequestConnection startWithGraphPath:@"me/albums"
- completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
- if (!error) {
- // Success! Include your code to handle the results here
- NSLog(@"user events: %@", result);
- NSArray *feed =[result objectForKey:@"data"];
- for (NSDictionary *dict in feed) {
- NSLog(@"first %@",dict);
- }
- } else {
- // An error occurred, we need to handle the error
- // Check out our error handling guide: https://developers.facebook.com/docs/ios/errors/
- NSLog(@"error %@", error.description);
- }
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement