Expo and release channels…how to recognise dev/prod and a real channel

Expo and release channels…how to recognise dev/prod and a real channel



I'm having some troubles with expo release channels.
I'm not expert about React Native and Expo which makes things much more easier :



If I work with my local development environment, the channel will not be set ( which makes sense ).



But also the final release or "production" will not have a channel set,
which makes very unclear how I should recognize 'production' and 'development'.



Then a new complexity level is added if I want to add a channel...like 'staging', which will have instead a channel...



The icing on the cake is that in my deployment system (Circle) I have to build 'development' in a channel ( otherwise NODE_ENV will be "production" )



Did someone figure out how to use channels correctly? :)



basically, I didn't find a solution better than this one:




import Constants from 'expo'
const ENV= production:,staging:,development:

// Having fun with channels
const channel = Constants.manifest.releaseChannel;
if (channel === null || channel === undefined || channel === '')
if (process.env.NODE_ENV === 'production')
return ENV.production;

if (process.env.NODE_ENV === 'development')
return ENV.development;


if (channel === 'staging')
return ENV.staging;

if (channel === 'development')
return ENV.development;

return ENV.production;



Thank you so much!




1 Answer
1



I think you're missing point what are release channels for.



When your app is built with exp build it is bind to one release channel (default as default).
Later, if you want to do an OTA update, you can just run exp publish which will publish your code on the release channel (again: default as default).


exp build


default


exp publish


default



When you ship a standalone build to your users, you don't want to give them untested code etc via OTA, so you want users to have release channel set to ex. prod.


prod



This is completely separated from NODE_ENV and I don't really see a point in tying them.





Clearly, I'm missing the point :) Sorry and thank you for your help. I've never published a real build so I don't really know what will happen :) So basically you are saying that when I will publish a real production build it will have channel === default? ( and I guess development === development and staging === staging if I will publish them in right channels) I guess the issues is that I would like to have a development build but with production parameters.
– Dario
Sep 4 at 21:02






You can publish your app with whatever release channel you want ;) You just probably want to not use it for anything else.
– jakubste
Nov 15 at 11:31



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Some of your past answers have not been well-received, and you're in danger of being blocked from answering.



Please pay close attention to the following guidance:



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)