我曾经使用fabric但没有问题,但自从新的twitterkit 3.0更新后,我跟随了所有的安装文档,但是当我使用TWTRComposer时,我得到应用程序崩溃,出现以下消息:''TWTRInvalidInitializationException',原因: '未尝试在应用设置中设置有效的Twitter工具包URL计划而尝试登录或喜欢Tweet“。似乎无法找出解决方案。在ios中发生Twitterkit 3.0'TWTRInvalidInitializationException'错误
// 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”线应用程序崩溃。我需要使用,由于在ios11改变Twitter的SDK内置帐户功能删除
您可以使用吊舱“吊舱‘TwitterKit’” –
是的我添加twitterKit确实安装pod和所有代码工作正常...错误发生在应用程序共享按钮操作.... composer.show行 –
您在相同的URLSchema中实现fb键和twitter键 –