Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.7.2 #376

Merged
merged 5 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## CHANGE LOG.

### December 16, 2022
* [CleverTap Android SDK v4.7.2](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md)

### December 5, 2022
* [CleverTap Android SDK v4.7.1](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTCORECHANGELOG.md)
* [CleverTap Push Templates SDK v1.0.7](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/CTPUSHTEMPLATESCHANGELOG.md)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ We publish the SDK to `mavenCentral` as an `AAR` file. Just declare it as depend

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:4.7.1"
implementation "com.clevertap.android:clevertap-android-sdk:4.7.2"
}
```

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-4.7.1", ext: 'aar')
implementation (name: "clevertap-android-sdk-4.7.2", ext: 'aar')
}
```

Expand All @@ -46,7 +46,7 @@ Add the Firebase Messaging library and Android Support Library v4 as dependencie

```groovy
dependencies {
implementation "com.clevertap.android:clevertap-android-sdk:4.7.1"
implementation "com.clevertap.android:clevertap-android-sdk:4.7.2"
implementation "androidx.core:core:1.9.0"
implementation "com.google.firebase:firebase-messaging:23.0.6"
implementation "com.google.android.gms:play-services-ads:19.4.0" // Required only if you enable Google ADID collection in the SDK (turned off by default).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.clevertap.android.sdk.CleverTapInstanceConfig;
import com.clevertap.android.sdk.Constants;
import com.clevertap.android.sdk.DidClickForHardPermissionListener;
import com.clevertap.android.sdk.InAppNotificationActivity;
import com.clevertap.android.sdk.Utils;
import com.clevertap.android.sdk.customviews.CloseImageView;
import java.lang.ref.WeakReference;
Expand Down Expand Up @@ -54,7 +56,11 @@ public void onAttach(Context context) {
config = bundle.getParcelable(Constants.KEY_CONFIG);
currentOrientation = getResources().getConfiguration().orientation;
generateListener();
didClickForHardPermissionListener = (DidClickForHardPermissionListener) getActivity();
/*Initialize the below listener only when in app has InAppNotification activity as their host activity
when requesting permission for notification.*/
if (context instanceof DidClickForHardPermissionListener) {
didClickForHardPermissionListener = (DidClickForHardPermissionListener) context;
}
}
}

Expand Down Expand Up @@ -146,7 +152,8 @@ void handleButtonClickAtIndex(int index) {

didClick(data, button.getKeyValues());

if (index == 0 && inAppNotification.isLocalInApp()) {
if (index == 0 && inAppNotification.isLocalInApp() &&
didClickForHardPermissionListener != null) {
didClickForHardPermissionListener.didClickForHardPermissionWithFallbackSettings(
inAppNotification.fallBackToNotificationSettings());
return;
Expand All @@ -156,7 +163,8 @@ void handleButtonClickAtIndex(int index) {
}

if (button.getType() != null && button.getType().contains(
Constants.KEY_REQUEST_FOR_NOTIFICATION_PERMISSION)){
Constants.KEY_REQUEST_FOR_NOTIFICATION_PERMISSION)
&& didClickForHardPermissionListener != null){
didClickForHardPermissionListener.
didClickForHardPermissionWithFallbackSettings(button.isFallbackToSettings());
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ public void onAttach(@NonNull Context context) {
if (context instanceof CTInboxActivity) {
setListener((CTInboxListViewFragment.InboxListener) getActivity());
}
didClickForHardPermissionListener = (DidClickForHardPermissionListener) getActivity();
/*Initializes the below listener only when inbox payload has CTInbox activity as their host activity
when requesting permission for notification.*/
if (context instanceof DidClickForHardPermissionListener) {
didClickForHardPermissionListener = (DidClickForHardPermissionListener) context;
}
}
}
private void updateInboxMessages(){
Expand Down Expand Up @@ -288,7 +292,8 @@ void handleClick(int position, String buttonText, JSONObject jsonObject, HashMap

String isRequestForPermissionStr = inboxMessages.get(position).getInboxMessageContents().
get(0).getLinktype(jsonObject);
if (isRequestForPermissionStr.contains(Constants.KEY_REQUEST_FOR_NOTIFICATION_PERMISSION)){
if (isRequestForPermissionStr.contains(Constants.KEY_REQUEST_FOR_NOTIFICATION_PERMISSION)
&& didClickForHardPermissionListener != null){
boolean isFallbackSettings = inboxMessages.get(position).
getInboxMessageContents().get(0).isFallbackSettingsEnabled(jsonObject);
didClickForHardPermissionListener.didClickForHardPermissionWithFallbackSettings(isFallbackSettings);
Expand Down
5 changes: 5 additions & 0 deletions docs/CTCORECHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## CleverTap Android SDK CHANGE LOG

### Version 4.7.2 (December 16, 2022)
* Fixes a crash (`ClassCastException`) in header/footer InApp templates.

### Version 4.7.1 (December 5, 2022)
* Fixes ANR on main thread for static initialization of `SimpleDateFormat()`.
* Add Proguard rules to keep `CREATOR` instance for Parcelable classes to prevent `ClassNotFoundException` when unmarshalling: `androidx.fragment.app.FragmentManagerState`
Expand All @@ -8,6 +11,7 @@
* Made calls to `findCTPushProvider()` and `findCustomEnabledPushTypes()` async to prevent ANR when called on main thread.
* Renames `setPushPermissionNotificationResponseListener(PushPermissionResponseListener)` to `registerPushPermissionNotificationResponseListener(PushPermissionResponseListener)` . Each `PushPermissionResponseListener` instance passed in this method is now maintained in a list of the `PushPermissionResponseListener` type and the Push Primer result is notified to all the elements of this list.
* Adds `unregisterPushPermissionNotificationResponseListener(PushPermissionResponseListener)` method in `CleverTapAPI` class to unregister the `PushPermissionResponseListener` instance to stop observing the Push Primer result.
* Use v4.7.2, this version contains a bug which causes a crash (`ClassCastException`) in header/footer InApp templates.


### Version 4.7.0 (November 1, 2022)
Expand All @@ -19,6 +23,7 @@
* New callback `PushPermissionResponseListener` available which returns after user Allows/Denies notification permission [Usage can be found here](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/EXAMPLES.md#available-callbacks-for-push-primer)
* From 4.7.0+ existing callback `InAppNotificationListener` will now have `onShow(CTInAppNotification)` method which needs to implemented
* Minimum Android SDK version bumped to API 19 (Android 4.4)
* Use v4.7.2, this version contains a bug which causes a crash (`ClassCastException`) in header/footer InApp templates.

### Version 4.6.6 (October 31, 2022)
* Fixes App Inbox bug where an Inbox message's video would not play when new Inbox messages were available
Expand Down
2 changes: 1 addition & 1 deletion docs/CTGEOFENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Add the following dependencies to the `build.gradle`

```Groovy
implementation "com.clevertap.android:clevertap-geofence-sdk:1.2.0"
implementation "com.clevertap.android:clevertap-android-sdk:4.7.1" // 3.9.0 and above
implementation "com.clevertap.android:clevertap-android-sdk:4.7.2" // 3.9.0 and above
implementation "com.google.android.gms:play-services-location:21.0.0"
implementation "androidx.work:work-runtime:2.7.1" // required for FETCH_LAST_LOCATION_PERIODIC
implementation "androidx.concurrent:concurrent-futures:1.1.0" // required for FETCH_LAST_LOCATION_PERIODIC
Expand Down
2 changes: 1 addition & 1 deletion docs/CTPUSHTEMPLATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CleverTap Push Templates SDK helps you engage with your users using fancy push n

```groovy
implementation "com.clevertap.android:push-templates:1.0.7"
implementation "com.clevertap.android:clevertap-android-sdk:4.7.1" // 4.4.0 and above
implementation "com.clevertap.android:clevertap-android-sdk:4.7.2" // 4.4.0 and above
```

2. Add the following line to your Application class before the `onCreate()`
Expand Down
1 change: 1 addition & 0 deletions docs/CTPUSHTEMPLATESCHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Version 1.0.7 (December 5, 2022)
* UI bug fixes for Non-linear Product Catalogue template.
* Supports CleverTap Android SDK v4.7.2.

### Version 1.0.6 (November 1, 2022)
* Targets Android 13
Expand Down
5 changes: 5 additions & 0 deletions templates/CTCORECHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## CleverTap Android SDK CHANGE LOG

### Version 4.7.2 (December 16, 2022)
* Fixes a crash (`ClassCastException`) in header/footer InApp templates.

### Version 4.7.1 (December 5, 2022)
* Fixes ANR on main thread for static initialization of `SimpleDateFormat()`.
* Add Proguard rules to keep `CREATOR` instance for Parcelable classes to prevent `ClassNotFoundException` when unmarshalling: `androidx.fragment.app.FragmentManagerState`
Expand All @@ -8,6 +11,7 @@
* Made calls to `findCTPushProvider()` and `findCustomEnabledPushTypes()` async to prevent ANR when called on main thread.
* Renames `setPushPermissionNotificationResponseListener(PushPermissionResponseListener)` to `registerPushPermissionNotificationResponseListener(PushPermissionResponseListener)` . Each `PushPermissionResponseListener` instance passed in this method is now maintained in a list of the `PushPermissionResponseListener` type and the Push Primer result is notified to all the elements of this list.
* Adds `unregisterPushPermissionNotificationResponseListener(PushPermissionResponseListener)` method in `CleverTapAPI` class to unregister the `PushPermissionResponseListener` instance to stop observing the Push Primer result.
* Use v4.7.2, this version contains a bug which causes a crash (`ClassCastException`) in header/footer InApp templates.


### Version 4.7.0 (November 1, 2022)
Expand All @@ -19,6 +23,7 @@
* New callback `PushPermissionResponseListener` available which returns after user Allows/Denies notification permission [Usage can be found here](https://github.com/CleverTap/clevertap-android-sdk/blob/master/docs/EXAMPLES.md#available-callbacks-for-push-primer)
* From 4.7.0+ existing callback `InAppNotificationListener` will now have `onShow(CTInAppNotification)` method which needs to implemented
* Minimum Android SDK version bumped to API 19 (Android 4.4)
* Use v4.7.2, this version contains a bug which causes a crash (`ClassCastException`) in header/footer InApp templates.

### Version 4.6.6 (October 31, 2022)
* Fixes App Inbox bug where an Inbox message's video would not play when new Inbox messages were available
Expand Down
1 change: 1 addition & 0 deletions templates/CTPUSHTEMPLATESCHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Version 1.0.7 (December 5, 2022)
* UI bug fixes for Non-linear Product Catalogue template.
* Supports CleverTap Android SDK v4.7.2.

### Version 1.0.6 (November 1, 2022)
* Targets Android 13
Expand Down
2 changes: 1 addition & 1 deletion versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ version.androidx.work=2.7.1
version.com.android.installreferrer..installreferrer=2.2
version.com.android.tools.lint..lint-api=27.0.1
version.com.android.tools.lint..lint-checks=27.0.1
version.com.clevertap.android..clevertap-android-sdk=4.7.1
version.com.clevertap.android..clevertap-android-sdk=4.7.2
version.com.clevertap.android..clevertap-geofence-sdk=1.2.0
version.com.clevertap.android..clevertap-hms-sdk=1.3.2
version.com.clevertap.android..clevertap-xiaomi-sdk=1.5.2
Expand Down