delannoyk / SoundcloudSDK

A Client for Soundcloud's API written in Swift!
MIT License
87 stars 27 forks source link

What am I doing wrong here? #17

Closed tobbe01 closed 8 years ago

tobbe01 commented 8 years ago

Im trying to make a user follow another user but can't seem to get it working. I get the error message "Soundcloud.SoundcloudError.Forbidden" when trying to follow another user. Am I missing something?

Here is my code

Soundcloud.clientIdentifier = "my identifier"
Soundcloud.clientSecret  = "my secret"
Soundcloud.redirectURI = "my redirect uri"

Session.login(self) { (session: SimpleAPIResponse<Session>) in

    var SCSession = Soundcloud.session
    //Im getting a session if I'm printing it out
    //SCSession Optional(<Soundcloud.Session: 0x7fe272d88af0>)

    SCSession?.refreshSession({ (refreshedSession: SimpleAPIResponse<Session>) in

        SCSession?.me({ (user: SimpleAPIResponse<User>) in

            //Im getting my user if printing the result so it looks like I'm actually getting the session so I'm able to make private calls.

            //Here I'm trying to follow a random user and this is when it stops working
            user.response.result?.follow(183643398, completion: { (answer: SimpleAPIResponse<Bool>) in
                print("Followed user", answer.response.isSuccessful)
                print("Followed user", answer.response.error)
                print("Followed user", answer.response.result)
            })

        })
    })

} Sorry to put this as an issue, just getting desperate here... Thankful for any help!

delannoyk commented 8 years ago

Hi, it seems like Soundcloud changed the API once again. This is fixed in 0.8.1 which is available. Thanks for reporting this!