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

[iOS] Attachment image is not displayed with 'require()' on release mode #1022

Closed
toy0605 opened this issue Apr 2, 2024 · 1 comment
Closed

Comments

@toy0605
Copy link

toy0605 commented Apr 2, 2024

Summary

The attachment image with require() is not displayed on release mode.
It works dev mode only.
I think React Native's require() doesn't works properly in ios native code.

Version info

react-native@0.73.6
@notifee/react-native@7.8.2

Temporary workaround

It needs to change to absolute path. The absolute path is started assets.

This source file is located src/example.ts for example.
and image file is located src/assets/example.png.

// It works only dev mode.
{
  url: require("./assets/example.png"),
  typeHint: "public.png",
}

// You must change to absolute path conditionally if you want to use dev and release both.
{
  url: __DEV__ === true ? require("./assets/example.png") : "assets/src/assets/example.png",
  typeHint: "public.png",
}

Related issue

#790

Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant