Skip to content

Commit

Permalink
Apns: Set activity ID for live activities
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev committed Feb 10, 2025
1 parent aea0c28 commit 5e3fce2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"require": {
"psr/log": ">=1.1",
"m2mobi/apns-php": "~4.0.0rc1",
"m2mobi/apns-php": "~4.0.0rc2",
"phpmailer/phpmailer": "~6.4",
"rmccue/requests": "~2.0",
"php": ">=8.1",
Expand Down
2 changes: 1 addition & 1 deletion decomposer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"ApnsPHP": {
"url": "https://github.com/move-backend/apnsphp.git",
"version": "4.0.0rc1",
"version": "4.0.0rc2",
"psr0": {
"path": "/"
}
Expand Down
5 changes: 5 additions & 0 deletions src/Lunr/Vortex/APNS/ApnsPHP/APNSDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ private function build_live_activity_for_payload(APNSLiveActivityPayload $payloa

/** @var LiveActivity $message */
$payload = $payload->get_payload();
if (isset($payload['thread_id']))
{
$message->setActivityId($payload['thread_id']);
}

if (isset($payload['event']))
{
$message->setEvent($payload['event']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public function testBuildLiveActivityForPayloadConstructsCorrectPayload(): void
$message->setTitle($payload['title']);
$message->setText($payload['body']);
$message->setThreadId($payload['thread_id']);
$message->setActivityId($payload['thread_id']);
$message->setSound($payload['sound']);
$message->setCategory($payload['category']);
$message->setMutableContent($payload['mutable_content']);
Expand Down

0 comments on commit 5e3fce2

Please sign in to comment.