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

Add no-side-effects version of navigateToAppLink:error: and navigate: #245

Merged
merged 1 commit into from
Apr 8, 2016
Merged

Conversation

biasedbit
Copy link
Contributor

Rehash of #26

Summary

  • Allows app to know the type of navigation that would result of calling BFAppLinkNavigation's +navigateToAppLink:error: or -navigate: without having any side effects (i.e. no navigation)
  • Also adds a test to ensure same output as +navigateToAppLink:error: without the side effects.

Motivation

Relying on -navigate: completely hands off app behavior to Bolts. These no-side-effects functions allow apps to know what behavior Bolts is going to adopt with a given BFAppLink.

A developer might want to:

  • completely hand off behavior if it's an AppLink with eligible targets or;
  • use one of their own web views if it's just a regular link or a link that cannot be handled by any installed apps.

@nlutsenko
Copy link
Member

@biasedbit, looks like this is failing tests right now.
It needs a single addition to the Info.plist of a test target, since we are building and testing on iOS 9 SDK:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>bolts</string>
</array>

@biasedbit
Copy link
Contributor Author

I forked the project from most recent master, shouldn't that be in the project already? I guess my question is if the tests were working before and I haven't touched anything other than code files, why would I have to change my fork's project file to include that?

(I'll try adding that and let you know how it went but I really am curious as to why it's necessary for this PR.)

@biasedbit
Copy link
Contributor Author

I can't seem to get the tests to run locally, or the project to even build for that matter. I've ran git submodule update --init --recursive, which pulled in some stuff into Vendor but I'm still getting warnings that files can't be found and build errors:

screen shot 2016-04-07 at 15 31 19

Is there anything else I need to do to get the project to run/test locally? Couldn't find any info on the README.

@nlutsenko
Copy link
Member

The change is required because we are running with iOS 9 SDK and you are required to specify which schemes you are querying for there - in this case it is bolts.

In regards to the test failure - after checking out all the submodules - make sure you clean the Derived Data and relaunch Xcode. It doesn't play nicely if you were missing configs and now have them.

- Allows app to know the type of navigation that would result of calling
  BFAppLinkNavigation's navigateToAppLink:error: or navigate: without
  having any side effects
- Also adds a test to ensure same output as navigateToAppLink:error:
  without the side effects.
@biasedbit
Copy link
Contributor Author

Oh, ofc! I'm using canOpenURL:, not openURL:, makes sense.

Thanks for the tip on the derived data and the hand-holding — I was completely out of context 👍

Anyway, tests are successful locally. Rebased, squashed and pushed.

@nlutsenko nlutsenko self-assigned this Apr 8, 2016
@nlutsenko nlutsenko added this to the 1.7.1 milestone Apr 8, 2016
@nlutsenko nlutsenko merged commit a40b65b into BoltsFramework:master Apr 8, 2016
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

Successfully merging this pull request may close these issues.

3 participants