This is an example project which implements morrowdigital/expo-ota-manager package.
expo-ota-manager
is a helper plugin to manage Over-The-Air updates when your app is running.
yarn install
You may want to change the package name in package.json
{
"name": "expo-ota-manager-example"
}
In the root
of your project create a .env
file, from the .env.example
file. Add in there your custom slug, and package names.
# your expo account username (needed by expo-updates)
USERNAME=xxxx
# you will receive this after your run eas init
EXPO_PROJECT_ID=xxxxx
# your project slug
EXPO_SLUG=xxxxx
# native (android and ios) package names
EXPO_BUNDLE_IDENTIFIER=com.yourdomain.xxxx
Note: Do not add the
EXPO_PROJECT_ID
yet
Run
eas init
and ask for creating a new project. The command will prompt you to enter a newly created projectId into your app.config.js. Insert it in the .env
file
EXPO_PROJECT_ID=xxxxx
Run
yarn build:preview:android
or
yarn build:preview:ios
Follow instructions to build and download the package and install it on your device
Upon running the app, your screen will show a specific hardcoded version
Edit the version in App.tsx
:
<Text>Version 1.0.7</Text>
Then commit the changes and run
yarn publish:preview
Kill and restart your installed app. After a while, you should see the OTA manager prompting you to restart your app
*** License (MIT)
Copyright 2023 Morrow Digital
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.