当我尝试使用twitter登录时,我的应用程序崩溃,并带有错误消息
尝试登录或类似Tweet,而没有在应用程序设置中设置有效的Twitter方案。请参阅 https://dev.twitter.com/twitterkit/ios/installation 以获取更多信息.
我已经使用fabric.But应用了twitter登录后,我的代码从斯威夫特2.3转换为斯威夫特3,它开始崩溃,我也更新了我的豆荚,并重新应用步骤再次登录,没有面料,因为织物现在没有显示推特选项。但坠机事件依然存在。
发布于 2017-06-22 07:14:38
如果我正确地理解了您使用了Twitter,那么我假设您的AppDelegate中有这样的内容:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Fabric.with([Twitter.self])
return true
}
请注意,由于Google获得了Fabric,所以您应该使用:
Twitter.sharedInstance().start(withConsumerKey:"yourAppKey", consumerSecret:"yourAppSecret")
您还应该将Info.plist配置为包含TwitterKit的URL方案,如下所示:
参考:https://dev.twitter.com/twitterkit/ios/installation
PS:确保CFBundleURLSchemes中的"twitterkit-yourAppKey“是项0,当前版本(3.0.3)中存在一些奇怪的错误,如果它不是第一项就会崩溃。
发布于 2017-09-29 18:27:43
就像上面写的答案,我这样做,结果它崩溃了:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fbmykey</string>
<string>twitterkit-mykey</string>
</array>
</dict>
</array>
然后改变到这个,它起了作用:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>twitterkit-mykey</string>
<string>fbmykey</string>
</array>
</dict>
</array>
https://stackoverflow.com/questions/44427713
复制相似问题