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

task(SDK-4057) - Revamped Timer Notification Template #682

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions clevertap-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<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"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING"/>

<application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.Scope;
import androidx.annotation.WorkerThread;
import androidx.core.app.NotificationCompat;

import com.clevertap.android.sdk.cryption.CryptHandler;
import com.clevertap.android.sdk.displayunits.DisplayUnitListener;
import com.clevertap.android.sdk.displayunits.model.CleverTapDisplayUnit;
Expand Down Expand Up @@ -3241,6 +3243,28 @@ public void renderPushNotificationOnCallerThread(@NonNull INotificationRenderer

}

@RestrictTo(Scope.LIBRARY_GROUP)
public NotificationCompat.Builder getPushNotificationOnCallerThread(@NonNull INotificationRenderer iNotificationRenderer, Context context,
Bundle extras) {
CleverTapInstanceConfig config = coreState.getConfig();
try {
synchronized (coreState.getPushProviders().getPushRenderingLock()) {
config.getLogger().verbose(config.getAccountId(),
"returning push on caller thread with id = " + Thread.currentThread().getId());
coreState.getPushProviders().setPushNotificationRenderer(iNotificationRenderer);
if (extras != null && extras.containsKey(Constants.PT_NOTIF_ID)) {
return coreState.getPushProviders()._getNotification(context, extras,
extras.getInt(Constants.PT_NOTIF_ID));
} else {
return coreState.getPushProviders()._getNotification(context, extras, Constants.EMPTY_NOTIFICATION_ID);
}
}
} catch (Throwable t) {
config.getLogger().debug(config.getAccountId(), "Failed to process getPushNotification()", t);
return null;
}
}

/**
* Retrieves a notification bitmap with a specified timeout and size constraint.
*
Expand Down

Large diffs are not rendered by default.

This file was deleted.

Loading
Loading