Skip to content

Commit 34dd905

Browse files
committed
Add new push message parameters
1 parent 57d4161 commit 34dd905

38 files changed

+827
-953
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Appwrite PHP SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-php.svg?style=flat-square&v=1)
4-
![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square&v=1)
4+
![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square&v=1)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

docs/account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
469469
POST https://cloud.appwrite.io/v1/account/tokens/magic-url
470470
```
471471

472-
** Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.
472+
** Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.
473473

474474
A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
475475
**

docs/examples/databases/update-string-attribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ $result = $databases->updateStringAttribute(
1616
key: '',
1717
required: false,
1818
default: '<DEFAULT>',
19-
size: null, // optional
19+
size: 1, // optional
2020
newKey: '' // optional
2121
);

docs/examples/functions/create-deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
33
use Appwrite\Client;
4-
use Appwrite\Payload;
4+
use Appwrite\InputFile;
55
use Appwrite\Services\Functions;
66
77
$client = (new Client())
@@ -13,7 +13,7 @@ $functions = new Functions($client);
1313

1414
$result = $functions->createDeployment(
1515
functionId: '<FUNCTION_ID>',
16-
code: Payload::fromFile('file.png'),
16+
code: InputFile::withPath('file.png'),
1717
activate: false,
1818
entrypoint: '<ENTRYPOINT>', // optional
1919
commands: '<COMMANDS>' // optional

docs/examples/functions/create-execution.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
33
use Appwrite\Client;
4-
use Appwrite\Payload;
54
use Appwrite\Services\Functions;
65
76
$client = (new Client())
@@ -13,7 +12,7 @@ $functions = new Functions($client);
1312

1413
$result = $functions->createExecution(
1514
functionId: '<FUNCTION_ID>',
16-
body: Payload::fromJson([ 'x' => 'y' ]), // optional
15+
body: '<BODY>', // optional
1716
async: false, // optional
1817
path: '<PATH>', // optional
1918
method: ExecutionMethod::GET(), // optional

docs/examples/messaging/create-push.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ $messaging = new Messaging($client);
1212

1313
$result = $messaging->createPush(
1414
messageId: '<MESSAGE_ID>',
15-
title: '<TITLE>',
16-
body: '<BODY>',
15+
title: '<TITLE>', // optional
16+
body: '<BODY>', // optional
1717
topics: [], // optional
1818
users: [], // optional
1919
targets: [], // optional
@@ -24,7 +24,10 @@ $result = $messaging->createPush(
2424
sound: '<SOUND>', // optional
2525
color: '<COLOR>', // optional
2626
tag: '<TAG>', // optional
27-
badge: '<BADGE>', // optional
27+
badge: null, // optional
2828
draft: false, // optional
29-
scheduledAt: '' // optional
29+
scheduledAt: '', // optional
30+
contentAvailable: false, // optional
31+
critical: false, // optional
32+
priority: MessagePriority::NORMAL() // optional
3033
);

docs/examples/messaging/update-push.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ $result = $messaging->updatePush(
2626
tag: '<TAG>', // optional
2727
badge: null, // optional
2828
draft: false, // optional
29-
scheduledAt: '' // optional
29+
scheduledAt: '', // optional
30+
contentAvailable: false, // optional
31+
critical: false, // optional
32+
priority: MessagePriority::NORMAL() // optional
3033
);

docs/examples/storage/create-file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
33
use Appwrite\Client;
4-
use Appwrite\Payload;
4+
use Appwrite\InputFile;
55
use Appwrite\Services\Storage;
66
77
$client = (new Client())
@@ -14,6 +14,6 @@ $storage = new Storage($client);
1414
$result = $storage->createFile(
1515
bucketId: '<BUCKET_ID>',
1616
fileId: '<FILE_ID>',
17-
file: Payload::fromFile('file.png'),
17+
file: InputFile::withPath('file.png'),
1818
permissions: ["read("any")"] // optional
1919
);

docs/functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ POST https://cloud.appwrite.io/v1/functions
4848
| templateOwner | string | The name of the owner of the template. | |
4949
| templateRootDirectory | string | Path to function code in the template repo. | |
5050
| templateVersion | string | Version (tag) for the repo linked to the function template. | |
51-
| specification | string | Runtime specification for the function and builds. | s-0.5vcpu-512mb |
51+
| specification | string | Runtime specification for the function and builds. | s-1vcpu-512mb |
5252

5353
## List runtimes
5454

@@ -110,7 +110,7 @@ PUT https://cloud.appwrite.io/v1/functions/{functionId}
110110
| providerBranch | string | Production branch for the repo linked to the function | |
111111
| providerSilentMode | boolean | Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests. | |
112112
| providerRootDirectory | string | Path to function code in the linked repo. | |
113-
| specification | string | Runtime specification for the function and builds. | s-0.5vcpu-512mb |
113+
| specification | string | Runtime specification for the function and builds. | s-1vcpu-512mb |
114114

115115
## Delete function
116116

@@ -280,7 +280,7 @@ POST https://cloud.appwrite.io/v1/functions/{functionId}/executions
280280
| Field Name | Type | Description | Default |
281281
| --- | --- | --- | --- |
282282
| functionId | string | **Required** Function ID. | |
283-
| body | payload | HTTP body of execution. Default value is empty string. | |
283+
| body | string | HTTP body of execution. Default value is empty string. | |
284284
| async | boolean | Execute code in the background. Default value is false. | |
285285
| path | string | HTTP path of execution. Path can include query params. Default value is / | / |
286286
| method | string | HTTP method of execution. Default value is GET. | POST |

docs/messaging.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,19 @@ POST https://cloud.appwrite.io/v1/messaging/messages/push
8484
| topics | array | List of Topic IDs. | [] |
8585
| users | array | List of User IDs. | [] |
8686
| targets | array | List of Targets IDs. | [] |
87-
| data | object | Additional Data for push notification. | {} |
87+
| data | object | Additional key-value pair data for push notification. | {} |
8888
| action | string | Action for push notification. | |
8989
| image | string | Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>. | |
9090
| icon | string | Icon for push notification. Available only for Android and Web Platform. | |
91-
| sound | string | Sound for push notification. Available only for Android and IOS Platform. | |
91+
| sound | string | Sound for push notification. Available only for Android and iOS Platform. | |
9292
| color | string | Color for push notification. Available only for Android Platform. | |
9393
| tag | string | Tag for push notification. Available only for Android Platform. | |
94-
| badge | string | Badge for push notification. Available only for IOS Platform. | |
94+
| badge | integer | Badge for push notification. Available only for iOS Platform. | -1 |
9595
| draft | boolean | Is message a draft | |
9696
| scheduledAt | string | Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. | |
97+
| contentAvailable | boolean | If set to true, the notification will be delivered in the background. Available only for iOS Platform. | |
98+
| critical | boolean | If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. | |
99+
| priority | string | Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification. | high |
97100

98101
## Update push notification
99102

@@ -124,6 +127,9 @@ PATCH https://cloud.appwrite.io/v1/messaging/messages/push/{messageId}
124127
| badge | integer | Badge for push notification. Available only for iOS platforms. | |
125128
| draft | boolean | Is message a draft | |
126129
| scheduledAt | string | Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future. | |
130+
| contentAvailable | boolean | If set to true, the notification will be delivered in the background. Available only for iOS Platform. | |
131+
| critical | boolean | If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform. | |
132+
| priority | string | Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification. | |
127133

128134
## Create SMS
129135

0 commit comments

Comments
 (0)