Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Push notification permission is always granted on Android #61

Open
eexit opened this issue Mar 20, 2023 · 5 comments
Open

Push notification permission is always granted on Android #61

eexit opened this issue Mar 20, 2023 · 5 comments

Comments

@eexit
Copy link

eexit commented Mar 20, 2023

Hello,

Firstly, thank you for your plugin. Very useful.

However, I would like to report something broken. I'm not React Native expert but according to Intercom documentation, some carousels can trigger for device permission. Which is great and offload all the permission request logic to the Intercom code.

For the push notification permission, I noticed that the carousel is always considering that the permission is granted on Android.

Steps to reproduce:

  1. Create an Intercom carousel with "Push notification" for the Button Action
  2. Set it live and copy its ID
  3. In the App, do an Intercom login and trigger a await Intercom.presentContent(IntercomContent.carouselWithCarouselId(copiedCarouselId));
  4. The carousel launches as expected
  5. The "Button Action" is filled with a tick icon instead of displaying 2 buttons (meaning the permission is already granted)

Doc: https://www.intercom.com/help/en/articles/4164612-design-and-build-a-mobile-carousel#things-to-note-about-requesting-device-permissions

Tested with:

  • @intercom/intercom-react-native@^4.0.1
  • config-plugin-react-native-intercom@main
  • expo@~48.0.6
  • Android 9 & 13

After some digging, the issue seems to be related to the MainNotificationService being injected to the Android source code. I believe this service is required to receive notifications but I suspect the call to IntercomModule.sendTokenToIntercom(getApplication(), refreshedToken) to register the device Intercom and flag the device has "granted for push notifications" while it's not the case.

Is there any chance we could sort this out so we could leverale this Intercom feature?

Thanks!

@eexit eexit changed the title Push notification permission is always granted Push notification permission is always granted on Android Mar 20, 2023
@eexit
Copy link
Author

eexit commented Mar 27, 2023

Hello, any idea for this issue?

Thanks!

@enagorny
Copy link
Collaborator

@eexit are you seeing the same behaviour for Android 9 and Android 13? If I remember correctly on Android 9 push notification permission is granted on app installation. While on Android 13 it is similar to iOS permissions model when it should be requested.

@elmaxe
Copy link
Contributor

elmaxe commented Mar 27, 2023

Correct, android permissions changed in Android 13

@eexit
Copy link
Author

eexit commented Mar 27, 2023

Hello,

This is not about the device permission, this is about Intercom knowing about that permission. For Android 13, the device permission is not granted by default but yet the Intercom Carousel, somehow, thinks it is.

On Android < 13, if you deny explicitly the permission, then launch the carousel, it will still show the permission as granted while it should not.

This behavior works as expected on iOS.

I'm not sure if this is the way this plugin is implemented or if this is the way Intercom interpret the “permission granting”.

Thanks for your input!

@eexit
Copy link
Author

eexit commented Apr 6, 2023

Hello,

Has anyone confirmed this behavior?

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants