I have integrated in a ios app VimeoNetworking , using the code from the git directly because i cannot integrate using cocoapods (not compatible use of use_frameworks! with other pods) for getting private link to some videos (i have a pro account).
I'm able to authenticate and request video info. When the request is returned and assigned to the class (VIMVideo) the object is not loaded correctly.
If i get the response returned returns correctly a dictionary of 30 items with the video info.
I have checked the same code from the VimeoNetworking example code and it's works in the other project (using same credentials, only different one use pod of Vimeo and the other not)
If i compare the two json responses, both have the same data but in a different order. I have the feeling that the problem is with the de-serialization used by AFNetworking (3.1.0)
Previous authentication
let authenticationController = AuthenticationController(client: VimeoClient.defaultClient, appConfiguration: AppConfiguration.defaultConfiguration, configureSessionManagerBlock: nil)
authenticationController.accessToken(token:tkn) { result in
switch result
{
case .success(let account):
print("authenticated successfully: \(account)")
break;
case .failure(let error):
print("failure authenticating: \(error)")
}
}
Video Request
let requestdir: Request<VIMVideo> = Request<VIMVideo>(path: "/videos/XXXXXXXX")
let _ = VimeoClient.defaultClient.request(requestdir) { [weak self] result in
switch result
{
case .success(let response):
//Here videodir have not value, but
var videodir: VIMVideo! = response.model
case .failure(let error):
let title = "Video Request Failed"
let message = "\(requestdir.path) could not be loaded: \(error.localizedDescription)"
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
let action = UIAlertAction(title: "OK", style: .default, handler: nil)
alert.addAction(action)
strongSelf.present(alert, animated: true, completion: nil)
}
}
Console capture (1)
Pod file from VIMEO EXAMPLE (Extract)
def shared_pods
pod 'AFNetworking', '3.1.0'
pod 'SwiftLint', '0.25.1'
pod 'VimeoNetworking', :path => '../VimeoNetworking'
end
Pod file from my project (Extract)
target 'LibroDig' do
pod 'RestKit', '~> 0.27.3'
pod 'JSONModel'
pod 'SDWebImage', '~>3.8'
pod 'AFNetworking', '3.1.0'
end
I expected the VIMVideo load correctly all the properties. I'm unable to find the difference between the 2 implementations.
Thanks in advance