Closed numandev1 closed 1 year ago
@chanphiromsok I just wanna know about the expo user point of view into app.config.json
+ some edge cases, it would be good to have a little call on it, after that i will make it soon
@chanphiromsok I just wanna know about the expo user point of view into
app.config.json
+ some edge cases, it would be good to have a little call on it, after that i will make it soon
in app.config.{js,ts,json}
it can use build base on ENV (dev or prod)
but the different is expo not encrypt when using in NativeModule like google maps key
.
@chanphiromsok should the user declare android product flavors with mapping of key files and ios scheme with mapping of key files like this?
{
"name": "my app",
"plugins": [
[
"react-native-keys",
{
"android": {
"keyFiles": {
"development": "keys.development.json",
"production": "keys.development.json",
"staging": "keys.development.json"
},
"productFlavors": {
"development": {
"applicationIdSuffix": ".dev1"
},
"staging": {
"applicationIdSuffix": ".staging"
},
"production": {
"applicationIdSuffix": ""
}
}
},
"ios": {
"keyFiles": {
"development": "keys.development.json",
"production": "keys.development.json",
"staging": "keys.development.json"
},
"schemes":{
"dev": "development", //value is the keyFile name
"staging": "staging",
"prod": "production"
}
}
}
]
]
}
I like to use one for one rather than map key/value
keyFiles : process.env.NODE_ENV==="prod" ? keys.prod.json : keys.dev.json
I think it clean and no need to put unnecessary json file if user running release but you put 3 json (dev,stag,prod) file to their build @chanphiromsok What if users have multiple environments, I also wanna use a clean solution from app.config.json
, we should allow user to allow user to have multiple environments if he wants, can you suggest me any clean solution from app.config.json
@chanphiromsok What if users have multiple environments, I also wanna use a clean solution from
app.config.json
, we should allow user to allow user to have multiple environments if he wants, can you suggest me any clean solution fromapp.config.json
if user want multiple environments your https://github.com/numandev1/react-native-keys/issues/47#issuecomment-1719201015 solution is good to go and I can't say my ideas is right I want you to know more about expo users perspective on your library
@chanphiromsok thanks for helping me out❤
did you ever manage ios scheme
or productFlavors
into the expo?
how do you manage two environments in the expo?
I wanna make the simpler solution above mine solution is also looking complex to me
@chanphiromsok thanks for helping me out❤ did you ever manage
ios scheme
orproductFlavors
into the expo? how do you manage two environments in the expo?I wanna make the simpler solution above mine solution is also looking complex to me
I edit in the Xcode but it not better approach 😅
@chanphiromsok hahaha if you edit into Xcode then build on the expo server using eas will not work, i don't know how expo user manage multiple environments into expo
@chanphiromsok hahaha if you edit into Xcode then build on the expo server using eas will not work, i don't know how expo user manage multiple environments into expo
I use prebuilt our team is experiment expo now it use on prod 😅
https://docs.expo.dev/build-reference/variants/ https://docs.expo.dev/build-reference/variables/ https://docs.expo.dev/guides/environment-variables/ they are managing different build environment like this, i have to make a solution where expo user can easily migrate to this pacage
this is I my plugins I write inject for code push for expo prebuild
export env = prod
for production otherwise run export env =dev
this is just example in my project using bash script for export envconst codepushIos = env=== "prod" ? "keypord" : "keydev"
this my current code (dev & prod)
['./plugins/react-native-codepush',
{
iosDeploymentKey: codepushIos,
androidDeploymentKey: codepushAndroid,
},
]
@chanphiromsok thanks for your input, I have added expo support, you can find docs here: https://github.com/numandev1/react-native-keys#managed-expo
app.config.json
{
"name": "my app",
"plugins": [
[
"react-native-keys",
{
"android": {
"defaultKeyFile": "keys.staging.json" //default: keys.development.json
},
"ios": {
"defaultKeyFile": "keys.staging.json" //default: keys.development.json
}
}
]
]
}
defining defaultKeyFile
is for fallback
after that, you can test other key files like this
KEYSFILE=keys.staging.json npx expo run:android
I have released the feature in 0.7.0
, can you check and let me know?
Error expo plugin when installation
CommandError: Cannot find module './plugin/build'
Require stack:
- /Users/user/Desktop/example-keys/node_modules/react-native-keys/app.plugin.js
maybe you forget transpile from ts to js I did not found build dir in node_modules
@chanphiromsok can you check 0.7.1
, sorry 🙏 i forget files line into package.json
@chanphiromsok did you check?
@chanphiromsok did you check?
Hi sorry for late response ,new fixed still error CommandError: Cannot find module 'walk-sync'
@chanphiromsok sorry, I added walk-sync
into devDependencies
which was wrong, it should add dependencies
. can you check 0.7.3
now? 🙏 🙏
@chanphiromsok sorry, I added
walk-sync
intodevDependencies
which was wrong, it should adddependencies
. can you check0.7.3
now? 🙏 🙏
It work now but I wish you using plain node instead of external lib 😅
Hello could you share me what to want to do ? may I can help you write expo plugins with expo prebuild