twitter接入問題記錄

1,URL Scheme配置問題
  • question:
    'Attempt made to Log in or Like a Tweet without a valid Twitter Kit URL Scheme set up in the app settings. Please see https://dev.twitter.com/twitterkit/ios/installation for more info.'

  • answer1:
    I got it too, and you just have to do what it says, you have to add a URL scheme to the info.plist. It is explained in the link.

  • answer2:
    The trick was to add the scheme by itself with a new role. Not an issue if it's your first scheme but easy to mess up if you have multiple.

總結(jié):
上面是兩個(gè)循序漸進(jìn)的答案:
第一, info.flist里面增加一個(gè) URL scheme;
第二,確保是在現(xiàn)有URL types下增加新的URL scheme,不是新增URL types

如圖


Snip20170626_7.png

參考:
https://twittercommunity.com/t/twitterkit-v3-causes-exception-upon-sign-in-on-ios/88143/2

2, 需要設(shè)置Callback URL
  • question:
[TwitterKit] did encounter error with message "Error obtaining user auth token.": Error Domain=TWTRLogInErrorDomain Code=-1 "<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <error>Desktop applications only support the oauth_callback value 'oob'</error>
  <request>/oauth/request_token</request>
</hash>
" UserInfo={NSLocalizedDescription=<?xml version="1.0" encoding="UTF-8"?>
<hash>
  <error>Desktop applications only support the oauth_callback value 'oob'</error>
  <request>/oauth/request_token</request>
</hash>
}
  • answer:
    I am facing the same issue as in the question. I have just set the callBack Url into the Twitter App and resolved the issues.
    Go to https://apps.twitter.com/app -> Settings -> Callback URL and Update Settings to save.

總結(jié):
必須要設(shè)置Callback URL
Callback URL最新格式:

twitterkit-{consumer/api key}://
For example:
twitterkit-128238aKjqlp123AKdasdf://

如果不按照這樣設(shè)置,會(huì)報(bào)下面的錯(cuò)誤:
Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings
參考:
https://stackoverflow.com/questions/40863953/getting-errors-from-twitter-sharedinstance-switf-3-ios-10

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • 暢讀完邊城他給我的感覺只有兩個(gè)字,純凈。是大雪過后的土地一片潔白,也是晴朗的天,萬里無云。 在這里一切都是純凈的。...
    濁言閱讀 541評(píng)論 0 0
  • 城市的清醒 從凌晨四點(diǎn)半的街開始 驕縱的夜 不辭而別 涼涼的風(fēng) 開始靜靜地慢慢地吹 凌晨四點(diǎn)半的街 不需要路人穿街...
    嘿?zèng)]有了閱讀 454評(píng)論 2 4
  • 親愛的某某某: 你好! 對(duì)于你,我無法定義“愛”或“不愛”。但我知道,不管怎樣,我們此生都...
    布聽風(fēng)閱讀 254評(píng)論 0 0
  • 輕輕地, 你來了, 笑得那么溫暖, 好似你一直在。 輕輕地, 你走了。 夢(mèng)醒了, 恍若你不曾來。
    大師兄不是man閱讀 263評(píng)論 6 2