Skip to content

Commit

Permalink
Merge pull request #225 from CleverTap/develop
Browse files Browse the repository at this point in the history
Release 2.2.0
  • Loading branch information
CTLalit authored Mar 19, 2024
2 parents 418c5ad + a55466d commit ed28847
Show file tree
Hide file tree
Showing 22 changed files with 124 additions and 116 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
example/build
example/android/app/google-services.json
build/
example/pubspec.lock
pubspec.lock

24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
## CHANGE LOG

### Version 2.2.0 *(19 March 2024)*
-------------------------------------------
**What's new**
* **[Android Platform]**
* Supports [CleverTap Android SDK v6.1.1](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md#version-611-february-27-2024).
* Supports Android 14, made it compliant with Android 14 requirements. Details [here](https://developer.android.com/about/versions/14/summary)
* Upgrades AGP to 8.3.0 for building the SDK and adds related consumer proguard rules
* Deprecates Xiaomi public methods as we are sunsetting SDK. Details [here](https://dev.mi.com/distribute/doc/details?pId=1555).
* Adds Accessibility ids for UI components of SDK
* Migrates JobScheduler to WorkManager for Pull Notifications.

* **[iOS Platform]**
* Supports [CleverTap iOS SDK v6.1.0](https://github.com/CleverTap/clevertap-ios-sdk/releases/tag/6.1.0).
* Adds privacy manifests.

**Bug Fixes**
* **[Android Platform]**
* Fixes InApps crash in a rare activity destroyed race condition
* Fixes Potential ANR in a race condition of SDK initialisation in multithreaded setup
* Fixes [#211](https://github.com/CleverTap/clevertap-flutter/issues/211)

* **[iOS Platform]**
* Fixes crash due to out of bounds in NSLocale implementation.

### Version 2.1.0 *(26 February 2024)*
-------------------------------------------
**What's new**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To get started, sign up [here](https://clevertap.com/live-product-demo/).

```yaml
dependencies:
clevertap_plugin: 2.1.0
clevertap_plugin: 2.2.0
```
- Run `flutter packages get` to install the SDK
Expand Down
26 changes: 10 additions & 16 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
group 'com.clevertap.clevertap_plugin'
version '2.1.0'

buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
}
plugins {
id "com.android.library"
}

group 'com.clevertap.clevertap_plugin'
version '2.2.0'

rootProject.allprojects {
repositories {
google()
Expand All @@ -22,10 +15,11 @@ rootProject.allprojects {
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 33
compileSdkVersion 34
if (project.android.hasProperty("namespace")) {
namespace 'com.clevertap.clevertap_plugin'
}

defaultConfig {
minSdkVersion 19
Expand All @@ -42,7 +36,7 @@ android {

dependencies {
testImplementation 'junit:junit:4.13.2'
api 'com.clevertap.android:clevertap-android-sdk:6.0.0'
api 'com.clevertap.android:clevertap-android-sdk:6.1.1'
compileOnly 'androidx.fragment:fragment:1.3.6'
compileOnly 'androidx.core:core:1.9.0'
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
13 changes: 12 additions & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
rootProject.name = 'clevertap_plugin'
pluginManagement {
repositories {
google()
mavenCentral()
}
}

plugins {
id("com.android.library").version("8.3.0").apply(false)
}

rootProject.name = 'clevertap_plugin'
11 changes: 10 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clevertap.clevertap_plugin">
xmlns:tools="http://schemas.android.com/tools"
package="com.clevertap.clevertap_plugin">
<!-- we need to add package so client can use both AGP 7+ and 8+, can remove when AGP 7 is deprecated !-->
<application>
<service
android:name="com.clevertap.android.sdk.pushnotification.amp.CTBackgroundJobService"
android:enabled="false"
android:exported="false"
tools:ignore="MissingClass" />
</application>
</manifest>
12 changes: 6 additions & 6 deletions doc/Integrate-Android.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Add the following to your `dependencies` section in `project/build.gradle`

```groovy
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.3' //<--- Mandatory for using Firebase Messaging, skip if not using FCM
classpath 'com.android.tools.build:gradle:8.3.0'
classpath 'com.google.gms:google-services:4.4.1' //<--- Mandatory for using Firebase Messaging, skip if not using FCM
}
```

Add the following to your `dependencies` section in `app/build.gradle`
```groovy
implementation 'com.google.firebase:firebase-messaging:21.0.0'
implementation 'com.google.firebase:firebase-messaging:23.4.1'
implementation 'androidx.core:core:1.3.0'
implementation 'androidx.fragment:fragment:1.3.6'
Expand All @@ -26,9 +26,9 @@ Add the following to your `dependencies` section in `app/build.gradle`
implementation 'com.android.installreferrer:installreferrer:2.2'
//Optional ExoPlayer Libraries for Audio/Video Inbox Messages. Audio/Video messages will be dropped without these dependencies
implementation 'com.google.android.exoplayer:exoplayer:2.15.1'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.15.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.15.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'
```

At the end of the `app/build.gradle` file add the following
Expand Down
37 changes: 16 additions & 21 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
plugins {
id "com.android.application"
id "com.google.gms.google-services"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +11,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
Expand All @@ -21,20 +21,13 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33

lintOptions {
disable 'InvalidPackage'
}
compileSdkVersion flutter.compileSdkVersion

defaultConfig {
applicationId "com.example.clevertap_plugin_example"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
Expand All @@ -47,6 +40,10 @@ android {
signingConfig signingConfigs.debug
}
}
namespace 'com.example.clevertap_plugin_example'
lint {
disable 'InvalidPackage'
}
}

flutter {
Expand All @@ -56,8 +53,8 @@ flutter {
dependencies {
testImplementation 'junit:junit:4.13'
//implementation fileTree('libs')
implementation "com.clevertap.android:push-templates:1.2.2"
implementation 'com.google.firebase:firebase-messaging:21.0.0'
implementation "com.clevertap.android:push-templates:1.2.3"
implementation 'com.google.firebase:firebase-messaging:23.4.1'
implementation 'androidx.core:core:1.3.0'
implementation 'androidx.fragment:fragment:1.3.6'
//MANDATORY for App Inbox
Expand All @@ -68,12 +65,10 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.12.0'

//Optional ExoPlayer Libraries for Audio/Video Inbox Messages. Audio/Video messages will be dropped without these dependencies
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'
implementation 'com.android.installreferrer:installreferrer:2.2'

implementation 'com.android.support:multidex:1.0.3'
}

apply plugin: 'com.google.gms.google-services'
3 changes: 1 addition & 2 deletions example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.clevertap_plugin_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.clevertap_plugin_example">
xmlns:tools="http://schemas.android.com/tools">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down
3 changes: 1 addition & 2 deletions example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.clevertap_plugin_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
19 changes: 4 additions & 15 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.google.gms:google-services:4.3.8'
}
}

allprojects {
repositories {
google()
Expand All @@ -20,14 +8,15 @@ allprojects {
}
}

rootProject.buildDir = '../build'
rootProject.layout.buildDirectory = '../build'

subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.layout.buildDirectory = "${rootProject.layout.buildDirectory}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
delete rootProject.layout.buildDirectory
}
6 changes: 5 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableR8=true
android.enableDexingArtifactTransform.desugaring=false
#android.enableDexingArtifactTransform.desugaring=false -> this was used before -> check below line
android.useFullClasspathForDexingTransform=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon May 31 23:31:27 IST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
31 changes: 21 additions & 10 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
plugins {
id("dev.flutter.flutter-plugin-loader").version("1.0.0")
id("com.android.application").version("8.3.0").apply(false)
id("com.google.gms.google-services").version("4.4.1").apply(false)
//id "org.jetbrains.kotlin.android" version "{kotlinVersion}" apply false -> we dont use kotlin
}

include ":app"
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'dart:io' show Platform;
import 'package:example/notification_button.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
Expand Down Expand Up @@ -2359,6 +2358,7 @@ class _MyAppState extends State<MyApp> {
}

void activate() {
super.activate();
CleverTapPlugin.activate();
showToast("check console for logs");
}
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description: A CleverTap Flutter Example project.
version: 1.0.0+1

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: '>=3.2.0-0 <4.0.0'

dependencies:
flutter_styled_toast: ^2.0.1
Expand Down
4 changes: 2 additions & 2 deletions ios/clevertap_plugin.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
Pod::Spec.new do |s|
s.name = 'clevertap_plugin'
s.version = '2.1.0'
s.version = '2.2.0'
s.summary = 'CleverTap Flutter plugin.'
s.description = 'The CleverTap iOS SDK for App Analytics and Engagement.'
s.homepage = 'https://github.com/CleverTap/clevertap-ios-sdk'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'CleverTap-iOS-SDK', '6.0.0'
s.dependency 'CleverTap-iOS-SDK', '6.1.0'
s.ios.deployment_target = '9.0'
end

Loading

0 comments on commit ed28847

Please sign in to comment.