关注用户给出了禁止使用Swift SoundcloudSDK的401 - 我在这里缺少什么?

时间:2016-05-13 15:01:33

标签: ios swift sdk soundcloud

我使用soundcloudSDk进行swift(https://github.com/delannoyk/SoundcloudSDK)。

我试图让用户关注其他用户,但似乎无法使其正常运行。我收到错误消息" Soundcloud.SoundcloudError.Forbidden"当试图跟随另一个用户。我错过了什么吗?

这是我的代码

    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)
                })


            })
        })

   }

感谢任何帮助!

0 个答案:

没有答案