Skip to content

Commit feef4c8

Browse files
Merge pull request #44 from appwrite/feat-push-params
Add new push message parameters
2 parents 9600602 + bc90200 commit feef4c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+356
-102
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.6.1-blue.svg?style=flat-square)
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)
88

@@ -39,7 +39,7 @@ repositories {
3939
Next, add the dependency to your project's `build.gradle(.kts)` file:
4040

4141
```groovy
42-
implementation("io.appwrite:sdk-for-kotlin:6.1.0")
42+
implementation("io.appwrite:sdk-for-kotlin:6.2.0")
4343
```
4444

4545
### Maven
@@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
5050
<dependency>
5151
<groupId>io.appwrite</groupId>
5252
<artifactId>sdk-for-kotlin</artifactId>
53-
<version>6.1.0</version>
53+
<version>6.2.0</version>
5454
</dependency>
5555
</dependencies>
5656
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ databases.updateStringAttribute(
1515
"", // key
1616
false, // required
1717
"<DEFAULT>", // default
18-
0, // size (optional)
18+
1, // size (optional)
1919
"", // newKey (optional)
2020
new CoroutineCallback<>((result, error) -> {
2121
if (error != null) {

docs/examples/java/messaging/create-push.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Messaging messaging = new Messaging(client);
1111

1212
messaging.createPush(
1313
"<MESSAGE_ID>", // messageId
14-
"<TITLE>", // title
15-
"<BODY>", // body
14+
"<TITLE>", // title (optional)
15+
"<BODY>", // body (optional)
1616
listOf(), // topics (optional)
1717
listOf(), // users (optional)
1818
listOf(), // targets (optional)
@@ -23,9 +23,12 @@ messaging.createPush(
2323
"<SOUND>", // sound (optional)
2424
"<COLOR>", // color (optional)
2525
"<TAG>", // tag (optional)
26-
"<BADGE>", // badge (optional)
26+
0, // badge (optional)
2727
false, // draft (optional)
2828
"", // scheduledAt (optional)
29+
false, // contentAvailable (optional)
30+
false, // critical (optional)
31+
MessagePriority.NORMAL, // priority (optional)
2932
new CoroutineCallback<>((result, error) -> {
3033
if (error != null) {
3134
error.printStackTrace();

docs/examples/java/messaging/update-push.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ messaging.updatePush(
2626
0, // badge (optional)
2727
false, // draft (optional)
2828
"", // scheduledAt (optional)
29+
false, // contentAvailable (optional)
30+
false, // critical (optional)
31+
MessagePriority.NORMAL, // priority (optional)
2932
new CoroutineCallback<>((result, error) -> {
3033
if (error != null) {
3134
error.printStackTrace();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ val response = databases.updateStringAttribute(
1515
key = "",
1616
required = false,
1717
default = "<DEFAULT>",
18-
size = 0, // optional
18+
size = 1, // optional
1919
newKey = "" // optional
2020
)

docs/examples/kotlin/messaging/create-push.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ val messaging = Messaging(client)
1111

1212
val response = messaging.createPush(
1313
messageId = "<MESSAGE_ID>",
14-
title = "<TITLE>",
15-
body = "<BODY>",
14+
title = "<TITLE>", // optional
15+
body = "<BODY>", // optional
1616
topics = listOf(), // optional
1717
users = listOf(), // optional
1818
targets = listOf(), // optional
@@ -23,7 +23,10 @@ val response = messaging.createPush(
2323
sound = "<SOUND>", // optional
2424
color = "<COLOR>", // optional
2525
tag = "<TAG>", // optional
26-
badge = "<BADGE>", // optional
26+
badge = 0, // optional
2727
draft = false, // optional
28-
scheduledAt = "" // optional
28+
scheduledAt = "", // optional
29+
contentAvailable = false, // optional
30+
critical = false, // optional
31+
priority = "normal" // optional
2932
)

docs/examples/kotlin/messaging/update-push.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ val response = messaging.updatePush(
2525
tag = "<TAG>", // optional
2626
badge = 0, // optional
2727
draft = false, // optional
28-
scheduledAt = "" // optional
28+
scheduledAt = "", // optional
29+
contentAvailable = false, // optional
30+
critical = false, // optional
31+
priority = "normal" // optional
2932
)

src/main/kotlin/io/appwrite/Client.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ class Client @JvmOverloads constructor(
5757
init {
5858
headers = mutableMapOf(
5959
"content-type" to "application/json",
60-
"user-agent" to "AppwriteKotlinSDK/6.1.0 ${System.getProperty("http.agent")}",
60+
"user-agent" to "AppwriteKotlinSDK/6.2.0 ${System.getProperty("http.agent")}",
6161
"x-sdk-name" to "Kotlin",
6262
"x-sdk-platform" to "server",
6363
"x-sdk-language" to "kotlin",
64-
"x-sdk-version" to "6.1.0",
64+
"x-sdk-version" to "6.2.0",
6565
"x-appwrite-response-format" to "1.6.0",
6666
)
6767

src/main/kotlin/io/appwrite/enums/ImageFormat.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ enum class ImageFormat(val value: String) {
1212
@SerializedName("png")
1313
PNG("png"),
1414
@SerializedName("webp")
15-
WEBP("webp");
15+
WEBP("webp"),
16+
@SerializedName("avif")
17+
AVIF("avif");
1618

1719
override fun toString() = value
1820
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package io.appwrite.enums
2+
3+
import com.google.gson.annotations.SerializedName
4+
5+
enum class MessagePriority(val value: String) {
6+
@SerializedName("normal")
7+
NORMAL("normal"),
8+
@SerializedName("high")
9+
HIGH("high");
10+
11+
override fun toString() = value
12+
}

0 commit comments

Comments
 (0)