只需自己编写代码,不要使用 Soundcloud-Wrapper,这是一个使用 AFNetworking 的示例:
NSMutableDictionary * parameters = [[NSMutableDictionary alloc]init];
[parameters setObject:@"password" forKey:@"grant_type"];
[parameters setObject:self.emailTextField.text forKey:@"username"];
[parameters setObject:self.passWordTextField.text forKey:@"password"];
[parameters setObject:CLIENT_ID forKey:@"client_id"];
[parameters setObject:CLIENT_SECRET forKey:@"client_secret"];
// Token will not expire
[parameters setObject:@"non-expiring" forKey:@"scope"];
[[SoundCloudClient sharedClient] POST:@"/oauth2/token" parameters:parameters success: ^(NSURLSessionDataTask *task, id responseObject)
{
// Store Access-Token
}
failure: ^(NSURLSessionDataTask *task, NSError *error)
{
// Errorhandling
}];