unimonkiez/react-native-asset

use with iOS Schemas en android Flavors

Opened this issue · 3 comments

Does this module support the use of iOS Schemas en android Flavors?

Yes, let's say you are trying to add flavors (dev and beta) to your android build.

the correct way is add it to scripts in package.json, and all the linking stuff just before it with pre prefix, that way it will run before (npm does that for you).

{
  ...
  "scripts": {
    "prestart:android:dev": "react-native-asset -android-a -a ./assets/dev",
    "start:android:dev": "react-native run-android --variant=devDebug --appIdSuffix=dev",
    "prestart:android:beta": "react-native-asset -android-a -a ./assets/beta",
    "start:android:beta": "react-native run-android --variant=devDebug --appIdSuffix=beta"
  },
  ...
}

Now when the developer wants to run the beta variant for example he will simply type in terminal npm run start:android:dev

This might work for android, but this doesn't really add the resources in the specific flavor. This still adds it to the "main" flavor.
The what about the manifest that is stored in the root? It doesn't make any sense anymore, there.

So how would you do this for iOS then? How will you link the resource to a specific target? Now it will get linked to the main target.

I have created a PR that adds proper support for schemes and flavors: #21