diff --git a/example/cordova_example.sh b/example/cordova_example.sh new file mode 100755 index 0000000..a59ea6f --- /dev/null +++ b/example/cordova_example.sh @@ -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 diff --git a/example/ionic_example.sh b/example/ionic_example.sh new file mode 100755 index 0000000..87c3a95 --- /dev/null +++ b/example/ionic_example.sh @@ -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 \ No newline at end of file