Ios 在macOS上与Swifter一起使用CallBackURL
我正在尝试学习如何在macOS/iOS应用程序中使用Swifter,但是网站上的文档假定我有很多不具备的知识 如果我正在构建一个新的应用程序,并且我从Twitter上获得了我的Twitter API密钥,那么我如何设置Ios 在macOS上与Swifter一起使用CallBackURL,ios,swift,swifter,Ios,Swift,Swifter,我正在尝试学习如何在macOS/iOS应用程序中使用Swifter,但是网站上的文档假定我有很多不具备的知识 如果我正在构建一个新的应用程序,并且我从Twitter上获得了我的Twitter API密钥,那么我如何设置callbackURL,以便用户可以从我的应用程序发送推文?我目前的代码非常简单: if (meetingSetup.twitterEnabled == true) { let twitterMessage = "Appropriate text" deleg
callbackURL
,以便用户可以从我的应用程序发送推文?我目前的代码非常简单:
if (meetingSetup.twitterEnabled == true) {
let twitterMessage = "Appropriate text"
delegate.swifter?.postTweet(status: twitterMessage, success: { status in
print("Twitter message: \(twitterMessage)")
},failure: { error in
print("Twitter message: failed")
})
}
然后,我在AppDelegate中设置Twitter,如下所示:
@nonobjc func application(_ application: NSApplication, didFinishLaunchingWithOptions launchOptions: [AnyHashable: Any]?)-> Bool{
swifter = Swifter(consumerKey: twitterConsumerKey, consumerSecret: twitterConsumerSecret, appOnly: true)
return true
}
然而,代码实际上从未发布过tweet。在网上阅读时,我看到我需要定义一个callbackURL
,但我没有看到关于如何在代码中定义它的任何细节,这样我就可以在我的twitterapi配置中设置它
使用Swifter和CallbackURL的合适方式是什么?感谢您的编辑,我在代码粘贴中错过了它…我假设这段Swift 3代码适用于基本的Twitter API,但仍在尝试为Swifter找出它。感谢您的编辑,我在我的代码粘贴中错过了它…我假设这段Swift 3代码适用于基本的Twitter API,但仍在尝试为Swifter找出它。。