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

Have optionnal parameter #58

Closed
ghost opened this issue Jun 8, 2015 · 2 comments
Closed

Have optionnal parameter #58

ghost opened this issue Jun 8, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 8, 2015

Hi,

I would like to track a campaign code in the deep link to see where some of the users come from.
So I can have something like @"/account" but also @"/account/:campaign_code".
It would be nice to do that !

@wessmith
Copy link
Member

We don't currently support regex matching on the URL as a whole, only individual path components. Sounds like a good idea though. For now, you could register two handlers with the more specific route first.

router[@"/account/:campaign_code"] = ^(DPLDeepLink *link) {
    // run some code
};

router[@"/account"] = ^(DPLDeepLink *link) {
    // run some code
};

Or even:

void (^accountHandler)(DPLDeepLink *) = ^(DPLDeepLink *link) {
    // run some code
};
router[@"/account/:campaign_code"] = accountHandler;
router[@"/account"] = accountHandler;

@wessmith
Copy link
Member

Closing as duplicate of #63

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

No branches or pull requests

1 participant