0

已在应用程序中实现 SoundCloud API。一切正常,使用 SoundCloud IOS 快速入门指南。

- (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];
}];
}

但是,当我在设备 iPhone IOS 6.0 上测试并尝试登录时,SoundCloud 屏幕出现,我添加了我的详细信息,但是当我单击连接 [to SoundCloud] 时,iTunes 播放器打开并且我的应用程序关闭。(这很烦人)我可以重新打开我的应用程序并登录到 SoundCloud。为什么iTunes会打开?当我登录 SoundCloud 时?

4

1 回答 1

2

你把什么定义为你的URL-Schemein YourApplication-Info.plist

请注意,它需要与您Redirect URIhttps://soundcloud.com/you/apps/.

有关自定义 URL 方案的更多信息,请查看Apple 的文档

注册自定义 URL 方案

"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. "

让我知道这是否可以解决您的问题。

于 2013-01-30T21:56:43.747 回答