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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## 31.0.0

* Breaking: every service method declares `@Throws(AppwriteException::class)`; Java callers must catch `AppwriteException`
* Added: `account.listMemberships` to list the current user's team memberships
* Added: `createQuery` on `Databases`, `DocumentsDB` and `TablesDB` to send list queries in the request body
* Added: `bundleId` and `environment` params on `account.createPushTarget` and `updatePushTarget`
* Added: `@JvmStatic` on `ID`, `Permission`, `Role`, `Query`, `Operator`, `Channel` and `InputFile` helpers for Java
* Fixed: `row.data` keeps null-valued columns instead of dropping them
* Updated: Java examples catch `AppwriteException` and import `List` and `Map`

## 30.0.0

* Breaking: requests send `x-appwrite-response-format: 2.5.0`; responses follow the 2.5 shapes
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Kotlin DSL (`build.gradle.kts`):

```kotlin
dependencies {
implementation("io.appwrite:sdk-for-android:30.0.0")
implementation("io.appwrite:sdk-for-android:31.0.0")
}
```

Groovy (`build.gradle`):

```groovy
dependencies {
implementation 'io.appwrite:sdk-for-android:30.0.0'
implementation 'io.appwrite:sdk-for-android:31.0.0'
}
```

Expand Down
21 changes: 14 additions & 7 deletions docs/examples/java/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.exceptions.AppwriteException;
import io.appwrite.services.Account;

Client client = new Client(context)
Expand All @@ -11,12 +12,18 @@ Client client = new Client(context)

Account account = new Account(client);

account.createAnonymousSession(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
try {
account.createAnonymousSession(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
}));
Log.d("Appwrite", result.toString());
})
);
} catch (AppwriteException e) {
e.printStackTrace();
}
```
30 changes: 17 additions & 13 deletions docs/examples/java/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.exceptions.AppwriteException;
import io.appwrite.services.Account;

Client client = new Client(context)
Expand All @@ -11,18 +12,21 @@ Client client = new Client(context)

Account account = new Account(client);

account.createEmailPasswordSession(
"email@example.com", // email
"password", // password
60L, // duration (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
try {
account.createEmailPasswordSession(
"email@example.com", // email
"password", // password
60L, // duration (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
} catch (AppwriteException e) {
e.printStackTrace();
}
```
30 changes: 17 additions & 13 deletions docs/examples/java/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.exceptions.AppwriteException;
import io.appwrite.services.Account;

Client client = new Client(context)
Expand All @@ -11,18 +12,21 @@ Client client = new Client(context)

Account account = new Account(client);

account.createEmailToken(
"<USER_ID>", // userId
"email@example.com", // email
false, // phrase (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
try {
account.createEmailToken(
"<USER_ID>", // userId
"email@example.com", // email
false, // phrase (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
} catch (AppwriteException e) {
e.printStackTrace();
}
```
26 changes: 15 additions & 11 deletions docs/examples/java/account/create-email-verification-otp.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.exceptions.AppwriteException;
import io.appwrite.services.Account;

Client client = new Client(context)
Expand All @@ -11,16 +12,19 @@ Client client = new Client(context)

Account account = new Account(client);

account.createEmailVerificationOTP(
false, // phrase (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
try {
account.createEmailVerificationOTP(
false, // phrase (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
} catch (AppwriteException e) {
e.printStackTrace();
}
```
26 changes: 15 additions & 11 deletions docs/examples/java/account/create-email-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.exceptions.AppwriteException;
import io.appwrite.services.Account;

Client client = new Client(context)
Expand All @@ -11,16 +12,19 @@ Client client = new Client(context)

Account account = new Account(client);

account.createEmailVerification(
"https://example.com", // url
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
try {
account.createEmailVerification(
"https://example.com", // url
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
} catch (AppwriteException e) {
e.printStackTrace();
}
```
36 changes: 20 additions & 16 deletions docs/examples/java/account/create-id-token-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.exceptions.AppwriteException;
import io.appwrite.services.Account;
import io.appwrite.enums.IdTokenProvider;

Expand All @@ -12,21 +13,24 @@ Client client = new Client(context)

Account account = new Account(client);

account.createIdTokenSession(
IdTokenProvider.APPLE, // provider
"<ID_TOKEN>", // idToken
"<NONCE>", // nonce (optional)
"<ACCESS_TOKEN>", // accessToken (optional)
0L, // accessTokenExpiry (optional)
"<NAME>", // name (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
try {
account.createIdTokenSession(
IdTokenProvider.APPLE, // provider
"<ID_TOKEN>", // idToken
"<NONCE>", // nonce (optional)
"<ACCESS_TOKEN>", // accessToken (optional)
0L, // accessTokenExpiry (optional)
"<NAME>", // name (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
} catch (AppwriteException e) {
e.printStackTrace();
}
```
26 changes: 15 additions & 11 deletions docs/examples/java/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.exceptions.AppwriteException;
import io.appwrite.services.Account;

Client client = new Client(context)
Expand All @@ -11,16 +12,19 @@ Client client = new Client(context)

Account account = new Account(client);

account.createJWT(
0L, // duration (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
try {
account.createJWT(
0L, // duration (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
} catch (AppwriteException e) {
e.printStackTrace();
}
```
32 changes: 18 additions & 14 deletions docs/examples/java/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.exceptions.AppwriteException;
import io.appwrite.services.Account;

Client client = new Client(context)
Expand All @@ -11,19 +12,22 @@ Client client = new Client(context)

Account account = new Account(client);

account.createMagicURLToken(
"<USER_ID>", // userId
"email@example.com", // email
"https://example.com", // url (optional)
false, // phrase (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
try {
account.createMagicURLToken(
"<USER_ID>", // userId
"email@example.com", // email
"https://example.com", // url (optional)
false, // phrase (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

Log.d("Appwrite", result.toString());
})
);
} catch (AppwriteException e) {
e.printStackTrace();
}
```
Loading