2015-01-14 28 views
0

我正在構建iOS應用程序並試圖使用SoundCloud API。我註冊了我的應用程序並創建了一個redirectURI:APP_NAME:// soundcloud。然後,在Xcode中,我添加了一個URL方案爲APP_NAME和URL標識符com.BUNDLE_IDENTIFIER在我的AppDelegate執行以下操作:plist中使用OAuth2的URL方案

[SCSoundCloud setClientID:@"CLIENT_ID" 
        secret:@"SECRET" 
       redirectURL:[NSURL URLWithString:@"APP_NAME://soundcloud"]]; 

如果我啓動仿真器上的應用程序,然後鍵入APP_NAME:// soundcloud到Safari的地址欄,它成功地將我反彈回我的應用程序。然而,在應用程序中,我不斷收到以下錯誤:

*** Assertion failure in +[SCRequest performMethod:onResource:usingParameters:withAccount:sendingProgressHandler:responseHandler:] 

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Resource '(null)' is invalid because the scheme is not 'https'.' 

爲什麼是資源「(空)」和方案的「https」?我在哪裏改變這個,我該如何解決這個錯誤?

回答

0

我一直在我的項目中使用SoundCloud庫。由於不是最新的,它有一些缺陷和錯誤。所以最後我決定在Github上創建自己的圖書館和發佈:

ABMSoundCloudAPI on Github

也許這可能對您有用:)