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

Replace deprecated openURL API call #164247

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hellohuanlin
Copy link
Contributor

@hellohuanlin hellohuanlin commented Feb 26, 2025

This PR replace the deprecated openURL: API with equivalent openURL:options:completionHandler: API.

List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.
#164047

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added platform-ios iOS applications specifically engine flutter/engine repository. See also e: labels. team-ios Owned by iOS platform team labels Feb 26, 2025
[UIApplication.sharedApplication openURL:url];
[UIApplication.sharedApplication openURL:url
options:@{}
completionHandler:nil];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @hannah-hyj i may need your help testing this out on a physical device. Do you remember what you did before to trigger this line?

Copy link
Member

Choose a reason for hiding this comment

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

yes, to trigger this line, you should set up AASA file for deep link in certain domain, and not support that deep link in your flutter app, so the link will be opened again in browser.

Copy link
Member

Choose a reason for hiding this comment

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

i will help testing if this is working

@hannah-hyj
Copy link
Member

hannah-hyj commented Mar 10, 2025

tested on my device, the new API works well and can open browser when needed.

@hellohuanlin hellohuanlin changed the title fix deprecated openURL call Replace deprecated openURL API call Mar 10, 2025
@hellohuanlin hellohuanlin force-pushed the open_url_deprecation branch from 5b33671 to 4bffc71 Compare March 10, 2025 17:56
@hellohuanlin
Copy link
Contributor Author

hellohuanlin commented Mar 10, 2025

Can I ask for a test-exempt for this?

Nvm, i realized that i don't have a valid reason to skip the tests. will add some tests.

@hellohuanlin hellohuanlin marked this pull request as ready for review March 10, 2025 18:03
@hellohuanlin
Copy link
Contributor Author

@hannah-hyj Thanks for testing it. Could you stamp it? Thanks!

@loic-sharma
Copy link
Member

loic-sharma commented Mar 12, 2025

Drive by questions: Could we have caught this sooner? My understanding is this deprecated API should've produced a warning?

Are there other deprecated APIs we're using that are causing warnings?

Do we have warnings as errors disabled on Flutter iOS? If yes, should/could we enable that?

@chinmaygarde
Copy link
Member

This needs a rebase for the presub to pass.

@hellohuanlin
Copy link
Contributor Author

Drive by questions: Could we have caught this sooner? My understanding is this deprecated API should've produced a warning?

Are there other deprecated APIs we're using that are causing warnings?

Do we have warnings as errors disabled on Flutter iOS? If yes, should/could we enable that?

It's not enabled yet. I believe we still have a few usage of deprecated API in the engine. I have seen some PRs of removing some of them over the years.

@hellohuanlin hellohuanlin force-pushed the open_url_deprecation branch from baae1f2 to a2cd20e Compare March 18, 2025 18:41
@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
Copy link
Contributor

auto-submit bot commented Mar 18, 2025

autosubmit label was removed for flutter/flutter/164247, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@hellohuanlin hellohuanlin force-pushed the open_url_deprecation branch from a2cd20e to 1e2e442 Compare March 21, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine flutter/engine repository. See also e: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants