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

Feature Request: Enable iOS Silent Push Notifications in Capacitor #2038

Open
1 of 3 tasks
bluepuma77 opened this issue Feb 22, 2024 · 10 comments
Open
1 of 3 tasks

Feature Request: Enable iOS Silent Push Notifications in Capacitor #2038

bluepuma77 opened this issue Feb 22, 2024 · 10 comments

Comments

@bluepuma77
Copy link

Description

Support iOS Silent Push Notifications to be able to trigger JavaScript functions within Capacitor

Platforms

  • iOS
  • Android
  • Web

Request or proposed solution

Support iOS Silent Push Notifications to be able to trigger JavaScript functions like a file download. Use cases are many, you may need to update content/files within the app, and it needs to be available next time the app is opened, even when no network is available, like on most flights.

Alternatives

The doc states to use native implementation, but this kind of defeats the purpose of Capacitor.

Additional Information

I'm hoping this can be easily implemented with a few lines of code as the regular push notifications are already working.

@jcesarmobile jcesarmobile transferred this issue from ionic-team/capacitor Feb 22, 2024
@ionitron-bot ionitron-bot bot removed the triage label Feb 22, 2024
@bluepuma77

This comment was marked as abuse.

@IT-MikeS IT-MikeS added type: feature request A new feature, enhancement, or improvement and removed platform: android platform: web labels Feb 23, 2024
@IT-MikeS IT-MikeS changed the title [Feature]: Enable iOS Silent Push Notifications in Capacitor Feature Request: Enable iOS Silent Push Notifications in Capacitor Feb 23, 2024
@aparajita
Copy link
Contributor

We have a simple plugin we have been using that implements this. I'll publish it to npm next week.

@bluepuma77
Copy link
Author

@aparajita That would be great! 🥳

@bluepuma77
Copy link
Author

What's the actual problem with @capacitor/push-notifications library, that it is not compatible with "iOS Silent Push Notifications"? Shouldn't it really just need very few lines of code to make it work? Happy to support testing.

@markemer Do you have any insights? It seems you were the last one working on this module.

@aparajita
Copy link
Contributor

@bluepuma77 yes it would require only a few lines of code, at least that has been our experience. Not sure why they didn't implement it.

@bluepuma77
Copy link
Author

@aparajita You offered to create a npm package. To make it easier for you, could you simply provide a template on Github?

@aparajita
Copy link
Contributor

Here's what we are using currently. Needs a little updating, but works: https://github.com/willsub/capacitor-ios-remote-notifications

@bluepuma77
Copy link
Author

Found two more related Github repos:

  1. capacitor-ios-background-push would not compile, opened an issue
  2. capacitor-plugin-silent-notifications finally seems to work, sending SilentNotification with apns2

@aparajita
Copy link
Contributor

@bluepuma77 I just released capacitor-ios-silent-notifications.

@Eraldo
Copy link

Eraldo commented May 10, 2024

@bluepuma77 I just released capacitor-ios-silent-notifications.

Thanks @aparajita. 🙏
PS: Would be nice to have this integrated into @capacitor/push-notifications. 😅
You did a nice job of showing how it's done. 👏

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

No branches or pull requests

5 participants