Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FHSTwitterEngineController is hanging when the user doesnt have twitter installed on the device #113

Closed
cliftonmyers opened this issue Dec 17, 2015 · 8 comments

Comments

@cliftonmyers
Copy link

The issue is in the below method in the FHSTwitterEngine.m line 1726

  • (void)showOAuthLoginControllerFromViewController:(UIViewController *)sender withCompletion:(void(^)(BOOL success, UIViewController *twitterEngineViewController))block {
    FHSTwitterEngineController *vc = [[FHSTwitterEngineController alloc]init];
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:vc];
    vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    objc_setAssociatedObject(vc, "FHSTwitterEngineOAuthCompletion", block, OBJC_ASSOCIATION_COPY_NONATOMIC);
    [sender presentViewController:navController animated:NO completion:nil];
    }
@dkhamsing
Copy link
Collaborator

Do you have sample code?

@cliftonmyers
Copy link
Author

// use FHSTwitterEngine if user didn't setup twitter account on device
NSString *twitterConsumerKey = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"TwitterConsumerKey"];
NSString *twitterSecretKey = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"TwitterSecretKey"];
[[FHSTwitterEngine sharedEngine] permanentlySetConsumerKey:twitterConsumerKey andSecret:twitterSecretKey];

dispatch_async(dispatch_get_main_queue(), ^{
    [[FHSTwitterEngine sharedEngine] showOAuthLoginControllerFromViewController:self withCompletion:^(BOOL success, UIViewController *twitterEngineViewController) {
        if (success) {
            TwitterFollowController *twitterController = [[TwitterFollowController alloc] initWithNibName:@"TwitterFollowController" bundle:nil];
            UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:twitterController];
            navController.navigationBar.barStyle = UIBarStyleBlack;
            [twitterEngineViewController presentViewController:navController animated:NO completion:nil];
        }
    }];
});

@dkhamsing
Copy link
Collaborator

can you log the error and report back
what version of FHSTwitterEngine are you using

@cliftonmyers
Copy link
Author

there is no error to be logged, the last line of code that is being called is the below:
[sender presentViewController:navController animated:NO completion:nil];
which is not opening any page.

I am using the latest FHSTwitterEngine.h/.m which is old already
// Created by Nathaniel Symer on 8/22/12.

@dkhamsing
Copy link
Collaborator

Well.. the date there is the date when the code was created.. not updated

Few things

if (success) {
  NSLog("yay");
}
else {
  NSLog("noooo");
}

Better yet you could add logging to showOAuthLoginControllerFromViewController

Please report back

@cliftonmyers
Copy link
Author

i got the code from the link you added, but didnt find the method showOAuthLoginControllerFromViewController anymore

is it replaced with another one?

@dkhamsing
Copy link
Collaborator

Please refer to the documentation http://cocoadocs.org/docsets/FHSTwitterEngine, looks like you are looking for loginControllerWithCompletionHandler

@cliftonmyers
Copy link
Author

Thanks a lot for the help, issue resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants