Skip to content

Commit

Permalink
Merge pull request #538 from CleverTap/develop
Browse files Browse the repository at this point in the history
Release 6.0.0 SDK-3599
  • Loading branch information
piyush-kukadiya authored Jan 15, 2024
2 parents a9bdc25 + 40d3416 commit 46867b5
Show file tree
Hide file tree
Showing 162 changed files with 14,611 additions and 1,277 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ build/
*.exec
sample/google-services.json
ct_signing_key.gpg
/sample/release/sample-release.aab
/sample/libs/
/sample/release/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## CHANGE LOG.

### January 15, 2024

* [CleverTap Android SDK v6.0.0](docs/CTCORECHANGELOG.md)
* [CleverTap Push Templates SDK v1.2.2](docs/CTPUSHTEMPLATESCHANGELOG.md).

### December 22, 2023

* [CleverTap Android SDK v5.2.2](docs/CTCORECHANGELOG.md)
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ To get started, sign up [here](https://clevertap.com/live-product-demo/)
We publish the SDK to `mavenCentral` as an `AAR` file. Just declare it as dependency in your `build.gradle` file.

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:5.2.2"
}
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:6.0.0"
}
```

Alternatively, you can download and add the AAR file included in this repo in your Module libs directory and tell gradle to install it like this:

```groovy
dependencies {
implementation (name: "clevertap-android-sdk-5.2.2", ext: 'aar')
}
dependencies {
implementation(name: "clevertap-android-sdk-6.0.0", ext: 'aar')
}
```


Expand All @@ -45,9 +45,9 @@ Alternatively, you can download and add the AAR file included in this repo in yo
Add the Firebase Messaging library and Android Support Library v4 as dependencies to your Module `build.gradle` file.

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:5.2.2"
implementation "androidx.core:core:1.9.0"
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:6.0.0"
implementation "androidx.core:core:1.9.0"
implementation "com.google.firebase:firebase-messaging:23.0.6"
implementation "com.google.android.gms:play-services-ads:22.3.0" // Required only if you enable Google ADID collection in the SDK (turned off by default).
}
Expand Down Expand Up @@ -85,11 +85,11 @@ Add your FCM generated `google-services.json` file to your project and add the f
apply plugin: 'com.google.gms.google-services'
```
Interstitial InApp Notification templates support Audio and Video with the help of ExoPlayer. To enable Audio/Video in your Interstitial InApp Notifications, add the following dependencies in your `build.gradle` file :

```groovy
implementation "com.google.android.exoplayer:exoplayer:2.17.1"
implementation "com.google.android.exoplayer:exoplayer-hls:2.17.1"
implementation "com.google.android.exoplayer:exoplayer-ui:2.17.1"
implementation "com.google.android.exoplayer:exoplayer:2.19.1"
implementation "com.google.android.exoplayer:exoplayer-hls:2.19.1"
implementation "com.google.android.exoplayer:exoplayer-ui:2.19.1"
```

Once you've updated your module `build.gradle` file, make sure you have specified `mavenCentral()` and `google()` as a repositories in your project `build.gradle` and then sync your project in File -> Sync Project with Gradle Files.
Expand Down
8 changes: 8 additions & 0 deletions clevertap-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
assets {
srcDirs 'src/main/assets'
}
}
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
Expand All @@ -42,6 +49,7 @@ dependencies {
testImplementation(project(":test_shared"))
testImplementation(libs.firebase.messaging)
testImplementation(libs.test.mockk)
testImplementation(libs.test.coroutines)

androidTestImplementation(libs.test.work.testing)
androidTestImplementation(libs.test.runner)
Expand Down
37 changes: 37 additions & 0 deletions clevertap-core/src/main/assets/image_interstitial.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" charset="utf-8">
<style>
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{font-size:100%;font:inherit;vertical-align:baseline;border:0;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}*{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}html{width:100%;height:100%}#close-button{z-index:10;cursor:pointer;display:none;position:absolute;top:5px;right:5px}#close-button:hover{opacity:.8}#cover{z-index:0;background:rgba(0,0,0,.5);width:100%;height:100%;position:absolute;top:0;left:0}.text{text-align:center}.image{background-position:50%;background-repeat:no-repeat;background-size:contain}body{justify-content:center;align-items:center;width:100%;font-family:sans-serif;font-weight:400;display:flex;position:relative}#view{z-index:1;border:1px solid;flex:auto;position:relative}#view.rounded-border{border-radius:13px}#view.rounded-border #hero-image{border-top-left-radius:13px;border-top-right-radius:13px}#view.rounded-border .button-section{border-bottom-right-radius:13px;border-bottom-left-radius:13px;overflow:hidden}#overlay{z-index:0;background-position:0 0;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:absolute;top:0;left:0;overflow:hidden}#content{z-index:1;background-size:contain;justify-content:center;align-items:center;width:100%;height:100%;display:flex;position:relative}.background-image{object-fit:contain;max-width:100%;max-height:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}#button-1,#button-2,#button-3,#button-4,#button-5,#button-6,#button-7,#button-8,#button-9,#button-10{box-sizing:border-box;cursor:pointer;letter-spacing:.03em;display:none;position:absolute}#button-1:hover,#button-2:hover,#button-3:hover,#button-4:hover,#button-5:hover,#button-6:hover,#button-7:hover,#button-8:hover,#button-9:hover,#button-10:hover{transform-origin:50%;background-color:rgba(0,0,0,.05)}.buttons-layer{z-index:10;width:100%;height:100%;display:block;position:relative}
</style>
</head>
<body>
<div id="overlay">
<div id="close-button" role="button" aria-label="Close">
<svg width="25" height="25" viewBox="0 0 60 60">
<circle id="Oval" fill="#222" cx="30" cy="30" r="30" />
<path d="M41.102 37.532a3.286 3.286 0 0 1 .008 4.533 2.996 2.996 0 0 1-4.357-.009l-7.25-7.531-7.245 7.531c-1.214 1.253-3.148 1.261-4.357.01-1.2-1.253-1.205-3.268.008-4.534l7.246-7.531-7.246-7.532c-1.2-1.252-1.213-3.267-.008-4.528 1.2-1.252 3.14-1.257 4.357 0l7.245 7.531 7.25-7.531c1.205-1.248 3.152-1.257 4.357 0 1.2 1.248 1.209 3.259-.008 4.528l-7.242 7.532 7.242 7.531Z"
id="Close-Icon" fill="#FFF" />
</svg>
</div>
<div id="content" class="image"><img id="backgroundImage" class="background-image" alt>
<div id="buttonsLayer" class="button-section buttons-layer">
<div id="button-1" class="text" role="button"></div>
<div id="button-2" class="text" role="button"></div>
<div id="button-3" class="text" role="button"></div>
<div id="button-4" class="text" role="button"></div>
<div id="button-5" class="text" role="button"></div>
<div id="button-6" class="text" role="button"></div>
<div id="button-7" class="text" role="button"></div>
<div id="button-8" class="text" role="button"></div>
<div id="button-9" class="text" role="button"></div>
<div id="button-10" class="text" role="button"></div>
</div>
</div>
</div>
<script>
!function(e,r,t,n,o){var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof i[n]&&i[n],l=a.cache||{},u="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(r,t){if(!l[r]){if(!e[r]){var o="function"==typeof i[n]&&i[n];if(!t&&o)return o(r,!0);if(a)return a(r,!0);if(u&&"string"==typeof r)return u(r);var c=Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}f.resolve=function(t){var n=e[r][1][t];return null!=n?n:t},f.cache={};var d=l[r]=new s.Module(r);e[r][0].call(d.exports,f,d,d.exports,this)}return l[r].exports;function f(e){var r=f.resolve(e);return!1===r?{}:s(r)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=l,s.parent=a,s.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]},Object.defineProperty(s,"root",{get:function(){return i[n]}}),i[n]=s;for(var c=0;c<r.length;c++)s(r[c]);if(t){var d=s(t);"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):o&&(this[o]=d)}}({"9W5RZ":[function(e,r,t){e("../js/template/image-interstitial.js")},{"../js/template/image-interstitial.js":"jTIrk"}],jTIrk:[function(e,r,t){var n=e("../setup"),o=e("../common");function i(){var e,r=document.querySelector("#buttonsLayer"),t=document.querySelector("#backgroundImage"),n=(e=document.querySelector("#overlay"),t.naturalWidth/t.naturalHeight>e.clientWidth/e.clientHeight);t.style.width=n?"100%":"auto",t.style.height=n?"auto":"100%",r.style.width=t.clientWidth+"px",r.style.height=t.clientHeight+"px"}var a=new ResizeObserver(function(){i()});(0,n.runSetup)({afterProcessVariables:function(e){var r=!0,t=!1,n=void 0;try{for(var i,a=e.buttons[Symbol.iterator]();!(r=(i=a.next()).done);r=!0){var l=i.value,u=(0,o.getDomElementForVariable)(l.id);u&&(u.onclick=(0,o.runTrackedAction).bind(null,l))}}catch(e){t=!0,n=e}finally{try{r||null==a.return||a.return()}finally{if(t)throw n}}},handleCustomTemplateVariable:function(e,r){if("overlay"===e){var t=(0,o.getDomElementForVariable)(e);return t.style.backgroundColor=r.backgroundColor,t.style.backgroundImage="url("+r.backgroundImage+")",t.style.backgroundRepeat=r.backgroundRepeat,t.style.backgroundSize=r.backgroundSize,!0}if("content"===e){var n=(0,o.getDomElementForVariable)(e),l=document.querySelector("#backgroundImage"),u=100-2*parseInt(r.margin,10)+"%";return a.unobserve(n),a.observe(n),n.style.width=u,n.style.height=u,l.src=r.backgroundImage,l.onload=l.onresize=i,!0}if("buttons"===e){var s=r.find(function(e){return e.name.includes("{TEST}")}),c=!0,d=!1,f=void 0;try{for(var p,m=r[Symbol.iterator]();!(c=(p=m.next()).done);c=!0){var v=p.value,b=(0,o.getDomElementForVariable)(v.id);b.style.display="block",b.style.border=s?"1px solid red":"none",b.style.width=v.size.width+"%",b.style.height=v.size.height+"%",b.style.top=v.position.y+"%",b.style.left=v.position.x+"%"}}catch(e){d=!0,f=e}finally{try{c||null==m.return||m.return()}finally{if(d)throw f}}return!0}return!1}})},{"../setup":"66h8r","../common":"3BoxG"}],"66h8r":[function(e,r,t){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(t),n.export(t,"variables",function(){return a}),n.export(t,"runSetup",function(){return l});var o=e("./vars"),i=e("./common"),a=null;function l(e){var r,t=e.afterProcessVariables,n=e.handleCustomTemplateVariable;a=o.variables,0===(r=document.querySelector("body")).clientHeight&&(r.style.height="100%"),document.addEventListener("touchstart",function(){},!1),(0,i.processVariables)(t,n)}},{"./vars":"beTl7","./common":"3BoxG","@parcel/transformer-js/src/esmodule-helpers.js":"3ieD1"}],beTl7:[function(e,r,t){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(t),n.export(t,"variables",function(){return o});var o=JSON.parse("##Vars##")},{"@parcel/transformer-js/src/esmodule-helpers.js":"3ieD1"}],"3ieD1":[function(e,r,t){t.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},t.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.exportAll=function(e,r){return Object.keys(e).forEach(function(t){"default"===t||"__esModule"===t||r.hasOwnProperty(t)||Object.defineProperty(r,t,{enumerable:!0,get:function(){return e[t]}})}),r},t.export=function(e,r,t){Object.defineProperty(e,r,{enumerable:!0,get:t})}},{}],"3BoxG":[function(e,r,t){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(t),n.export(t,"processVariables",function(){return a}),n.export(t,"getDomElementForVariable",function(){return l}),n.export(t,"runTrackedAction",function(){return u});var o=e("./setup"),i={};function a(e,r){for(var t in o.variables){var n=o.variables[t];if("function"==typeof r&&r(t,n))continue}"function"==typeof e&&e(o.variables)}function l(e){return function(e){var r=i[e];if(r)return r;var t=document.querySelector(e);return t||(o.variables.devMode&&console.log("No selector found for "+e),t={style:{}}),r=t,t}("#"+e.toLowerCase().replace(/ /g,"-"))}function u(e){var r=e.actions;switch(r.type){case"url":s("android"===(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.clevertap?"ios":window.CleverTap?"android":o.variables.devMode?null:void console.error("can not communicate to sdk"))?r.android:r.ios,e.name,e.id);break;case"close":s("wzrk://thisleadstonowhere",e.name,e.id)}}function s(e,r,t){e+=(e.includes("?")?"&":"?")+("wzrk_c2a="+r)+"&button_id="+t;var n=document.createElement("a");n.setAttribute("href",e);var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!1),n.dispatchEvent(o)}},{"./setup":"66h8r","@parcel/transformer-js/src/esmodule-helpers.js":"3ieD1"}]},["9W5RZ"],"9W5RZ","parcelRequire49af");
</script>
</body>
</html>
Loading

0 comments on commit 46867b5

Please sign in to comment.