0

Someone pointed out that this was a duplicate question, Yes partly, I followed the advice in the other post and added the URLScheme as shown below, Also as suggested i forgot to add to my other target so i did and the URL twitter-13145245245624 Now what happens is my app redirects the user to their Twitter App and asks for permission to have my app use their info, once tapping the ok button user is redirected back to my app but still no Composer populates the View to Tweet. Still confused. Thanks for all the help.

 let composer = TWTRComposer()

    composer.setText("just setting up my Twitter Kit")
    composer.setImage(UIImage(named: "twitterkit"))

    // Called from a UIViewController
    composer.show(from: self) { (result) in
        if (result == .done) {
        print("Successfully composed Tweet")
        } else {
        print("Cancelled composing")
        }
    }

This is my info.plist, however, I have no issue with posting to Facebook. Any thoughts?

 <key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>twitterkit-xxxxxxxxxx</string>
            <string>fbxxxxxx</string>
        </array>
    </dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>twitter</string>
    <string>twitterauth</string>
</array>

Regards J

  • Possible duplicate of [Twitterkit 3.0 'TWTRInvalidInitializationException' error in ios](https://stackoverflow.com/questions/44651236/twitterkit-3-0-twtrinvalidinitializationexception-error-in-ios) – staticVoidMan Mar 22 '18 at 17:41
  • Yes, it looks like a dupe. Okay, I followed what the other post suggested setting up the info.plist the same way but the same result and same exception. Thing is Facebook works. –  Mar 22 '18 at 18:05
  • check [Twitterkit v3 causes exception upon sign in on iOS](https://twittercommunity.com/t/twitterkit-v3-causes-exception-upon-sign-in-on-ios/88143/2) – staticVoidMan Mar 23 '18 at 08:38
  • in which target did you update the `Info.plist`? – staticVoidMan Mar 23 '18 at 08:39
  • Clicked on project upper left, than in PROJECT - TARGETS my project name under info URL Types. Adding the twitterkit-1313134 string stoped the app from crashing –  Mar 23 '18 at 12:54

1 Answers1

0

The issue to my above question was that I did not have the below method in AppDelegate as so. This Solved my problem.

-(BOOL)application:(UIApplication*)app openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{    
return  [[TWTRTwitter sharedInstance]application:app openURL:url options:options]; 

}