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

No Push Notification from Firebase on iOS #102

Open
Tommyten opened this issue Dec 19, 2024 · 8 comments
Open

No Push Notification from Firebase on iOS #102

Tommyten opened this issue Dec 19, 2024 · 8 comments

Comments

@Tommyten
Copy link

KMPNotifier and Kotlin version:
kmpnotifier version: 1.4.0
kotlin version: 2.1.0

Describe the bug
When I use this library to receive and handle Firebase Push Notifications, no System Push Notification is created on iOS

In which platform bug occurs?
iOS

To Reproduce
Steps to reproduce the bug:

  • Setup a Compose Multiplatform app as is described in the Readme, using Firebase
  • The NotificationPlatformConfiguration.Ios must have showPushNotification = true
  • When the app receives a Firebase Push Notification the KMPNotifier library logs Received Push Notification payload data
  • No Push Notification is created on iOS

Expected behavior
On Android, when a Firebase push notification is received a System push notification is also created, therefore I expect the same behavior on iOS as well

@mirzemehdi
Copy link
Owner

@Tommyten is it only data type notification?
Can you please check if you can send local notification? Maybe there is some issue related to capabilites or permission related thing on ios side?

val notifier = NotifierManager.getLocalNotifier()
notifier.notify {
  id= Random.nextInt(0, Int.MAX_VALUE)
  title = "Title from KMPNotifier"
  body = "Body message from KMPNotifier"
  payloadData = mapOf(
    Notifier.KEY_URL to "https://github.com/mirzemehdi/KMPNotifier/",
    "extraKey" to "randomValue"
  )

}

@Tommyten
Copy link
Author

Tommyten commented Jan 20, 2025

@mirzemehdi sending local notifications is indeed possible, so there should not be an issue with permissions.

@mirzemehdi
Copy link
Owner

@Tommyten are you enabled Remote Notifications capability in xcode? Also did you upload apn key into Firebase?

@Tommyten
Copy link
Author

@mirzemehdi Reuploading the apn key to firebase fixed it, thank you for your help :)

@Tommyten Tommyten reopened this Jan 21, 2025
@Tommyten
Copy link
Author

I'm sorry to have to reopen this issue, but unfortunately it seems that this issue still remains.
When I trigger a Firebase push notification, my NotificationListener is called, but a Push Notification is not always being shown.

@Tommyten
Copy link
Author

I have further confirmed that, indeed the connection between apns and firebase is not the issue here.
I do reliably get push notifications when the app is minimized/closed completely.
When the app is active, kmpnotifier reliably logs "Received Push Notification payload data" and my NotifierManager.Listener implementation is also called reliably. However I only rarely get a push notification displayed.

@ismoilfozil
Copy link

Hi @Tommyten , have you found any solution for this issue? I'm also facing a similar problem and would appreciate any insights. Thanks!

@Tommyten
Copy link
Author

Tommyten commented Feb 3, 2025

@ismoilfozil I haven't unfortunately. I transitioned to a custom solution to work around my issues.
When rolling my own solution I did, however have some issues that were caused by xCode 16.0. Maybe try updating if you still are using 16.0

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

No branches or pull requests

3 participants