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

back view is missing #36

Closed
james075 opened this issue May 26, 2014 · 0 comments
Closed

back view is missing #36

james075 opened this issue May 26, 2014 · 0 comments

Comments

@james075
Copy link

Hi,

I have a first app which performs a navigation to the second app:

- (IBAction)open:(id)sender
{
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html"];

    [[BFAppLinkNavigation resolveAppLinkInBackground:url] continueWithSuccessBlock:^id(BFTask *task) {
        BFAppLink *link = task.result;

        BFAppLinkNavigation *navigation = [BFAppLinkNavigation navigationWithAppLink:link
                                                                              extras:@{ @"_test_": @"SURPRISE mother fucker!" }
                                                                         appLinkData:@{ @"referer_app_link": @{
                                                                                                @"url": @"applinks://",
                                                                                                @"app_name": @"AppLinks"
                                                                                                }}];
        NSError *error = nil;

        [navigation navigate:&error];

        return task;
    }];
}

The second app shows up but the back view is missing and the app crashes without any output.. did I miss something ?

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    if (self.appLinkReturnToRefererView) {
        self.appLinkReturnToRefererView.hidden = YES;
    }
    AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    if (delegate.parsedUrl) {

        self.appLink = [delegate.parsedUrl appLinkReferer];

        [self _showRefererBackView];
    }

    delegate.parsedUrl = nil;

}

- (void) _showRefererBackView {
    if (nil == self.appLinkReturnToRefererView) {
        // Set up the back link navigation view
        BFAppLinkReturnToRefererView *backLinkView  = [[BFAppLinkReturnToRefererView alloc] initWithFrame:CGRectMake(0, 30, 320, 40)];
        self.appLinkReturnToRefererView = backLinkView;
    }
    self.appLinkReturnToRefererView.hidden = NO;
    // Initialize the back link view controller
    BFAppLinkReturnToRefererController *alc =[[BFAppLinkReturnToRefererController alloc] init];
    alc.view = self.appLinkReturnToRefererView;
    // Display the back link view

    [alc showViewForRefererAppLink:self.appLink];
}

EDIT:

If I use the solution without using Bolts, everything is fine. I followed this tutorial:

https://developers.facebook.com/docs/ios/share/#linking

It there an issue in the BFAppLinkReturnToRefererView class ?

@james075 james075 changed the title Retrieve appLinkReferer nil, back view does not show up back view is missing May 26, 2014
@james075 james075 closed this as completed Jul 8, 2014
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

1 participant