-
Notifications
You must be signed in to change notification settings - Fork 74
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
base: develop
Are you sure you want to change the base?
Changes from 21 commits
bd10279
3424ab9
de2d3eb
c5cae07
1dc7c41
91d462e
5e2b8ac
7eecabc
84aa6b6
3a18744
7a9d8ea
65974f5
06e8970
3741aaf
2e91fb8
721143e
a4e6d27
2e0ff59
0ce9afe
7660295
6d8f170
fd878bf
d8bda66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -3379,6 +3381,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()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. avoid locking if there is only one push provider available? |
||
config.getLogger().verbose(config.getAccountId(), | ||
"returning push on caller thread with id = " + Thread.currentThread().getId()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe print if its main thread. |
||
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. | ||
* | ||
|
Large diffs are not rendered by default.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to ask clients to put this permission as it might have some compliances on playstore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @CTLalit - this should be mentioned in the docs and needs to be optional. All the code related to FGS should be with a permission check with all cases handled properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Most SDK's are using these permissions and they are not as critical as like an AlarmManager, it was merged by default in the final manifest
Moving it to the app to be safe