Have implemented SoundCloud API into app. All working well, using the SoundCloud IOS Quick Start guide.
- (IBAction) login:(id) sender
{
SCLoginViewControllerCompletionHandler handler = ^(NSError *error) {
if (SC_CANCELED(error)) {
NSLog(@"Canceled!");
} else if (error) {
NSLog(@"Error: %@", [error localizedDescription]);
} else {
NSLog(@"Done!");
}
};
[SCSoundCloud requestAccessWithPreparedAuthorizationURLHandler:^(NSURL *preparedURL) {
SCLoginViewController *loginViewController;
loginViewController = [SCLoginViewController
loginViewControllerWithPreparedURL:preparedURL
completionHandler:handler];
[self presentModalViewController:loginViewController animated:YES];
}];
}
However, when I test on device iPhone IOS 6.0 – and try and login in – the SoundCloud screen appears, I add my details, but when I click connect [to SoundCloud], the iTunes player opens and my app closes. (Which is annoying) I can reopen my app and am logged into SoundCloud. Why would iTunes open? When I am logging into SoundCloud?
What did you define as your
URL-SchemeinYourApplication-Info.plist?Please note that it needs to match what you have assigned as the
Redirect URIparam athttps://soundcloud.com/you/apps/.For more information about custom URL schemes check Apple’s documentation
Registering Custom URL Schemes
"To register a URL type for your app, include the CFBundleURLTypes key in your app’s Info.plist file. The CFBundleURLTypes key contains an array of dictionaries, each of which defines a URL scheme the app supports.
"
Let me know if this solves your problem.