Twitterkit v3 causes exception upon sign in on iOS

ios

#1

I used to initialize Twitter through Fabric before v3. Despite making the change to start() with consumer key and secret and making the info.plist changes I keep getting this exception.

Terminating app due to uncaught exception 'TWTRInvalidInitializationException', reason: 'Attempt made to Log in or Like a Tweet without a valid Twitter Kit URL Scheme set up in the app settings. Please see https://dev.twitter.com/twitterkit/ios/installation for more info.'


Problem setting up URL scheme in iOS plist file
Incorrect CFBundleURLSchemes validation issue
#2

I got it too, and you just have to do what it says, you have to add a URL scheme to the info.plist. It is explained in the link.


#3

The trick was to add the scheme by itself with a new role. Not an issue if it’s your first scheme but easy to mess up if you have multiple.


#4

Honestly the TwitterKit 3.0 is a clear step down in UX. If you can, try to use a version below 3.0 to allow use of Twitter accounts registered in iOS settings. For me I really will consider NOT updating to 3.0… as far as I understand the Twitter login/auth was working without use of URL schemes. At least it works for our app.


TwitterKit 3.0.4 Opening link in Safari browser, as the host is not whitelisted
#5

It works for me, Thank you.


#6

Thanks. Worked for me :slight_smile:


#7

This appears to be a bug. It looks like TwitterKit is trying to validate the Info.plist, but the validation logic is incorrect.

This crashes:

	<array>
		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>fb12345678…</string>
                <string>twitterkit-1232334232332423</string>
				<string>mycustomurlscheme</string>
				<string>anothercustomurlscheme</string>
			</array>
		</dict>
	</array>

But this works:

	<array>
		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
                <string>twitterkit-1232334232332423</string>
				<string>fb12345678…</string>
				<string>mycustomurlscheme</string>
				<string>anothercustomurlscheme</string>
			</array>
		</dict>
	</array>

Unless twitterkit-12345678… appears as the first URL scheme, it crashes. Since URL schemes are commonly used, it’s not really OK to require that Twitter be first.


#8

Whilst that sounds great in principle, you won’t really have any choice in the fall as Twitter accounts in iOS are going away in iOS 11 so you’ll have to use TwitterKit v3 or above


#9

Twitter accounts are going away from settings? In that case I see why this had to change. Thanks for the heads up.


#10

thanks for the tips


#11