Я использовал ткань без проблем, но после нового обновления twitterkit 3.0 я следовал всему документу по установке, но когда я использую TWTRComposer, я получаю сбой приложения со следующим сообщением: «'TWTRInvalidInitializationException', причина: 'Попытка войти в систему или лайкнуть твит без действующая схема URL-адресов Twitter Kit, настроенная в настройках приложения». Не могу найти решение.
// Swift
let composer = TWTRComposer()
composer.setText("just setting up my Twitter Kit")
composer.setImage(image.image)
// Called from a UIViewController
composer.show(from: self.navigationController!) { (result) in
if (result == .done) {
print("Successfully composed Tweet")
} else {
print("Cancelled composing")
}
}
Ниже приведен код делегата приложения didFinishLaunchingWithOptions.
Twitter.sharedInstance().start(withConsumerKey:"xxxxxxxxxxxx", consumerSecret:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
Ниже приведен мой код infoPlist.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>twitterkit-consumentkeyxxxxxxx</string>
<string>fbkeyxxxxxxxxxxxx</string>
<string>xxxxxxxxx</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
<string>twitter</string>
<string>twitterauth</string>
</array>
Нет проблем с запуском приложения, но когда я нажимаю кнопку, чтобы поделиться в твиттере, вызывается твиттер-композитор, а в строке «composer.show» приложение вылетает. Мне нужно было использовать twitter sdk из-за изменения функции удаления встроенной учетной записи ios11