2017-08-29 9 views
1

ログインの成功がapp.itにリダイレクトされないと、常に下になり、読み込みが続行されます。Twitter kit - 承認後のリダイレクトがiOS 11ベータ版で動作していない

"Redirecting you back to the application.This may take a few moments." 

[TwitterKit]やったメッセージとの遭遇エラー「システムアカウントを使用して認証することができません。」:エラードメイン= 0「ユーザーは、システムアカウントへのアクセスを拒否された」= TWTRLogInErrorDomainコードUserInfo = {NSLocalizedDescription =ユーザーがシステムアカウントへのアクセスを拒否。、NSLocalizedRecoverySuggestionは=このユーザーにシステムのTwitterアカウントへのアクセスを与えます。}

ViewController.m

 [[Twitter sharedInstance] startWithConsumerKey:@"1diEEBruGq9X5HKr0FyK3vFGF" consumerSecret:@"YIOD1rPx1tEuYJRLRYpl8ApT8YdWQpilnApJ8R67VaD3KePAU3"]; 
    [[Twitter sharedInstance] logInWithCompletion:^(TWTRSession *session, NSError *error) { 
     if (session) { 

      TWTRComposer *composer = [[TWTRComposer alloc] init]; 

      [composer setText:@"just setting up my Twitter Kit"]; 
      [composer setImage:[UIImage imageNamed:@"twitterkit"]]; 

      // Called from a UIViewController 
      [composer showFromViewController:delegate.window.rootViewController completion:^(TWTRComposerResult result) { 
       if (result == TWTRComposerResultCancelled) { 
        NSLog(@"Tweet composition cancelled"); 
       } 
       else { 
        NSLog(@"Sending Tweet!"); 
       } 
      }]; 

     } else { 
      NSLog(@"error: %@", [error localizedDescription]); 
     } 
    }]; 

AppDelegate.m

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url 
     options:(NSDictionary *) options 
{ 

[[Twitter sharedInstance] application:application openURL:url options:options]; 
return YES; 
} 

enter image description here

答えて

0

iOS 11から、AppleはiOSからソーシャルアカウントを削除しました。

iOS用のTwitter Kit 3を使用する必要があります。

Info.plis

import TwitterKit 

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
// Intialize Twitter Kit 
     Twitter.sharedInstance().start(withConsumerKey:consumer_key, consumerSecret:consumer_secret) 
} 

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

return false 
} 

のViewController

import TwitterKit 

override func viewDidLoad() { 
     super.viewDidLoad() 

     Twitter.sharedInstance().logIn(with: self, completion: { (session, error) in 

      if let sess = session { 
       print("signed in as \(sess.userName)"); 
      } else { 
       print("error: \(String(describing: error?.localizedDescription))"); 
      } 
     }) 

    } 

AppDelegate

Twitterのブログ https://dev.twitter.com/twitterkit/ios/migrate-social-framework

UPDATE

を参照してください。

<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> 
+0

はい、そのリンクのみがリダイレクトされないように参照しました – Ravindhiran

+0

TwitterのログインメソッドをViewControllerで使用しようとしましたが、ログインは成功し、正常にリダイレクトされました。 iPhone 7 Plus/iOS 11 Simulatorでテスト済み。 - (void)logInWithViewController:(nullable UIViewController *)viewController補完:(TWTRLogInCompletion)補完; – Basheer

+0

私にコードを教えてもらえますか? – Ravindhiran

関連する問題