Add bucketId and fileId to image data
This commit is contained in:
parent
050f93628a
commit
7d896c3155
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue