Skip to main content
Answered

Intercom SDK for Android, API 33 and NOTIFICATION permission


For an Android app that targets API 33 and that includes FCM for push notifications, what is the advice on requesting the NOTIFICATION permission?

My usecase: We have a tab in our app that when pressed, calls Intercom.client().present(). While the user is viewing the HelpCenter, the user could start a customer support chat. This is an ideal moment to request the NOTIFICATION permission. The user just sent a chat message and likely expects a notification when there is a reply.

Is there a way for our app to know when the user sent a message so we can request the permission? Or does the intercom SDK request the notification permission on behalf of the app if needed?

Versions:

  • Intercom Android SDK v15.1.3
  • App targetSDK 33
  • Firebase BOM 30.0.0 (Firebase Messaging 23.0.4)

Best answer by Racheal

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!

View original
Did this topic help you find an answer to your question?

3 replies

  • Author
  • New Participant
  • 4 replies
  • August 31, 2023

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?


Racheal
Intercom Team
Forum|alt.badge.img+5
  • Customer Support Engineer
  • 512 replies
  • Answer
  • September 1, 2023

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!


  • Author
  • New Participant
  • 4 replies
  • September 1, 2023

@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?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings