Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: 17
- name: Prepare environment
env:
Expand Down
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# Change Log

## 24.1.0

* Added: Realtime `presences` channel and `RealtimePresence` types for presence subscriptions
* Added: `Advisor` and `Presences` services
* Added: `Insight`, `Presence`, and `Report` models with list variants
* Added: `fusionauth`, `keycloak`, and `kick` providers to `OAuthProvider` enum
* Updated: Migrated Gradle build files to Kotlin DSL (`build.gradle.kts`)
* Updated: `X-Appwrite-Response-Format` header to `1.9.5`

## 24.0.0

* Breaking: Added `unsubscribe()`, `update()`, and `close()` for Realtime subscription lifecycle.
* Added: Added `userPhone` to the `Membership` model.
* Updated: Updated `X-Appwrite-Response-Format` header to `1.9.2`.
* Breaking: Added `unsubscribe()`, `update()`, and `close()` to Realtime subscriptions
* Added: Added `userPhone` field to `Membership` model
* Updated: Updated `X-Appwrite-Response-Format` header to `1.9.2`

## 23.1.0

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green&style=flat-square)
![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.2-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.5-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
Expand Down Expand Up @@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:

```groovy
implementation("io.appwrite:sdk-for-android:24.0.0")
implementation("io.appwrite:sdk-for-android:24.1.0")
```

### Maven
Expand All @@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-android</artifactId>
<version>24.0.0</version>
<version>24.1.0</version>
</dependency>
</dependencies>
```
Expand Down
33 changes: 0 additions & 33 deletions build.gradle

This file was deleted.

43 changes: 43 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import java.util.Properties

plugins {
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("com.android.library") version "9.1.1" apply false
id("com.android.application") version "9.1.1" apply false
}

version = System.getenv("SDK_VERSION") ?: "0.0.0"

tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}

val signingKeyId: String = System.getenv("SIGNING_KEY_ID") ?: ""
val signingPassword: String = System.getenv("SIGNING_PASSWORD") ?: ""
val signingSecretKeyRingFile: String = System.getenv("SIGNING_SECRET_KEY_RING_FILE") ?: ""
val ossrhUsername: String = System.getenv("OSSRH_USERNAME") ?: ""
val ossrhPassword: String = System.getenv("OSSRH_PASSWORD") ?: ""
val sonatypeStagingProfileId: String = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: ""

val secretPropsFile = project.rootProject.file("local.properties")
val localProperties = Properties().apply {
if (secretPropsFile.exists()) {
secretPropsFile.inputStream().use { load(it) }
}
}

extra["signing.keyId"] = signingKeyId.ifEmpty { localProperties.getProperty("signing.keyId", "") }
extra["signing.password"] = signingPassword.ifEmpty { localProperties.getProperty("signing.password", "") }
extra["signing.secretKeyRingFile"] = signingSecretKeyRingFile.ifEmpty { localProperties.getProperty("signing.secretKeyRingFile", "") }

nexusPublishing {
repositories {
sonatype {
stagingProfileId.set(sonatypeStagingProfileId.ifEmpty { localProperties.getProperty("sonatypeStagingProfileId", "") })
username.set(ossrhUsername.ifEmpty { localProperties.getProperty("ossrhUsername", "") })
password.set(ossrhPassword.ifEmpty { localProperties.getProperty("ossrhPassword", "") })
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
25 changes: 25 additions & 0 deletions docs/examples/java/advisor/get-insight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Advisor;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Advisor advisor = new Advisor(client);

advisor.getInsight(
"<REPORT_ID>", // reportId
"<INSIGHT_ID>", // insightId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
24 changes: 24 additions & 0 deletions docs/examples/java/advisor/get-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Advisor;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Advisor advisor = new Advisor(client);

advisor.getReport(
"<REPORT_ID>", // reportId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
26 changes: 26 additions & 0 deletions docs/examples/java/advisor/list-insights.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Advisor;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Advisor advisor = new Advisor(client);

advisor.listInsights(
"<REPORT_ID>", // reportId
List.of(), // queries (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
25 changes: 25 additions & 0 deletions docs/examples/java/advisor/list-reports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Advisor;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Advisor advisor = new Advisor(client);

advisor.listReports(
List.of(), // queries (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
24 changes: 24 additions & 0 deletions docs/examples/java/presences/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Presences;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Presences presences = new Presences(client);

presences.delete(
"<PRESENCE_ID>", // presenceId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
24 changes: 24 additions & 0 deletions docs/examples/java/presences/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Presences;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Presences presences = new Presences(client);

presences.get(
"<PRESENCE_ID>", // presenceId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
26 changes: 26 additions & 0 deletions docs/examples/java/presences/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Presences;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Presences presences = new Presences(client);

presences.list(
List.of(), // queries (optional)
false, // total (optional)
0, // ttl (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
31 changes: 31 additions & 0 deletions docs/examples/java/presences/update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.Permission;
import io.appwrite.Role;
import io.appwrite.services.Presences;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Presences presences = new Presences(client);

presences.update(
"<PRESENCE_ID>", // presenceId
"<STATUS>", // status (optional)
"2020-10-15T06:38:00.000+00:00", // expiresAt (optional)
Map.of("a", "b"), // metadata (optional)
List.of(Permission.read(Role.any())), // permissions (optional)
false, // purge (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
30 changes: 30 additions & 0 deletions docs/examples/java/presences/upsert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
```java
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.Permission;
import io.appwrite.Role;
import io.appwrite.services.Presences;

Client client = new Client(context)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>"); // Your project ID

Presences presences = new Presences(client);

presences.upsert(
"<PRESENCE_ID>", // presenceId
"<STATUS>", // status
List.of(Permission.read(Role.any())), // permissions (optional)
"2020-10-15T06:38:00.000+00:00", // expiresAt (optional)
Map.of("a", "b"), // metadata (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);

```
Loading