This is Cordova+Ionic project that demonstrates detailed usage of AppsFlyer plugin with some unitesting (Jasmine)
Cordova 6.3.1
Android platform 5.2.2
- Android Studio
2.2
-- Gradle ver. -3.1
--Android Plugin ver.2.2.0
iOS platform 4.1.1
- Xcode
8
- Xcode
- install globally ionic and cordova:
npm install -g cordova ionic
(may require sudo) - install dependances (for ionic):
npm install
cd to af-cordova-ionic-demo
- add android to platforms list:
ionic platform add android
- add ios to platforms list (might drop error that ios is already installed):
ionic platform add ios
- build Android and iOS:
ionic build ios
ionic build android
or both:ionic build
- check plugin status:
cordova plugin list
Android
Now you can open project in Visual Studio (target it to af-cordova-ionic-demo/platforms/android
)
iOS
Open project af-cordova-ionic-demo/platforms/ios/af-cordova-ionic-demo.xcodeproj
in Xcode
- 1st tab should display Wifi scan list (as dummy plugin)
- 2nd tab activates Appsflyer SDK with API methods (for now we have
initSDK
)
Genearally Appsflyer initiation should be started on application start but for demo and easy debug we put it in second tab (1st tab is active by default)
We also added several test cases for testing our API (so far only initSDK
)
Actually if you still didn't test your cordova application its a good time to start.
We use simple plugin cordova-plugin-test-framework that most cordova plugins use.
To run tests.js
under tests
folder you just need to change:
For iOS:
Go to config.xml
file under Staging
folder, see an image:
replace <content src="index.html" />
with <content src="cdvtests/index.html" />
No worries, once you run from CLI cordova build ios
your config.xml
will be rebuild.
For Android:
Go to res/xml/config.xml
, see image:
replace <content src="index.html"/>
with <content src="cdvtests/index.html" />
After running, and pressing on Run
button in Jasmine UI you should get something like:
In the future we will expand API usage and unitesting.