We tried to get rid of the major obstacles that occurred while using the API wrapper. Therefore we had to change the interface but instead of adding stuff we tried to get rid of everything that was distracting. The next sections will describe in a short manner what was removed, what was renamed and what you have to do to move to version 2.
-
Removed the
status
. It had too much complexity attached to it. Therefore addedisAuthenticated
which is a simple BOOL to check if the API is connected already. -
Also removed the delegate method
soundCloudAPI:didChangeAuthenticationStatus:
and replaced it withsoundCloudAPIDidAuthenticate:
andsoundCloudAPIDidResetAuthentication:
-
The verifier was removed since it's not needed anymore with OAuth2
-
soundCloudAPI:requestedAuthenticationWithURL:
was renamed tosoundCloudAPI:preparedAuthorizationURL:
-
soundCloudAPI:didEncounterError:
was renamed tosoundCloudAPI:didFailToGetAccessTokenWithError:
-
configurationForSoundCloudAPI:
was removed. You pass the API configuration in the initializer of the API object now. -
performMethod:onResource:withParameters:context:
was renamed to-performMethod:onResource:withParameters:context:connectionDelegate:
and now takes a connection delegate and returns a SCSoundCloudConnection object -
SCSoundCloudAPIDelegate
was moved intoSCSoundCloudConnectionDelegate
. The connection delegate can now be set per request and not API wide. -
Also
-cancelRequest:
was removed. Use-cancel
inSCSoundCloudConnection
now. -
The authentication process was streamlined. Therefore
-authorizeRequestToken
was removed and-handleOpenRedirectURL:
and-authorizeWithUsername:password:
were added. See next chapter.
The authentication process was too complicated in the previous version. So we streamlined it. Also there's a second authentication scheme now (user credentials). See previous sections for details. This section describes how the process changed.
In version 1 -soundCloudAPIdidChangeAuthenticationStatus:
had to be implemented and depending on the status different things had to be triggered. Since we got rid of all the different statuses this There's not much left for you to implement :)
In -soundCloudAPI:preparedAuthorizationURL:
you just have to decide which authentication flow you're using and depending on that either open a webView (or the browser) and present the user with the authentication page, or query the user for username & password. Once you got the response from either your URL callback or the username and password you pass them to the API with either -handleOpenRedirectURL:
or -authorizeWithUsername:password:
. That's it.
The wrapper is still subject to change. Although we thing that v2.0beta3 should be quite stable in it's interface now. But we're willing to optimize things even further and are hoping for your input.
- Renamed
-soundCloudAPIDidGetAccessToken:
to-soundCloudAPIDidAuthenticate:
& added-soundCloudAPIDidResetAuthentication:
- Introduced
SCSoundCloudAPIConnection
and addedconnectionDelegate:
per request - Moved
SCSoundCloudAPIDelegate
intoSCSoundCloudAPIConnectionDelegate
This version is a complete redesign of the API of the project. Also the project now contains a UI to simplify sharing sounds to SoundCloud. Building a new app starting with this version is quite easy. Upgrading your app to this version needs major changes.
Although we think that this version is quite stable, changes may be possible.