繁体   English   中英

如何在模拟器中测试LinkedIn SDK?

[英]How can you test the LinkedIn SDK in the simulator?

我必须在一个简单的项目中实现LinkedIn登录,但我目前没有任何可用于开发的iPhone。

问题是,如果没有在手机上安装LinkedIn应用程序,则无法通过LinkedIn登录。 如何在模拟器中安装LinkedIn应用程序?

还有另一种方法可以做到这一点(这不是“等待附近的iPhone”)?

谢谢

你不需要安装App,U调用错误的登录功能。 您必须更新cocoa并添加以下代码才能登录

let linkedInHelper = LinkedinSwiftHelper(configuration: LinkedinSwiftConfiguration(clientId: clientID, clientSecret: clientSecret, state: "linkedin\(Int(Date().timeIntervalSince1970))", permissions: ["r_basicprofile", "r_emailaddress"], redirectUrl: redirectUrl))

    linkedInHelper.authorizeSuccess({ (token) in

     //   appInstance.showLoader()

        //let str  = token.accessToken
        //defaults.setValue(str, forKey: "accesstoken")


        linkedInHelper.requestURL("https://api.linkedin.com/v1/people/~?format=json", requestType: LinkedinSwiftRequestGet, success: { (ProfileResponse) in
          //  appInstance.hideLoader()
            var responseData = [String : AnyObject]()
            responseData = ["userData" : ProfileResponse]

            if pbSocialDelegate != nil
            {
                pbSocialDelegate?.getLinkedinResponse!(userData : responseData)
            }


        })
        { (ErrorIngetProfile) in
            print(ErrorIngetProfile)
        }

    }, error: { (errorInGetToken) in
      //  appInstance.hideLoader()
        print(errorInGetToken)
    }) {
        print("User CancelFlow")
    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM