Skip to content

Commit

Permalink
Merge pull request #569 from CleverTap/develop
Browse files Browse the repository at this point in the history
Updating master correctly for core release 610
  • Loading branch information
CTLalit authored Feb 26, 2024
2 parents 46867b5 + bc2d99c commit 7f084bb
Show file tree
Hide file tree
Showing 145 changed files with 2,612 additions and 2,277 deletions.
4 changes: 2 additions & 2 deletions .github/mini_flows/setup_jdk/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
runs:
using: "composite"
steps:
- name: Setup JDK 11
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
# cache: gradle
2 changes: 1 addition & 1 deletion .github/workflows/manually_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
if: ${{ github.event.inputs.check_mandatory }}
uses: ./.github/mini_flows/mandatory_filechanges

- name: Setup JDK 11.
- name: Setup JDK 17.
uses: ./.github/mini_flows/setup_jdk

- name: Run lint tests and Upload results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_pr_from_develop_to_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Checkout the code from Repo
uses: actions/checkout@v3

- name: Setup JDK 11.
- name: Setup JDK 17.
uses: ./.github/mini_flows/setup_jdk

- name: Mandatory File Changes
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on_pr_from_task_to_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
lint-staticChecks-test-build:
if: startsWith(github.head_ref, 'task/')
if: startsWith(github.head_ref, 'task/') || startsWith(github.head_ref, 'feat/') || startsWith(github.head_ref, 'bug/')
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -15,7 +15,7 @@ jobs:
- name: Checkout the code from Repo
uses: actions/checkout@v3

- name: Setup JDK 11.
- name: Setup JDK 17.
uses: ./.github/mini_flows/setup_jdk

- name: Run lint tests and Upload results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on_pr_merged_in_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Checkout the code from Repo
uses: actions/checkout@v3

- name: Setup JDK 11.
- name: Setup JDK 17.
uses: ./.github/mini_flows/setup_jdk

- name: Run lint tests and Upload results
Expand Down
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## CHANGE LOG.

### February 21, 2024

* [CleverTap Android SDK v6.1.0](docs/CTCORECHANGELOG.md)
* [CleverTap Push Templates SDK v1.2.3](docs/CTPUSHTEMPLATESCHANGELOG.md).
* [CleverTap Geofence SDK v1.3.0](docs/CTGEOFENCECHANGELOG.md)
* [CleverTap Huawei Push SDK v1.3.4](docs/CTHUAWEIPUSHCHANGELOG.md)

### January 15, 2024

* [CleverTap Android SDK v6.0.0](docs/CTCORECHANGELOG.md)
Expand Down Expand Up @@ -216,7 +223,7 @@
* Use v3.8.2
* Adds support for Product Config and Feature Flag as a part of Product Experiences feature
* Fixed InApp center alignment issue for tablets
* Adds support for custom handling payload when using Push Amplification.
* Adds support for custom handling payload when using Pull Notifications.
* Other bug fixes

### Version 3.7.2 (March 27, 2020)
Expand Down Expand Up @@ -257,7 +264,7 @@
* Adds support for deep link query parameters in InApps.
* Deprecated GCM.
* Deprecated EventHandler, SessionHandler and DataHandler classes.
* Workaround for below Oreo Android OS bug causing ANRs while using Push Amplification.
* Workaround for below Oreo Android OS bug causing ANRs while using Pull Notifications.
* Bug fixes and performance improvements

### Version 3.5.1 (May 24, 2019)
Expand Down Expand Up @@ -287,7 +294,7 @@

### Version 3.4.0 (January 14, 2019)
* Adds support for App Inbox
* Adds support for Push Amplification
* Adds support for Pull Notifications
* Workaround for Android O orientation bug in Native InApps
* Fixes a bug which led to ANR on 2G network

Expand Down
30 changes: 15 additions & 15 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:6.0.0"
}
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:6.1.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-6.0.0", ext: 'aar')
}
dependencies {
implementation (name: "clevertap-android-sdk-6.1.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:6.0.0"
implementation "androidx.core:core:1.9.0"
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:6.1.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 All @@ -70,8 +70,8 @@ Also be sure to include the `google-services.json` classpath in your Project lev
}
dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
classpath "com.google.gms:google-services:4.3.3"
classpath "com.android.tools.build:gradle:8.2.2"
classpath "com.google.gms:google-services:4.4.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -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.19.1"
implementation "com.google.android.exoplayer:exoplayer-hls:2.19.1"
implementation "com.google.android.exoplayer:exoplayer-ui:2.19.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
2 changes: 2 additions & 0 deletions clevertap-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
namespace 'com.clevertap.android.sdk'
testNamespace 'com.clevertap.demo'
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion clevertap-core/consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}

-dontwarn com.clevertap.android.sdk.**
-dontwarn com.baidu.**
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
6 changes: 4 additions & 2 deletions clevertap-core/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.clevertap.demo"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Required runtime permission to display notifications on Android 13 -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
Expand All @@ -15,6 +14,9 @@
<meta-data
android:name="CLEVERTAP_TOKEN"
android:value="TEST" />
<meta-data
android:name="CLEVERTAP_BACKGROUND_SYNC"
android:value="1" />

</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import android.content.Context
import android.util.Log
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.work.Configuration
import androidx.work.Constraints.Builder
import androidx.work.NetworkType.CONNECTED
import androidx.work.PeriodicWorkRequest
import androidx.work.WorkInfo
import androidx.work.WorkManager
import androidx.work.testing.SynchronousExecutor
import androidx.work.testing.WorkManagerTestInitHelper
import com.clevertap.android.sdk.CleverTapAPI
import com.clevertap.android.sdk.CleverTapAPI.LogLevel.VERBOSE
import com.clevertap.android.sdk.pushnotification.amp.CTPushAmpWorker
import org.hamcrest.CoreMatchers.*
import org.hamcrest.MatcherAssert.*
import org.junit.*
import org.junit.runner.*
import java.util.concurrent.TimeUnit.MINUTES

@RunWith(AndroidJUnit4::class)
class CTPushAmpWorkerInstrumentationTest {
@Before
fun setup() {
val context = InstrumentationRegistry.getInstrumentation().targetContext
val config = Configuration.Builder()
.setMinimumLoggingLevel(Log.VERBOSE)
.setExecutor(SynchronousExecutor())
.build()

// Initialize WorkManager for instrumentation tests.
WorkManagerTestInitHelper.initializeTestWorkManager(context, config)
}

@Test
fun testWork(){
CleverTapAPI.setDebugLevel(VERBOSE)
val myContext = ApplicationProvider.getApplicationContext<Context>()

val constraints = Builder()
.setRequiredNetworkType(CONNECTED)
.setRequiresCharging(false)
.setRequiresBatteryNotLow(true)
.build()

val request =
PeriodicWorkRequest.Builder(CTPushAmpWorker::class.java, 15, MINUTES, 5, MINUTES)
.setConstraints(constraints).build()

val workManager = WorkManager.getInstance(myContext)
val testDriver = WorkManagerTestInitHelper.getTestDriver(myContext)!!
// Enqueue
workManager.enqueue(request).result.get()
testDriver.setAllConstraintsMet(request.id)
testDriver.setPeriodDelayMet(request.id)
val workInfo = workManager.getWorkInfoById(request.id).get()
println("workInfo = $workInfo")
// Assert
assertThat(workInfo.state, `is`(WorkInfo.State.ENQUEUED))
}
}
12 changes: 5 additions & 7 deletions clevertap-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.clevertap.android.sdk"
xmlns:android="http://schemas.android.com/apk/res/android">

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Required runtime permission to display notifications on Android 13 -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

Expand All @@ -18,12 +16,12 @@
android:theme="@style/Theme.AppCompat.DayNight.DarkActionBar" />

<receiver
android:name="com.clevertap.android.sdk.pushnotification.CTPushNotificationReceiver"
android:name=".pushnotification.CTPushNotificationReceiver"
android:enabled="true"
android:exported="false" />

<service
android:name="com.clevertap.android.sdk.pushnotification.amp.CTBackgroundIntentService"
android:name=".pushnotification.amp.CTBackgroundIntentService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE">
<intent-filter>
Expand All @@ -32,12 +30,12 @@
</service>

<service
android:name="com.clevertap.android.sdk.pushnotification.amp.CTBackgroundJobService"
android:name=".pushnotification.amp.CTBackgroundJobService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />

<receiver
android:name="com.clevertap.android.sdk.pushnotification.fcm.CTFirebaseMessagingReceiver"
android:name=".pushnotification.fcm.CTFirebaseMessagingReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter android:priority="-1">
Expand Down
Loading

0 comments on commit 7f084bb

Please sign in to comment.