Why did TwitterKit make anEncounterError (withMessage Invalid parameter does not satisfy the error)
I only get this error on first login. When I click the Twitter button, I am redirected to the browser to login. I can login and redirect back to the app and also register a username. but an error will occur in the next few seconds. But not logged to Crashlytics, neither on app crash, nor additional log in Xcode log window.
I have combined Twitter with cloth. Xcode: 6.1.1 iOS: 8.1, 7.1
My code in AppDelegate
#import <Fabric/Fabric.h>
#import <TwitterKit/TwitterKit.h>
#import <Crashlytics/Crashlytics.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[Twitter sharedInstance] startWithConsumerKey:@"nm5TpIjmg254b3IeXunehW3Jm" consumerSecret:@"zRsulsIrOPZXU0VilTPsQjUsdtknojB73v5LGqKH6QZfTm60BR"];
[Fabric with:@[TwitterKit, CrashlyticsKit]];
return YES;
}
And on the viewcontroller
#import <TwitterKit/TwitterKit.h>
/ Login to Twitter
-(void) twitterLogin {
[[Twitter sharedInstance] logInWithCompletion: ^(TWTRSession *session, NSError *error) {
if (session) {
NSLog(@"signed in as %@", [session userName]);
// get user details from Twitter
// [self getTwitterAccountInformation];
}
else {
NSLog(@"error: %@", [error localizedDescription]);
}
}];
}
exact error: - [TwitterKit] didEncounterError:withMessage: Invalid parameter not satisfying: error
source to share
I see that you are adding multiple sets to Fabric, but the implementation is wrong, which might cause an error, like
[Fabric with:@[TwitterKit, CrashlyticsKit]];
Decision
So adding CrashlyticsKit
you are missing this line, you have to initialize the service CrashlyticsKit
, just add it before adding the sets to Fabric:
[Crashlytics startWithAPIKey:<your key>];
DEBUGGING
To test the debug target once by removing the bundle from Fabric as follows:
[Fabric with:@[TwitterKit]];
and see if you get the error or not.
source to share