diff --git a/CHANGELOG.md b/CHANGELOG.md index e00db032b..ee1a7b835 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 22.02.2 + * Added ability to record direct requests. + ## 22.02.1 * Fixed bug that would be opening two intents for MainActivity when clicking on a push notification with a deep-link. diff --git a/app/src/main/java/ly/count/android/demo/ActivityExampleOthers.java b/app/src/main/java/ly/count/android/demo/ActivityExampleOthers.java index 058a04f27..7645d945a 100644 --- a/app/src/main/java/ly/count/android/demo/ActivityExampleOthers.java +++ b/app/src/main/java/ly/count/android/demo/ActivityExampleOthers.java @@ -51,6 +51,15 @@ public void onClickViewOther10(View v) { Countly.sharedInstance().requestQueue().attemptToSendStoredRequests(); } + public void onAddDirectRequestClick(View v) { + Map requestMap = new HashMap<>(); + requestMap.put("city", "Istanbul"); + requestMap.put("country_code", "TR"); + requestMap.put("ip_address", "41.0082,28.9784"); + requestMap.put("events", "[{\"key\":\"test\",\"count\":201,\"sum\":2010,\"dur\":2010,\"segmentation\":{\"trickplay\":[{\"type\":\"FF\",\"start_time\":123456789,\"end_time\":123456789},{\"type\":\"skip\",\"start_time\":123456789,\"end_time\":123456789},{\"type\":\"resume_play\",\"start_time\":123456789,\"end_time\":123456789}]}}]"); + Countly.sharedInstance().requestQueue().addDirectRequest(requestMap); + } + public void onClickTestcrashFilterSample(View v) { Countly.sharedInstance().crashes().recordUnhandledException(new Throwable("A really secret exception")); } diff --git a/app/src/main/res/layout/activity_example_others.xml b/app/src/main/res/layout/activity_example_others.xml index 992721f35..e5961efb5 100644 --- a/app/src/main/res/layout/activity_example_others.xml +++ b/app/src/main/res/layout/activity_example_others.xml @@ -38,6 +38,13 @@ android:onClick="onClickViewOther10" android:text="Do Stored Requests" /> +