iOS版アプリに Twitter Kit を組み込んだ。
インストール方法は、次に説明がある。
github.com
まず、次のエラーが表示され、動作対象を iOS 9.0 以降にしないといけなかった。
error: "TwitterKit doesn't support iOS 8.x and lower. Please, change your minimum deployment target to iOS 9.0"
Tweet すると、次のエラーが表示された。
'TWTRInvalidInitializationException', reason: '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.'
原因は Info.Plist の記述だった。
<key>CFBundleURLSchemes</key> <array> <string>twitterkit-<consumerKey></string> </array>
と書くべきところ、次のように、空白が一個入っていた。
<key>CFBundleURLSchemes</key> <array> <string>twitterkit-<consumerKey> </string> </array>