-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
Google Play feature (Dynamic Modules) Support for local resources #31626
Comments
Hi, Any help regarding this? |
@amank22 Cann you add an example of using Play Feature Delivery with React Native? I can't find a library / documentation to do that. |
Hi, I currently don't have any sample project. But we did a POC. Hoping you know how dynamic feature works and you have done the code to load a simple dynamic feature. Following recommendations you can follow:
What we were trying to achieve was to split react bundle with different hosts but that was also achieved through some hacks (I don't remember as rn part was done by some other dev). Hope I can help a little bit and do ask any specific question if you have in mind and I'll try to help. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
Topic:
Play Feature Delivery
Issue:
Resources can not be loaded from feature module. [res/* folder, assets/* will work]
Scenario:
Anything in assets/ folder will work properly. Network images are also loaded properly.
Reason:
This is because according to Feature Resources Section in Android docs, you can see that any resources in dynamic feature module will have package with feature module name. Like this,
App package name: com.example.my_app_package
Feature's resources package name: com.example.my_app_package.my_dynamic_feature
Now at most for the places we get resource from string identifier which takes a package. This
context.getPackage()
will return application package. This causes the id to be returned as 0. (For a fact, If I change the package withcontext.getPackage() + ".featureModule"
, it is able to find the resource. (This is the file below while debugging)react-native/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/ResourceDrawableIdHelper.java
Line 63 in dc80b2d
If we can find some way to actually pass the correct package name which we can append here (maybe from some prop in image) or some better solution, it will be great.
There is method
resources.getResourcePackageName(resId)
which takes an ID and gives correct package name but this is of no use here.These are few places I found similar calls: getIdentifier Search on Rn
The text was updated successfully, but these errors were encountered: