Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Scripts added to create fully functional (ready to run) Cordova and I…
Browse files Browse the repository at this point in the history
…onic Example app (#81)
  • Loading branch information
ijunaid authored Dec 15, 2020
1 parent 74afc38 commit df6cd5a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
25 changes: 25 additions & 0 deletions example/cordova_example.sh
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
33 changes: 33 additions & 0 deletions example/ionic_example.sh
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

0 comments on commit df6cd5a

Please sign in to comment.