Get a specific image from any URL like Facebook.

My question may be similar to other questions, but actually it is not (according to my information). I cannot figure out how to get a specific image from any URL. Like Facebook, I can’t show you a screenshot because I don’t have a real device. but I can show you a screenshot of Skype taken from the MAC. Any help would be appreciated. thanks. enter image description here
EDIT:
I have an icon with this link, but it is very small, I want a larger one.

+7
ios objective-c xcode nsurl
source share
1 answer
Finally, I got an answer. this may be useful for you, so I am posting this answer.
use this macro
#define FACEBOOK_GRAPH @"https://graph.facebook.com/v2.3/oauth/access_token?client_id=USE_YOUR_CLIENT_ID&client_secret=USE_YOUR_CLIENT_SECRET&grant_type=client_credentials"
NOTE. you can get "client_id" and "client_secret" by registering your application on developer.facebook.com, now call FACEBOOK_GRAPH as below.
 AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager]; //manager.responseSerializer = [AFHTTPResponseSerializer serializer]; manager.responseSerializer=[AFJSONResponseSerializer new]; AFHTTPRequestOperation* operation = [manager POST:FACEBOOK_GRAPH parameters:nil success:^(AFHTTPRequestOperation* op, id responseObject){ //here pass your URL as a string and access Token as a string, access token will found in responseObject } failure:^(AFHTTPRequestOperation* op, NSError* error){ NSLog(@"\n\nerror--->%@\n\n",error.localizedDescription); }]; [operation start]; 

now the second way to get the image from our URL, use our URL and access the token obtained above,

 url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; token = [token stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager]; manager.responseSerializer=[AFJSONResponseSerializer new]; AFHTTPRequestOperation* operation = [manager POST:[NSString stringWithFormat:@"https://graph.facebook.com/v2.3/?id=%@&access_token=%@&scrape=true",url,token] parameters:nil success:^(AFHTTPRequestOperation* op, id responseObject){ NSLog(@"\n\nData Response==\n%@\n",responseObject); //you will get Image URL in response }failure:^(AFHTTPRequestOperation* op, NSError* error){ NSLog(@"##error--->\n%@",error.localizedDescription); }]; [operation start]; 
+6
source share

All Articles