简体   繁体   中英

How can you test the LinkedIn SDK in the simulator?

I have to implement LinkedIn login in a simple project, but I currently don't have any iPhone I can use to develop.

The problem being that you can't login through LinkedIn without having installed the LinkedIn app on your phone. How can I install the LinkedIn app in the simulator ?

Is there another way to do this (which is not "wait to have an iPhone nearby") ?

Thanks

You don't need to install App, U call wrong function for login. You have to update cocoa and add below code for login

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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