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

Arguing for adding support for content-available in alert notifications #214

Closed
Frizlab opened this issue Nov 13, 2024 · 2 comments
Closed

Comments

@Frizlab
Copy link

Frizlab commented Nov 13, 2024

Is your feature request related to a problem? Please describe.
Yes.
My goal is to write a conversation solution (among other).
When I was in another company, when we sent a push for a new message, we used to use a content-available push, to be called in didReceiveRemoteNotification in the iOS app.
I’d like to do the same, but APNSwift does not allow alert notifications w/ content-available.

Describe the solution you'd like
Add a contentAvailable argument to APNSAlertNotification.

Describe alternatives you've considered

  • Send a silent notification in addition to the alert notification. This has the advantage of making it possible to coalesce the potential background updates. This would have to be in conjonction with the other alternative considered:
  • Use the user notification delegate and willPresent. This works only when the app is in the foreground. The app won’t be launched if it is not in memory anymore, nor even if it is in the background.

Additional context
I understand Apple seems to not want the content-available key to be used alongside an alert, but really, it works… (I have tested.)

What do you think?

@kylebrowning
Copy link
Member

kylebrowning commented Nov 13, 2024

Its been suggested already #209

I would think its safer to not support it as if something breaks with APple's side, people using this library will come here asking why.

That being said you can write a custom version of the Alert yourself in your own library and use it.

@Frizlab
Copy link
Author

Frizlab commented Nov 13, 2024

I understand. I might do that, or use an NSE (I wanted to avoid IPC; it's a pain!).

Anyways, thanks for your answer.

@Frizlab Frizlab closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
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

2 participants