我使用https://gist.github.com/rtt/10403467作为参考,但我无法登录Tinder。我得到一个空白的答复。
NSURL *url = [NSURL URLWithString:@"https://api.gotinder.com/auth"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
//NSString *str = [NSString stringWithFormat:@"{\"facebook_token\": %@, \"facebook_id\": %@}",accessToken,userID];
NSDictionary *dataDict = [NSDictionary dictionaryWithObjectsAndKeys:accessToken, @"facebook_token", userID, @"facebook_id", nil];
NSData *dataFromDict = [NSJSONSerialization dataWithJSONObject:dataDict
options:NSJSONReadingAllowFragments
error:nil];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
//[request setHTTPBody:[str dataUsingEncoding:NSASCIIStringEncoding]];
[request setHTTPBody:dataFromDict];
[request setValue:@"Tinder/4.1.4 (iPhone; iOS 9.3; Scale/2.00)" forHTTPHeaderField:@"User-Agent"];
[request setValue:@"ios" forHTTPHeaderField:@"platform"];
[request setValue:@"1.0" forHTTPHeaderField:@"app-version"];
[request setValue:[NSString stringWithFormat:@"%lu",[dataFromDict length]] forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request
delegate:self];
[connection start];
请帮忙