Skip to content

Commit d2486f8

Browse files
Merge pull request #37 from appwrite/feat-push-params
Add new push message parameters
2 parents c78ec21 + 9667d04 commit d2486f8

25 files changed

+350
-101
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: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
4242
| email | string | User email. | |
4343
| password | string | User password. Must be at least 8 chars. | |
4444

45-
## List Identities
45+
## List identities
4646

4747
```http request
4848
GET https://cloud.appwrite.io/v1/account/identities
@@ -106,7 +106,7 @@ PATCH https://cloud.appwrite.io/v1/account/mfa
106106
| --- | --- | --- | --- |
107107
| mfa | boolean | Enable or disable MFA. | |
108108

109-
## Create Authenticator
109+
## Create authenticator
110110

111111
```http request
112112
POST https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
@@ -120,7 +120,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
120120
| --- | --- | --- | --- |
121121
| type | string | **Required** Type of authenticator. Must be `totp` | |
122122

123-
## Verify Authenticator
123+
## Verify authenticator
124124

125125
```http request
126126
PUT https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
@@ -135,7 +135,7 @@ PUT https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
135135
| type | string | **Required** Type of authenticator. | |
136136
| otp | string | Valid verification token. | |
137137

138-
## Delete Authenticator
138+
## Delete authenticator
139139

140140
```http request
141141
DELETE https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
@@ -149,7 +149,7 @@ DELETE https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}
149149
| --- | --- | --- | --- |
150150
| type | string | **Required** Type of authenticator. | |
151151

152-
## Create MFA Challenge
152+
## Create MFA challenge
153153

154154
```http request
155155
POST https://cloud.appwrite.io/v1/account/mfa/challenge
@@ -163,7 +163,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/challenge
163163
| --- | --- | --- | --- |
164164
| factor | string | Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`. | |
165165

166-
## Create MFA Challenge (confirmation)
166+
## Create MFA challenge (confirmation)
167167

168168
```http request
169169
PUT https://cloud.appwrite.io/v1/account/mfa/challenge
@@ -178,31 +178,31 @@ PUT https://cloud.appwrite.io/v1/account/mfa/challenge
178178
| challengeId | string | ID of the challenge. | |
179179
| otp | string | Valid verification token. | |
180180

181-
## List Factors
181+
## List factors
182182

183183
```http request
184184
GET https://cloud.appwrite.io/v1/account/mfa/factors
185185
```
186186

187187
** List the factors available on the account to be used as a MFA challange. **
188188

189-
## Get MFA Recovery Codes
189+
## Get MFA recovery codes
190190

191191
```http request
192192
GET https://cloud.appwrite.io/v1/account/mfa/recovery-codes
193193
```
194194

195195
** Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes. **
196196

197-
## Create MFA Recovery Codes
197+
## Create MFA recovery codes
198198

199199
```http request
200200
POST https://cloud.appwrite.io/v1/account/mfa/recovery-codes
201201
```
202202

203203
** Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. **
204204

205-
## Regenerate MFA Recovery Codes
205+
## Regenerate MFA recovery codes
206206

207207
```http request
208208
PATCH https://cloud.appwrite.io/v1/account/mfa/recovery-codes
@@ -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/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/functions.md

Lines changed: 2 additions & 2 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

docs/locale.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ GET https://cloud.appwrite.io/v1/locale
1010

1111
([IP Geolocation by DB-IP](https://db-ip.com)) **
1212

13-
## List Locale Codes
13+
## List locale codes
1414

1515
```http request
1616
GET https://cloud.appwrite.io/v1/locale/codes

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

docs/storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ PUT https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}
161161
| name | string | Name of the file | |
162162
| permissions | array | An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). | |
163163

164-
## Delete File
164+
## Delete file
165165

166166
```http request
167167
DELETE https://cloud.appwrite.io/v1/storage/buckets/{bucketId}/files/{fileId}

docs/teams.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ DELETE https://cloud.appwrite.io/v1/teams/{teamId}
8080
GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships
8181
```
8282

83-
** Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. **
83+
** Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. **
8484

8585
### Parameters
8686

@@ -123,7 +123,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
123123
GET https://cloud.appwrite.io/v1/teams/{teamId}/memberships/{membershipId}
124124
```
125125

126-
** Get a team member by the membership unique id. All team members have read access for this resource. **
126+
** Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. **
127127

128128
### Parameters
129129

0 commit comments

Comments
 (0)