Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Closes #7930: Use fallback url over market intent if user preference is not to launch in external app #7971

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

rocketsroger
Copy link
Contributor


Pull Request checklist

  • Quality: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry or does not need one
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features

After merge

  • Milestone: Make sure issues closed by this pull request are added to the milestone of the version currently in development.
  • Breaking Changes: If this is a breaking change, please push a draft PR on Reference Browser to address the breaking issues.

…er preference is not to launch in external app
@rocketsroger rocketsroger added the 🕵️‍♀️ needs review PRs that need to be reviewed label Aug 4, 2020
@hkaancaliskan
Copy link

hkaancaliskan commented Aug 4, 2020

Does this will also fix mozilla-mobile/fenix#12746?
Edit: I'm trying this locally

@hkaancaliskan
Copy link

hkaancaliskan commented Aug 4, 2020

Nope, not fixing but at least opens website instead of opening play store while 'open in app' option turned off.
Edit: Actually fenix tries to open ty.gl link in app but chrome opens latest redirected version of url. This causes to open play store instead of app because app handles trendyol.com links, not ty.gl :/

image

Edit 2: changing place of marketplaceIntent and fallbackUrl fixes problem but breaks others. Idk how to solve properly. That's all i can do :(

if (!redirect.hasExternalApp()) {
            redirect.marketplaceIntent?.let {
                return RequestInterceptor.InterceptionResponse.AppIntent(it, uri)
            }

            redirect.fallbackUrl?.let {
                return RequestInterceptor.InterceptionResponse.Url(it)
            }

            return null
        }

@rocketsroger
Copy link
Contributor Author

Does this will also fix mozilla-mobile/fenix#12746?
Edit: I'm trying this locally

That looks like a opposite issue. This one is trying to fix the issue that if the user preference is not to open in app, we load the fallback URL. I'll have to look at the other one to see what's the cause.

@hkaancaliskan
Copy link

Does this will also fix mozilla-mobile/fenix#12746?
Edit: I'm trying this locally

That looks like a opposite issue. This one is trying to fix the issue that if the user preference is not to open in app, we load the fallback URL. I'll have to look at the other one to see what's the cause.

Actually on that issue https://ty.gl/j08whdcd link opens play store regardless of open in app option. With this pr now opens link in browser while open in app option OFF. But opens play store when open in app option on (should open trendyol app). Means this pr fixes half of the mozilla-mobile/fenix#12746.

@hkaancaliskan
Copy link

Edit 2: changing place of marketplaceIntent and fallbackUrl fixes problem but breaks others. Idk how to solve properly. That's all i can do :(

Is this with Open links in apps off?

Nope, open links in apps on. When off, there is no problem now with this pr.

@rocketsroger
Copy link
Contributor Author

Does this will also fix mozilla-mobile/fenix#12746?
Edit: I'm trying this locally

That looks like a opposite issue. This one is trying to fix the issue that if the user preference is not to open in app, we load the fallback URL. I'll have to look at the other one to see what's the cause.

Actually on that issue https://ty.gl/j08whdcd link opens play store regardless of open in app option. With this pr now opens link in browser while open in app option OFF. But opens play store when open in app option on (should open trendyol app). Means this pr fixes half of the mozilla-mobile/fenix#12746.

I see, thanks for clarifying. Yes, this is what this patch should do. If the user have 'Open links in apps' off then we should load the playstore site in browser. I'll look into the other issue when the user have the preference on.

Copy link
Contributor

@psymoon psymoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prioritizing fallback url makes sense to me.

@rocketsroger
Copy link
Contributor Author

bors r=psymoon

@rocketsroger rocketsroger removed the 🕵️‍♀️ needs review PRs that need to be reviewed label Aug 5, 2020
@bors
Copy link

bors bot commented Aug 5, 2020

Build succeeded:

@bors bors bot merged commit 40a89b5 into mozilla-mobile:master Aug 5, 2020
@rocketsroger rocketsroger deleted the AC_7930 branch August 6, 2020 14:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants