Problem/Motivation

Users should be able to send URLs, including web URLs and app deep links (internal links).

Issue fork apns_php-3600681

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Claude Opus 4.8 analysis:

Context

 An audit of the apns_php module (/dev/apns_php) found a Medium issue:
 ApnsPhpMessagingApi::createPayload() accepts a $url argument but never writes
 it to the push payload — line 133 is just // @todo Figure out how to pass the URL.. Every caller of
 sendMessageSingleDevice() / sendMessageMultipleDevices()
 that supplies $notification_url has the value silently dropped, and no test
 covers the parameter.

 Findings from exploration:
 - Pushok's Payload (vendor/edamov/pushok/src/Payload.php) has no native URL
 field. Custom data is attached with setCustomValue($key, $value), which
 places $key at the payload root (sibling of aps). The Capacitor
 PushNotifications plugin surfaces root keys to the app as
 notification.data.<key>.
 - There is no Apple-mandated key for "tap opens this URL" in a native app
 (aps.url-args is Safari web-push only). The key name is a contract we define.
 De-facto common choices: url (default here), link (Firebase/FCM), deeplink
 (in-app routes).

 Decision

 Write the URL into the payload via setCustomValue(), using a configurable key
 name that defaults to url. The key is exposed on the module config form so the
 site can match whatever the app reads (e.g. link for FCM parity, deeplink for
 in-app routes). Also add a URL field to the admin test-message form so it can be
 exercised manually.

  • ptmkenny committed fdefb81f on 1.0.x
    feat: #3600681 Add support for URLs in notifications
    
    By: ptmkenny
    
ptmkenny’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.