Skip to content

Commit

Permalink
Merge pull request #380 from CleverTap/develop
Browse files Browse the repository at this point in the history
Release v2.1.0
  • Loading branch information
Anush-Shand authored Mar 7, 2024
2 parents e9459aa + f1a18af commit 013d962
Show file tree
Hide file tree
Showing 19 changed files with 106 additions and 122 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ build/
local.properties
Example/android/app/google-services.json
*.iml
.project
.settings

# Node
node_modules
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
Change Log
==========

**What's new**

Version 2.1.0 *(7 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-january-15-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.2.2 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 for CleverTap-iOS-SDK & CleverTapLocation.

**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

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

Version 2.0.0 *(15 February 2024)*
-------------------------------------------
**What's new**
Expand Down
6 changes: 3 additions & 3 deletions Example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ project.ext.react = [
nodeExecutableAndArgs: ["/usr/local/bin/node"]
]

apply from: "../../node_modules/react-native/react.gradle"

/**
* Set this to true to create two separate APKs instead of one:
Expand Down Expand Up @@ -158,6 +157,7 @@ android {
keyPassword 'android'
}
}
namespace 'com.reactnct'
buildTypes {
debug {
signingConfig signingConfigs.debug
Expand Down Expand Up @@ -218,8 +218,8 @@ dependencies {


//clevertap
implementation 'com.clevertap.android:clevertap-android-sdk:6.0.0'
implementation "com.clevertap.android:push-templates:1.2.2"
implementation 'com.clevertap.android:clevertap-android-sdk:6.1.1'
implementation "com.clevertap.android:push-templates:1.2.3"
implementation project(':clevertap-react-native')


Expand Down

This file was deleted.

3 changes: 1 addition & 2 deletions Example/android/app/src/main/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.reactnct">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<!-- Recommended so that CleverTap knows when to attempt a network call -->
Expand Down
12 changes: 6 additions & 6 deletions Example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

buildscript {
ext {
buildToolsVersion = "33.0.0"
buildToolsVersion = "34.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "20.1.5948944"
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.2.11394342"
}
repositories {
google()
Expand All @@ -25,8 +25,8 @@ buildscript {
maven { url "https://maven.google.com" }
}
dependencies {
classpath('com.android.tools.build:gradle:7.3.1')
classpath ('com.google.gms:google-services:4.3.5')
classpath('com.android.tools.build:gradle:8.2.2')
classpath ('com.google.gms:google-services:4.4.1')
classpath("com.facebook.react:react-native-gradle-plugin")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
8 changes: 5 additions & 3 deletions Example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand All @@ -27,5 +27,7 @@ android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.125.0

android.enableDexingArtifactTransform.desugaring=false
hermesEnabled=true
hermesEnabled=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,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion Example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply from: file("../node_modules/@react-native-community/cli-platform-android/n
include ':app'
include ':clevertap-react-native'
project(':clevertap-react-native').projectDir = new File(settingsDir, '../node_modules/clevertap-react-native/android')
includeBuild('../node_modules/react-native-gradle-plugin')
includeBuild('../node_modules/@react-native/gradle-plugin')



44 changes: 29 additions & 15 deletions Example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
/* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/

module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');

const defaultConfig = getDefaultConfig(__dirname);

const {
resolver: { sourceExts, assetExts },
} = getDefaultConfig(__dirname);

const config = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
},
};

module.exports = mergeConfig(defaultConfig, config);
8 changes: 5 additions & 3 deletions Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@
"lint": "eslint ."
},
"dependencies": {
"@react-native/metro-config": "^0.72.12",
"@react-navigation/drawer": "^6.6.2",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"clevertap-react-native": "git+https://github.com/CleverTap/clevertap-react-native#develop",
"react": "18.2.0",
"react-native": "0.71.8",
"react-native": "0.73.5",
"react-native-drawer": "^2.5.1",
"react-native-gesture-handler": "^1.10.3",
"react-native-pager-view": "^5.1.2",
"react-native-reanimated": "^3.1.0",
"react-native-reanimated": "^3.4.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.0.0",
"react-native-screens": "^3.22.0",
"react-native-svg-transformer": "^1.3.0",
"react-native-tab-view": "^3.0.1",
"react-navigation-drawer": "^2.7.0"
},
Expand Down
17 changes: 9 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ buildscript {
name 'Google'
}
}

dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:8.2.2'
}
}

android {
compileSdkVersion 33
buildToolsVersion '33.0.0'
compileSdkVersion 34
buildToolsVersion '34.0.0'

defaultConfig {
minSdkVersion 19
targetSdkVersion 33
versionCode 200
versionName "2.0.0"
targetSdkVersion 34
versionCode 210
versionName "2.1.0"
}

namespace 'com.clevertap.react'
buildTypes {
release {
minifyEnabled false
Expand All @@ -39,7 +40,7 @@ dependencies {
maven { url "$rootDir/../node_modules/react-native/android" }
}

api 'com.clevertap.android:clevertap-android-sdk:6.0.0'
api 'com.clevertap.android:clevertap-android-sdk:6.1.1'
implementation 'com.android.installreferrer:installreferrer:2.2'
//compile 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.facebook.react:react-native:+'
Expand Down
3 changes: 2 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
android.useAndroidX=true
android.useAndroidX=true
android.enableJetifier=true
6 changes: 3 additions & 3 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 06 22:41:12 IST 2020
#Tue Mar 05 15:25:40 IST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
zipStoreBase=GRADLE_USER_HOME
7 changes: 6 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clevertap.react">
xmlns:tools="http://schemas.android.com/tools">
<application>
<service
android:name="com.clevertap.android.sdk.pushnotification.amp.CTBackgroundJobService"
android:enabled="false"
android:exported="false"
tools:ignore="MissingClass" />
</application>
</manifest>
4 changes: 4 additions & 0 deletions android/src/main/java/com/clevertap/react/CleverTapUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public static WritableMap convertObjectToWritableMap(JSONObject jsonObject) {
writableMap.putInt(key, (Integer) value);
} else if (value instanceof Boolean) {
writableMap.putBoolean(key, (Boolean) value);
} else if (value instanceof Long) {
writableMap.putDouble(key, ((Long) value).doubleValue());
} else if (value instanceof Float || value instanceof Double) {
writableMap.putDouble(key, Double.parseDouble(value.toString()));
} else if (value instanceof JSONObject) {
Expand Down Expand Up @@ -109,6 +111,8 @@ private static WritableArray convertArrayToWritableArray(JSONArray jsonArray) {
writableArray.pushInt((Integer) value);
} else if (value instanceof Boolean) {
writableArray.pushBoolean((Boolean) value);
} else if (value instanceof Long) {
writableArray.pushDouble(((Long) value).doubleValue());
} else if (value instanceof Float || value instanceof Double) {
writableArray.pushDouble(Double.parseDouble(value.toString()));
} else if (value instanceof JSONObject) {
Expand Down
2 changes: 1 addition & 1 deletion clevertap-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Pod::Spec.new do |s|
s.preserve_paths = 'LICENSE.md', 'README.md', 'package.json', 'index.js'
s.source_files = 'ios/CleverTapReact/*.{h,m}'

s.dependency 'CleverTap-iOS-SDK', '6.0.0'
s.dependency 'CleverTap-iOS-SDK', '6.1.0'
s.dependency 'React-Core'
end
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const EventEmitter = NativeModules.CleverTapReactEventEmitter ? new NativeEventE
* @param {int} libVersion - The updated library version. If current version is 1.1.0 then pass as 10100
*/
const libName = 'React-Native';
const libVersion = 20000;
const libVersion = 20100;
CleverTapReact.setLibrary(libName,libVersion);

function defaultCallback(method, err, res) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clevertap-react-native",
"version": "2.0.0",
"version": "2.1.0",
"description": "CleverTap React Native SDK.",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 013d962

Please sign in to comment.