Skip to content

Commit

Permalink
Add script to generate generic applicationError page with app name an…
Browse files Browse the repository at this point in the history
…d url.
  • Loading branch information
aljones15 committed Nov 2, 2023
1 parent a399706 commit aebfd33
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ bash ./scripts/service-worker-android-patch.sh
bash ./scripts/set-native-app-manifests.sh
# generates icons and splash screens
npx capacitor-assets generate
# generate a generic application error screen
bash ./scripts/set-application-error.sh
34 changes: 34 additions & 0 deletions scripts/set-application-error.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
printf '<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<style>
body {
margin-top: env(safe-area-inset-top);
margin-bottom: env(safe-area-inset-bottom);
display: flex;
align-items: center;
flex-direction: column;
gap: 25px;
padding: 25px;
}
.row {
display: flex;
flex-direction: row;
align-items: center;
}
.brand-name {
font-weight: bold;
font-size: 50px;
}
</style>
</head>
<body>
<div class="row">
<span class="brand-name">%s</span>
</div>
<h1>An error has occured.</h1>
<h2>You may attempt to reload the site below.</h2>
<a href="https://%s">Reload</a>
</body>
</html>' $NATIVE_APP_NAME $NATIVE_APP_URL > ./www/applicationError.html

0 comments on commit aebfd33

Please sign in to comment.