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

Unable to send notifications with URI on Android devices #52

Closed
HoucemK opened this issue Jul 20, 2024 · 1 comment · Fixed by #60 or #62
Closed

Unable to send notifications with URI on Android devices #52

HoucemK opened this issue Jul 20, 2024 · 1 comment · Fixed by #60 or #62

Comments

@HoucemK
Copy link

HoucemK commented Jul 20, 2024

Hi,

It's possible to find a way to send an URI in notification for Android Devices, I am facing an issue when trying to send notifications that contain an URI for Android devices. The URI is supposed to be read using Intent.data, but it doesn't seem to work as expected.

@mirzemehdi
Copy link
Owner

@HoucemK This is implemented in 1.2.1 version of kmpnotifier.

In order to setData for Intent on Android Devices, you just need to put URI value with "URL" key into payloadData (after converting URI toString). If payload data contains value with "URL" key then intent data will be set internally.

Example code:

//Notifier.KEY_URL value is set as "URL" in the library. If payload data contains that key, then its value will be set as intent data.

notifier.notify(
    title = "Title", 
    body = "bodyMessage", 
    payloadData = mapOf(
        Notifier.KEY_URL to "https://github.com/mirzemehdi/KMPNotifier/",
        "extraKey" to "randomValue"
    )
)

For more details, please check PR #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants