Twitter Kit не может быть перенаправлен в приложение Swift - PullRequest
2 голосов
/ 06 февраля 2020

TwitterKit не может быть перенаправлен в моем приложении. In TwitterKit cannot be Redirect in my app and also i am added all important code

1. Info.Plist Добавлены строки

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>twitterkit-{your consumer key}</string>
        </array>
    </dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>twitter</string>
    <string>twitterauth</string>
</array>

2. Делегат приложения

import TwitterKit
application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    Twitter.sharedInstance().start(withConsumerKey:consumer_key, consumerSecret:consumer_secret)
}

application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    if Twitter.sharedInstance().application(app, open: url, options: options) {
        return true
    }
    return false
}

3. LoginScreen

func twitter(){
    TWTRTwitter.sharedInstance().logIn(with: self, completion: { (session, error) in
          --
    }) 
}

Может кто-нибудь показать мне, где я иду не так?

1 Ответ

0 голосов
/ 17 февраля 2020

это проблема callBack, поэтому, пожалуйста, прокомментируйте AppDelegate в приложении

fun c (_ приложение: UIApplication, configurationForConnecting connectionSceneSession: UISceneSession, опции: UIScene.ConnectionOptions) -> UISceneConfiguration {} fun c application (_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {} и добавить функцию didFinishlaunchWithOption в

self.window = UIWindow (frame: UIScreen.main.bounds) let v c = UIStoryboard (name: "Main", bundle: nil) .instantiateViewController (withIdentifier: "GoThrough") как! UINavigationController self.window? .RootViewController = vc self.window? .MakeKeyAndVisible ()

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...