Updates.channel is coming as null after setting up expo-updates - react-native

In my project I am using expo-sdk:43 along with expo-updates.
I have setup the channel property in eas.json file.
{
"cli": {
"version": ">= 0.52.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"channel":"dev"
},
"preview": {
"android": {
"buildType": "apk"
},
"channel":"preview"
},
"production": {}
},
"submit": {
"production": {}
}
}
I have tried to publish my updates through EAS update, but it is not working and the app is not receiving any update. I have tried to do an apk build for the application, and tried to get the output of Updates.Channel and it is outputting as undefined.
eas build -p android --profile --preview
eas update --branch preview --message "update"
But, when I build the app, the build is successful, in the eas logs I can see that it shows that channel property has also been configured.
Can someone please help what might be the possible issue in this case?
I have also tried to do the same steps with an expo-init command (But with expo sdk:47) and minimal app setup and it is working as expected.

Related

EAS updates not working possibly due to missing channel-name in Expo.plist

I'm trying to make EAS updates to work, after debugging, the issue seems to be the missing channel-name, which does not appear in Expo.plist, although,I believe, my eas.json is set up correctly.
I am not using anywhere in the app releaseChannel, replaced it with channel and I did rebuilt the app. Did anyone encounter this issue or knows a solution ? This is how I set the profile in eas.json:
“build”:{
"staging-1863": {
"channel": "staging-1863",
"env": {
"ENVIRONMENT": "staging"
},
"android": {
"buildType": "apk",
"credentialsSource": "local"
},
"ios": {
"credentialsSource": "local"
}
},
}

Can't get environment variable after eas build

After eas build can't access to name of channel of build`
"staging": {
"node": "14.21.1",
"channel": "staging",
"distribution": "internal",
"env": {
"APP_ENV": "staging"
}
}
that settings from my eas.json to env which I'm trying to build.
const config = getConfig(process.env.APP_ENV)
`
And I'm trying to get env depend on build, but it doesn't work(process.env.APP_ENV=undefined instead of "staging")
I already tried to get access by Contants

Expo - How to run eas submit for internal testing in google play

Im using expo with eas build and eas submit for releasing an android app, when I do eas submit it automatically uploads the build and releases to the store.
Is it possible to run eas submit to upload to the internal testing track in the google play console?
My goal is to automate the process where I only upload the build for internal testing and once is tested release to the store by promoting the internal build.
I was able to do this by setting the track to internal in the eas.json file specifically in the submit section reference https://docs.expo.dev/submit/eas-json/:
{
"build": {
"development": {
....
},
"production": {
"channel": "production",
"distribution": "store",
}
},
"submit": {
"production": {
"android": {
"track": "internal" // (enum: production, beta, alpha, internal)
},
"ios": {
}
}
}
}

Parametrize android package and ios bundle id with EAS on Bare workflow

I'm currently working on a expo project and I had the bundle configuration parametrized with environment variables declared on eas.json and used on app.config.ts.
Some like this
eas.json
{
"cli": {
"version": ">= 0.48.2"
},
"build": {
"develop": {
"distribution": "store",
"env": {
"ENVIRONMENT": "develop"
},
"releaseChannel": "dev-v1"
},
"production": {
"releaseChannel": "prod-v1",
"env": {
"ENVIRONMENT": "production"
},
"distribution": "store"
}
}
app.config.ts
//removed a lot of not relevant code
ios: {
supportsTablet: true,
bundleIdentifier: getBundleId(), // returns correct bundle id based on ENVIRONMENT variable.
buildNumber: '1.0.4',
},
android: {
adaptiveIcon: {
foregroundImage: './assets/adaptive-icon.png',
backgroundColor: '#FFFFFF',
},
package: getBundleId(), // same of ios BundleIdentifier
versionCode: 104,
},
But now, for some requirements I have to eject the project into the bare workflow, and because of that I'm getting the follow message when I want to generate a new build with eas (with eas build -p=ios --profile=production)
Specifying "ios.bundleIdentifier" in app.config.ts is deprecated for bare workflow projects.
EAS Build depends only on the value in the native code. Please remove the deprecated configuration.
Does exist any way to keep bundleIdentifier, packageId and also the app schema parametrized by environment after eject?

"expo publish" not working for app built with EAS + expo-dev-client

I'm using the new expo-dev-client and EAS workflow to attempt development with expo, while also including native dependencies (react-native-firebase in my case).
I've managed to build and install a preview of my app with EAS:
eas build --platform ios --profile staging
Where my "staging" profile is setup in eas.json like so:
{
"cli": {
"version": ">= 0.35.0"
},
"build": {
"production": {
"releaseChannel": "prod-v0",
"node": "14.17.4",
"ios": {
"cocoapods": "1.11.2",
"autoIncrement": "buildNumber"
}
},
"staging": {
"extends": "production",
"releaseChannel": "staging",
"distribution": "internal"
},
...
},
...
}
Note the releaseChannel is set to "staging" too.
So far so good. The app is building and I can install it on my device and confirm the releaseChannel using the expo-updates module with Updates.releaseChannel
Now I'd like to publish a pure javascript change, so I run...
expo publish --release-channel staging
But this gives the following warning (which I assume is why I don't see the update on my device):
ios: Expo.plist key: "EXUpdatesReleaseChannel": The value passed to the
--release-channel flag is to "staging", but it is set to "default".
So what/where is "Expo.plist", why isn't it in-sync, and how can I update it?
Update:
So I deleted the iOS folder from a previous expo run:ios build. The warning is now gone when running expo publish --release-channel staging. But still nothing seems to happen on my app - it still doesn't update.