[英]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.