node-apn / node-apn

:calling: Apple Push Notification module for Node.js
MIT License
4.37k stars 681 forks source link

How to send Communication Notifications? #716

Open bayramn opened 1 year ago

bayramn commented 1 year ago

Is it possible to send Communication Notifications that shows users avatar image like in iOS 16 push notifications.

Or is it implemented in react native?

Brahmah commented 1 year ago

Hi @bayramn

Communication notifications are to be implemented client-side. One must create an iOS UNNotificationServiceExtension that can leverage additional payload sent via node-apn to construct an on-device INSendMessageIntent which will need to be donated to the system. This incoming communication intent will fail to work if the server apns payload isn't content mutable; instead, serviceExtensionTimeWillExpire will be called in your UNNotificationServiceExtension delegate.

The delegate is responsible for altering the notification and downloading/generating it's profile image.

bayramn commented 1 year ago

Hi @Brahmah, thanks for responding.

Yeah realized that after posting here, I found Notifee package that does Communication Notifications.

d-warfield commented 1 year ago

Can you post an example of the implementation? Would be much appreciated 😀

Brahmah commented 1 year ago

@d-warfield Native or React?

d-warfield commented 1 year ago

@bayramn using react native client side and node js backend!