iOS console "The application's consumer key or consumer secret has changed since the last launch"

ios
fabric
key
twitterkit
api

#1

Upon initializing TwitterKit (1.15.1) on iOS (integration set up with Fabric Mac helper app) on the TwitterKit setup line
[Fabric with:@[[Twitter class]]];

console reports:
The application's consumer key or consumer secret has changed since the last launch. Any saved user sessions will be purged from the system because they will no longer work with the current key and secret. User's will need to log in again

Keys in info.plist match keys auto-generated by TwitterKit setup via Fambric Mac helper tool and saved in the fabric.io portal.

Anything I should be considered of?


#2

@jki Have you recently changed by your app being used? Also, do you have any lines above the Fabric with line that could be changing the consumer key that you’re using?


#3

I have two app targets (with different keys, each integrated with Fabric/TwitterKit), message appears on running target for the first time (at least message does not appear on second launch of the same target) - seems TwitterKit saves keys in some kind of global space and has to reset it on first launch of different app target.

No - I have no any Fabric related lines before setup line.

Anyway this seems weird to me as apps (targets) are sandboxed and isolated from each other.


#4

Thanks @jki, you could see this the first time you setup an app, but if you continue to see this at other times, please let me know.


#5

I’ve the same issue!

Twitter.sharedInstance().startWithConsumerKey(TWITTER_CONSUMER_KEY, consumerSecret:TWITTER_CONSUMER_SECRET)
Fabric.with([Crashlytics.self, Twitter.self])

TWITTER_CONSUMER_KEY and TWITTER_CONSUMER_SECRET change with the target. Every time i run the app with different target appears: “The application’s consumer key or consumer secret has changed since the last launch. Any saved user sessions will be purged from the system because they will no longer work with the current key and secret. User’s will need to log in again”


#6

@andrea_steva Do you have any of the keys in your info.plist? Also, do each of your targets have a separate bundle id?


#7

Yes separate bundle id for each target, but i have the same keys on the keys on the info.plist, I think this is the problem…

Can i delete the keys from the plist?


#8

Yep, that would be the issue. You can remove the keys from info.plist as long as you use the code that you listed earlier and conditionally switch which key and secret to use. Be sure to update your run script build phase as well.


#9

Issue resolved. Thank you!


#10