Skip to content

Commit

Permalink
Merge pull request #58 from CleverTap/3.7.0
Browse files Browse the repository at this point in the history
PR for Release v3.7.0
  • Loading branch information
darshanclevertap authored Mar 11, 2020
2 parents de6c28a + 46b456b commit 337bce9
Show file tree
Hide file tree
Showing 27 changed files with 658 additions and 112 deletions.
2 changes: 1 addition & 1 deletion AndroidStarter/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

//CleverTap Android SDK, make sure the AAR file is in the libs folder
implementation (name: 'clevertap-android-sdk-3.6.4', ext: 'aar')
implementation (name: 'clevertap-android-sdk-3.7.0', ext: 'aar')

implementation 'com.google.firebase:firebase-messaging:17.3.0' //Needed for FCM
implementation 'com.google.android.gms:play-services-ads:15.0.1' //Needed to use Google Ad Ids
Expand Down
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## CHANGE LOG

### Version 3.7.0 (March 11, 2020)
* Adds support for Xiaomi & Baidu Push Notification Services
* Adds public APIs for raising Notification Clicked and Viewed events for App Inbox
* Adds public APIS for marking inbox message as read and deleting inbox message per message ID
* Fixes center alignment issue of Native InApps on Mobile devices
* Performance improvements

### Version 3.6.4 (February 26, 2020)
* Reverting Google Play Install Library to v1.0
* Bug Fixes
Expand Down
18 changes: 15 additions & 3 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,21 @@ cleverTapDefaultInstance.getInboxMessageForId(messageId);
//Delete message from the Inbox. Message id should be a String
cleverTapDefaultInstance.deleteInboxMessage(messageId);
//Mark Message as Read
//Delete message from the Inbox. Message should object of CTInboxMessage
cleverTapDefaultInstance.deleteInboxMessage(message);
//Mark Message as Read. Message id should be a String
cleverTapDefaultInstance.markReadInboxMessage(messageId);
//Mark message as Read. Message should object of CTInboxMessage
cleverTapDefaultInstance.markReadInboxMessage(message);
//Raise Notification Viewed event for Inbox Message. Message id should be a String
cleverTapDefaultInstance.pushInboxNotificationViewedEvent(messageId);
//Raise Notification Clicked event for Inbox Message. Message id should be a String
cleverTapDefaultInstance.pushInboxNotificationClickedEvent(messageId);
//Callback on Inbox Message update/delete/read (any activity)
@Override
public void inboxMessagesDidUpdate() { }
Expand Down Expand Up @@ -349,8 +361,8 @@ Add the following between the `<application></application>` tags. This will enab
</receiver>
```

From CleverTap SDK v3.6.3 onwards, just remove the above the Broadcast Receiver if you are using it and add the following gradle dependency to capture UTM details, app install time, referrer click time and other metrics provided by the Google Install Referrer Library.
From CleverTap SDK v3.6.4 onwards, just remove the above the Broadcast Receiver if you are using it and add the following gradle dependency to capture UTM details, app install time, referrer click time and other metrics provided by the Google Install Referrer Library.

```markdown
implementation 'com.android.installreferrer:installreferrer:1.1'
implementation 'com.android.installreferrer:installreferrer:1.0'
```
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ For more information check out our [website](https://clevertap.com "CleverTap")

```markdown
dependencies {
implementation 'com.clevertap.android:clevertap-android-sdk:3.6.4'
implementation 'com.clevertap.android:clevertap-android-sdk:3.7.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:

```markdown
dependencies {
implementation (name: 'clevertap-android-sdk-3.6.4', ext: 'aar')
implementation (name: 'clevertap-android-sdk-3.7.0', ext: 'aar')
}
```

Then add the Firebase Messaging library and Android Support Library v4 as dependencies to your Module `build.gradle` file.

```markdown
dependencies {
implementation 'com.clevertap.android:clevertap-android-sdk:3.6.4'
implementation 'com.clevertap.android:clevertap-android-sdk:3.7.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.android.gms:play-services-ads:15.0.1' // Required only if you enable Google ADID collection in the SDK (turned off by default).
Expand Down
Binary file removed clevertap-android-sdk-3.6.4.aar
Binary file not shown.
Binary file added clevertap-android-sdk-3.7.0.aar
Binary file not shown.
6 changes: 3 additions & 3 deletions clevertap-android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ext {
siteUrl = 'https://github.com/CleverTap/clevertap-android-sdk'
gitUrl = 'https://github.com/CleverTap/clevertap-android-sdk.git'

libraryVersion = '3.6.4'
libraryVersion = '3.7.0'

developerId = 'clevertap'
developerName = 'CleverTap'
Expand Down Expand Up @@ -57,11 +57,11 @@ android {

buildTypes {
debug {
buildConfigField "String", "SDK_VERSION_STRING", '"!SDK-VERSION-STRING!:com.clevertap.android:clevertap-android-sdk:3.6.4.0"'
buildConfigField "String", "SDK_VERSION_STRING", '"!SDK-VERSION-STRING!:com.clevertap.android:clevertap-android-sdk:3.7.0.0"'
}

release {
buildConfigField "String", "SDK_VERSION_STRING", '"!SDK-VERSION-STRING!:com.clevertap.android:clevertap-android-sdk:3.6.4.0"'
buildConfigField "String", "SDK_VERSION_STRING", '"!SDK-VERSION-STRING!:com.clevertap.android:clevertap-android-sdk:3.7.0.0"'
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Expand Down
4 changes: 2 additions & 2 deletions clevertap-android-sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clevertap.android.sdk"
android:versionCode="30604"
android:versionName="3.6.4">
android:versionCode="30700"
android:versionName="3.7.0">
<application>
<activity
android:name="com.clevertap.android.sdk.InAppNotificationActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.view.Gravity;
Expand Down Expand Up @@ -70,6 +71,15 @@ public void onGlobalLayout() {
} else {
layoutHeight = layoutParams.height = (int) (relativeLayout1.getMeasuredWidth() * 1.3f);
relativeLayout1.setLayoutParams(layoutParams);

new Handler().post(new Runnable() {
@Override
public void run() {
int margin = closeImageView.getMeasuredWidth() / 2;
closeImageView.setX(relativeLayout.getRight() - margin);
closeImageView.setY(relativeLayout.getTop() - margin);
}
});
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand Down Expand Up @@ -100,6 +110,14 @@ public void onGlobalLayout() {
layoutWidth = layoutParams.width = (int) (relativeLayout1.getMeasuredHeight() * 1.3f);
layoutParams.gravity = Gravity.CENTER_HORIZONTAL;
relativeLayout1.setLayoutParams(layoutParams);
new Handler().post(new Runnable() {
@Override
public void run() {
int margin = closeImageView.getMeasuredWidth() / 2;
closeImageView.setX(relativeLayout.getRight() - margin);
closeImageView.setY(relativeLayout.getTop() - margin);
}
});
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -63,6 +64,14 @@ public void onGlobalLayout() {
} else {
layoutHeight = layoutParams.height = (int) (relativeLayout1.getMeasuredWidth() * 1.3f);
relativeLayout1.setLayoutParams(layoutParams);
new Handler().post(new Runnable() {
@Override
public void run() {
int margin = closeImageView.getMeasuredWidth() / 2;
closeImageView.setX(relativeLayout.getRight() - margin);
closeImageView.setY(relativeLayout.getTop() - margin);
}
});
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand Down Expand Up @@ -93,6 +102,14 @@ public void onGlobalLayout() {
layoutWidth = layoutParams.width = (int) (relativeLayout1.getMeasuredHeight() * 1.3f);
layoutParams.gravity = Gravity.CENTER_HORIZONTAL;
relativeLayout1.setLayoutParams(layoutParams);
new Handler().post(new Runnable() {
@Override
public void run() {
int margin = closeImageView.getMeasuredWidth() / 2;
closeImageView.setX(relativeLayout.getRight() - margin);
closeImageView.setY(relativeLayout.getTop() - margin);
}
});
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.v4.content.ContextCompat;
Expand Down Expand Up @@ -88,7 +88,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
relativeLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
RelativeLayout relativeLayout1 = fl.findViewById(R.id.interstitial_relative_layout);
final RelativeLayout relativeLayout1 = fl.findViewById(R.id.interstitial_relative_layout);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) relativeLayout1.getLayoutParams();
if (inAppNotification.isTablet() && isTablet()) {
layoutHeight = layoutParams.height = (int) (relativeLayout1.getMeasuredWidth() * 1.78f);
Expand All @@ -107,6 +107,14 @@ public void onGlobalLayout() {
Logger.d("Layout height = " + layoutHeight);
Logger.d("Layout width = " + relativeLayout1.getMeasuredWidth());
relativeLayout1.setLayoutParams(layoutParams);
new Handler().post(new Runnable() {
@Override
public void run() {
int margin = closeImageView.getMeasuredWidth() / 2;
closeImageView.setX(relativeLayout1.getRight() - margin);
closeImageView.setY(relativeLayout1.getTop() - margin);
}
});
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand Down Expand Up @@ -146,7 +154,7 @@ public void onGlobalLayout() {
relativeLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
RelativeLayout relativeLayout1 = fl.findViewById(R.id.interstitial_relative_layout);
final RelativeLayout relativeLayout1 = fl.findViewById(R.id.interstitial_relative_layout);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) relativeLayout1.getLayoutParams();
if (!inAppNotification.isTablet() || !isTablet()) {
if (isTablet()) {
Expand All @@ -162,6 +170,14 @@ public void onGlobalLayout() {
layoutWidth = layoutParams.width = (int) (relativeLayout1.getMeasuredHeight() * 1.78f);
layoutParams.gravity = Gravity.CENTER_HORIZONTAL;
relativeLayout1.setLayoutParams(layoutParams);
new Handler().post(new Runnable() {
@Override
public void run() {
int margin = closeImageView.getMeasuredWidth() / 2;
closeImageView.setX(relativeLayout1.getRight() - margin);
closeImageView.setY(relativeLayout1.getTop() - margin);
}
});
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -48,7 +49,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
relativeLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
RelativeLayout relativeLayout1 = fl.findViewById(R.id.interstitial_image_relative_layout);
final RelativeLayout relativeLayout1 = fl.findViewById(R.id.interstitial_image_relative_layout);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) relativeLayout1.getLayoutParams();
if (inAppNotification.isTablet() && isTablet()) {
layoutHeight = layoutParams.height = (int) (relativeLayout1.getMeasuredWidth() * 1.78f);
Expand All @@ -65,6 +66,14 @@ public void onGlobalLayout() {
} else {
layoutHeight = layoutParams.height = (int) (relativeLayout1.getMeasuredWidth() * 1.78f);
relativeLayout1.setLayoutParams(layoutParams);
new Handler().post(new Runnable() {
@Override
public void run() {
int margin = closeImageView.getMeasuredWidth() / 2;
closeImageView.setX(relativeLayout1.getRight() - margin);
closeImageView.setY(relativeLayout1.getTop() - margin);
}
});
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand All @@ -79,7 +88,7 @@ public void onGlobalLayout() {
relativeLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
RelativeLayout relativeLayout1 = fl.findViewById(R.id.interstitial_image_relative_layout);
final RelativeLayout relativeLayout1 = fl.findViewById(R.id.interstitial_image_relative_layout);
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) relativeLayout1.getLayoutParams();
if (!inAppNotification.isTablet() || !isTablet()) {
if (isTablet()) {
Expand All @@ -95,6 +104,14 @@ public void onGlobalLayout() {
layoutWidth = layoutParams.width = (int) (relativeLayout1.getMeasuredHeight() * 1.78f);
layoutParams.gravity = Gravity.CENTER_HORIZONTAL;
relativeLayout1.setLayoutParams(layoutParams);
new Handler().post(new Runnable() {
@Override
public void run() {
int margin = closeImageView.getMeasuredWidth() / 2;
closeImageView.setX(relativeLayout1.getRight() - margin);
closeImageView.setY(relativeLayout1.getTop() - margin);
}
});
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Expand Down
Loading

0 comments on commit 337bce9

Please sign in to comment.