Does anyone have any idea about this? Intercom SDK does not seem to request the POST_NOTIFICATIONS permission. We would like to request it but only when it is really needed. How are other folks dealing with this?
Hey @Kiran Rao Racheal from the support engineer team here
Have you had a chance to look through our Android SDK Push Notifications Dev Doc? The details provided in the SDK ReadMe on Github are quite useful as well - it mentions (here) that "Apps targeting Android 13 should request a runtime permission to enable notifications. Add the following code to request permission."
registerForActivityResult(
ActivityResultContracts.RequestPermission()
) {
if (isGranted) {
// Permission is granted. Continue the action or workflow in your
// app.
} else {
// Explain to the user that the feature is unavailable because the
// features requires a permission that the user has denied. At the
// same time, respect the user's decision. Don't link to system
// settings in an effort to convince the user to change their
// decision. }
}
Let me know if this helps!
@Racheal Ah I missed that in the README. I was following this guide which does not mention the POST_NOTIFICATIONS permission. That answers the first part of my question.
How about the app being notified by the Intercom SDK when the user sends a chat message? Our usecase for the POST_NOTIFICATIONS pemission is to notify the user when there is a reply to their chat message. We would like to delay asking for this permission until the user actually sends a chat. In other words, we want to avoid asking for this permission the first time the user launches the Help Center.
Is there a way to achieve this?