1
0
Fork 0
mirror of synced 2024-06-03 11:24:48 +12:00

Add bucketId and fileId to image data

This commit is contained in:
Jake Barnby 2024-03-07 18:40:45 +01:00
parent 050f93628a
commit 7d896c3155
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 11 additions and 3 deletions

View file

@ -2945,7 +2945,11 @@ App::post('/v1/messaging/messages/push')
throw new Exception(Exception::STORAGE_FILE_NOT_PUBLIC);
}
$image = "{$protocol}://{$host}/v1/storage/buckets/{$bucket->getId()}/files/{$file->getId()}/view?project={$project->getId()}";
$image = [
'bucketId' => $bucket->getId(),
'fileId' => $file->getId(),
'url' => "{$protocol}://{$host}/v1/storage/buckets/{$bucket->getId()}/files/{$file->getId()}/view?project={$project->getId()}",
];
}
$pushData = [];
@ -3770,7 +3774,11 @@ App::patch('/v1/messaging/messages/push/:messageId')
throw new Exception(Exception::STORAGE_FILE_NOT_PUBLIC);
}
$pushData['image'] = "{$protocol}://{$host}/v1/storage/buckets/{$bucket->getId()}/files/{$file->getId()}/view?project={$project->getId()}";
$pushData['image'] = [
'bucketId' => $bucket->getId(),
'fileId' => $file->getId(),
'url' => "{$protocol}://{$host}/v1/storage/buckets/{$bucket->getId()}/files/{$file->getId()}/view?project={$project->getId()}"
];
}
$message->setAttribute('data', $pushData);

View file

@ -627,7 +627,7 @@ class Messaging extends Action
$body = $message['data']['body'];
$data = $message['data']['data'] ?? null;
$action = $message['data']['action'] ?? null;
$image = $message['data']['image'] ?? null;
$image = $message['data']['image']['url'] ?? null;
$sound = $message['data']['sound'] ?? null;
$icon = $message['data']['icon'] ?? null;
$color = $message['data']['color'] ?? null;