I'm building out a module based on the LinkedIn iOS SDK example project that would allow a user to authenticate through the native LinkedIn application.
The example offered is straightforward and in my test app I am able to include the module, fire up a test, and then trigger the LinkedIn App to open and ask me to authenticate. After that my test app regains focus, but callbacks never fire.
Here is the core function in the module:
- (IBAction)sync:(id)sender { [LISDKSessionManager createSessionWithAuth:[NSArray arrayWithObjects:LISDK_BASIC_PROFILE_PERMISSION, LISDK_EMAILADDRESS_PERMISSION, nil] state:@"some state" showGoToAppStoreDialog:YES successBlock:^(NSString *returnState) { LISDKSession *session = [[LISDKSessionManager sharedInstance] session]; NSMutableString *text = [[NSMutableString alloc] initWithString:[session.accessToken description]]; [text appendString:[NSString stringWithFormat:@",state=\"%@\"",returnState]]; self.lastError = nil; NSLog(@"[INFO] SIGNIN RETURNED SUCCESSFULLY"); [self fireEvent:@"linkedinSuccess" withObject:nil]; } errorBlock:^(NSError *error) { self.lastError = error; NSLog(@"[INFO] SIGNIN ERROR"); [self fireEvent:@"linkedinError" withObject:nil]; } ]; NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:@"foo",@"name",nil]; [self fireEvent:@"linkedinTesting" withObject:event]; NSLog(@"[INFO] FIRING TEST EVENT"); return @"getting to sync"; }In my test app I have event listeners in place for the main function, as well as the success and error callbacks. The linkedinTesting event correctly fires when the function is called and when the app regains focus after LinkedIn Auth. The callbacks never fire in the module nor in my test app.
So my question is, what am I missing? Is this an issue with Titanium modules in general?