VIMNetworking icon indicating copy to clipboard operation
VIMNetworking copied to clipboard

VIMNetworking seems do not support iOS10

Open geek1250 opened this issue 9 years ago • 2 comments

Issue Summary

A brief but thorough description of the issue. the same code run well on iPhone6 simulator(version iOS9.3), but when I turn to iPhone6 simulator(version iOS10), it seems have authorization problem.

Reproduction Steps

Detailed steps to reproduce the issue. Swift Code(VimeoNetworking also run well on iOS9.3 simulator, but when I turn to iOS10, VimeoNetworkingExample-iOS tell me I misconfig Client Identifier):

  1. in any file in which call open vimeo authorization page:
      let url = VIMSession.sharedSession()!.authenticator.codeGrantAuthorizationURL()
      UIApplication.sharedApplication().openURL(url!)
  1. in AppDelegate.swift func application(application: UIApplication, openURL url: NSURL, options: [String: AnyObject]) -> Bool {
    if ((VIMSession.sharedSession()?.client.accessibilityActivate()) != nil) {
        let desc = VIMRequestDescriptor()
        desc.urlPath = "/me/videos" 
        desc.modelClass = VIMVideo.classForCoder()
        desc.modelKeyPath = "data"

        VIMSession.sharedSession()!.client.requestDescriptor(desc) { (resp, err) in
            let v = resp?.result
            if(err != nil) {
                print("error : \(err)")//in iOS6 10.0 failed: unauthorized (401)}
            }else {
                debugPrint(v)
                for video in v as! [VIMVideo]
                {
                    print("retrieved video: \(video)")
                    print(video.name)
                    print(video.link)
                }
            }
        }
    }
    else {
        VIMSession.sharedSession()?.authenticateWithCodeGrantResponseURL(url, completionBlock: { (error) in
            if error == nil {
                print("Succusee Auth")
            }else{
                print("fail in Auth")
            }

        })
    }
    return true
}

Expected Behavior

What do you expect to happen as a result of the reproduction steps?

it should jump to debugPrint(v) sentance and then I can get video information

Actual Behavior

What currently happens as a result of the reproduction steps? In dubgu mode at the sentance "print("error : (err)")", I got the following information: error : Optional(Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x60800023a040> { URL: https://api.vimeo.com/me/videos } { status code: 401, headers { "Accept-Ranges" = bytes; "Cache-Control" = "no-cache, max-age=315360000"; Connection = "keep-alive"; "Content-Encoding" = gzip; "Content-Length" = 82; "Content-Type" = "application/vnd.vimeo.error+json"; Date = "Wed, 21 Sep 2016 18:57:39 GMT"; Expires = "Sat, 19 Sep 2026 18:57:39 GMT"; "Fastly-Debug-Digest" = 671da88c3ec81bbd101a0bb851a90184165c1f4f3599229b0eb782c555e41ae7; Server = nginx; "Strict-Transport-Security" = "max-age=15552000; includeSubDomains; preload"; Vary = "Accept,Vimeo-Client-Id,Accept-Encoding"; Via = "1.1 varnish, 1.1 varnish"; "X-Cache" = "MISS, MISS"; "X-Cache-Hits" = "0, 0"; "X-RateLimit-Limit" = 100; "X-RateLimit-Remaining" = 96; "X-RateLimit-Reset" = "2016-09-21T19:12:39+00:00"; "X-Served-By" = "cache-iad2121-IAD, cache-ord1729-ORD"; "X-Timer" = "S1474484259.170269,VS0,VE52"; } }, NSErrorFailingURLKey=https://api.vimeo.com/me/videos, com.alamofire.serialization.response.error.data=<7b226572 726f7222 3a22596f 75206d75 73742070 726f7669 64652061 2076616c 69642061 75746865 6e746963 61746564 20616363 65737320 746f6b65 6e2e227d>, NSLocalizedDescription=Request failed: unauthorized (401)}) (lldb)

geek1250 avatar Sep 21 '16 19:09 geek1250

Similar problem. Any fix?

adiusu avatar Sep 29 '16 19:09 adiusu

They told me there is no problem on iOS because Cameo also uses this SDK. But I still meet this error.

geek1250 avatar Sep 29 '16 19:09 geek1250