This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scripts added to create fully functional (ready to run) Cordova and I…
…onic Example app (#81)
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# This is a shell script to create example app for Cordova. | ||
|
||
rm -rf app_cordova | ||
cordova create app_cordova com.countly.demo app_cordova | ||
cd app_cordova/www | ||
|
||
rm index.html | ||
curl https://raw.githubusercontent.com/Countly/countly-sdk-cordova-example/master/app_cordova/www/index.html --output index.html | ||
|
||
cordova plugin add https://github.com/Countly/countly-sdk-cordova.git | ||
|
||
read -p 'Enter your server URL: ' serverURL | ||
read -p 'Enter your App Key: ' appKey | ||
|
||
sed -i'.bak' -e "s/YOUR_API_KEY/$appKey/g" index.html | ||
sed -i'.bak' -e "s+\"https://try.count.ly\"+"\"${serverURL}\""+g" index.html | ||
|
||
rm index.html.bak | ||
|
||
cd .. | ||
npm install | ||
cordova platform add android | ||
cordova platform add ios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
|
||
# This is a shell script to create example app for Ionic. | ||
|
||
rm -rf app_ionic | ||
ionic start app_ionic blank | ||
cd app_ionic/src/app/home/ | ||
|
||
rm home.page.ts | ||
curl https://raw.githubusercontent.com/Countly/countly-sdk-cordova-example/master/app_ionic/src/app/home/home.page.ts --output home.page.ts | ||
|
||
ionic cordova plugin add https://github.com/Countly/countly-sdk-cordova.git | ||
|
||
read -p 'Enter your server URL: ' serverURL | ||
read -p 'Enter your App Key: ' appKey | ||
|
||
sed -i'.bak' -e "s/YOUR_API_KEY/$appKey/g" home.page.ts | ||
sed -i'.bak' -e "s+\"https://try.count.ly\"+"\"${serverURL}\""+g" home.page.ts | ||
|
||
rm home.page.ts.bak | ||
|
||
cd .. | ||
cd .. | ||
cd .. | ||
|
||
npm install | ||
npm run build | ||
|
||
ionic cordova platform add android | ||
ionic cordova platform add ios | ||
|
||
ionic cordova prepare android | ||
ionic cordova prepare ios |