Search code examples
swiftvimeovimeo-apivimeo-ios

Using VIMNetworking to call Vimeo API's but the file's of the VIMVideo objects are nil and I am a PRO user?


I'm trying to write an app to show videos from a few of my channels in Vimeo. I am using VIMNetworking sdk provided by vimeo and I am using a pro account. I am first setting up my session and authentication in my AppDelegate:

let config = VIMSessionConfiguration()
config.clientKey = KEY
config.clientSecret = SECRET
config.scope = "public"
config.keychainService = SERVICE

VIMSession.setupWithConfiguration(config)

let acc = VIMAccountNew()
acc.accessToken = ACCESSTOKEN
acc.tokenType = "bearer"
acc.scope = "public"

VIMSession.sharedSession()?.changeAccount(acc)

and I am fetching videos from my channel like this:

let desc = VIMRequestDescriptor()
desc.urlPath = "/channels/1015923/videos"
desc.modelClass = VIMVideo.classForCoder()
desc.modelKeyPath = "data"

VIMSession.sharedSession()!.client.requestDescriptor(desc) { (resp, err) in
        let v = resp?.result

        debugPrint(v)

        self.videos.insert((v as? NSArray)!, atIndex: 0)
}

So when I goto to access the video objects, I see the name and all the data associated with it except but the files property is nil. I understand I have to auth as my pro account to see the files, but I thought I was doing so? I need to see the files so that I can stream them to the player in the app.


Solution

  • I must have had a cached request or something. I am getting the video files now. Thanks for the help anyways!