我使用fabric没有问题,但自从新的twitterkit 3.0更新后,我遵循了所有的安装文档,但当我使用TWTRComposer时,我的应用程序崩溃了,并显示以下消息:“TWTRInvalidInitializationException”,原因:‘在应用程序设置中没有设置有效的Twitter Kit URL方案的情况下尝试登录或像推特一样。’似乎找不到解决方案。
// 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>不是应用程序启动没有问题,但是当我在twitter上按下按钮进行分享时,twitter composer是call,并且在"composer.show“行上应用程序崩溃。我需要使用twitter sdk,因为ios11内置帐户功能删除中的更改
https://stackoverflow.com/questions/44651236
复制相似问题