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

fix(android): restore asset loading functionality to android (fix: #846) #854

Merged
merged 7 commits into from
Feb 7, 2023

Conversation

lily-mosquitoes
Copy link
Contributor

Implements WebViewAssetLoader to load assets from the asset folder in Android when with_asset_loader is called in the builder. The function also sets the desired protocol for use in with_url, although the url must always be <protocol>://assets/<path>.

Refs: #846

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Checklist

Other information

I am willing to provide an update to the wry template in tauri-mobile showcasing the correct form of asset loading on Android.

Implements WebViewAssetLoader to load assets from the asset folder in Android when `with_asset_loader` is called in the builder. The function also sets the desired protocol for use in `with_url`, although the url must always be `<protocol>://assets/<path>`.

Refs: tauri-apps#846
@lily-mosquitoes lily-mosquitoes requested a review from a team as a code owner January 28, 2023 04:58
@wusyong
Copy link
Member

wusyong commented Feb 3, 2023

Hey I didn't have time to review this week, but it's on my todo list. I'll find some time to review it next week.

wusyong
wusyong previously approved these changes Feb 5, 2023
Copy link
Member

@wusyong wusyong left a comment

Choose a reason for hiding this comment

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

LGTM! I'll fix our limitation of android_fn and then merge it.

@lily-mosquitoes
Copy link
Contributor Author

LGTM! I'll fix our limitation of android_fn and then merge it.

Awesome! Let me know how empty extra args will be handled and I can fix that part!

@amrbashir
Copy link
Member

amrbashir commented Feb 6, 2023

fixed in tauri-apps/tao#688 and will release a new tao version once it is merged

Copy link
Member

@wusyong wusyong left a comment

Choose a reason for hiding this comment

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

Thanks again for the PR!

@wusyong wusyong merged commit 077eb3a into tauri-apps:dev Feb 7, 2023
@github-actions github-actions bot mentioned this pull request Feb 7, 2023
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.

Android assets not loaded as expected with custom protocol
3 participants