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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ account.createIdTokenSession(
"<ID_TOKEN>", // idToken
"<NONCE>", // nonce (optional)
"<ACCESS_TOKEN>", // accessToken (optional)
0, // accessTokenExpiry (optional)
0L, // accessTokenExpiry (optional)
"<NAME>", // name (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion examples/2.3.x/client-android/java/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Client client = new Client(context)
Account account = new Account(client);

account.createJWT(
0, // duration (optional)
0L, // duration (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
18 changes: 11 additions & 7 deletions examples/2.3.x/client-android/java/account/delete-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ Client client = new Client(context)

Account account = new Account(client);

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

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

Log.d("Appwrite", result.toString());
}));
```
18 changes: 11 additions & 7 deletions examples/2.3.x/client-android/java/account/list-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ Client client = new Client(context)

Account account = new Account(client);

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

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

Log.d("Appwrite", result.toString());
}));
```
38 changes: 38 additions & 0 deletions examples/2.3.x/client-android/java/analytics/create-event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Analytics;

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

Analytics analytics = new Analytics(client);

analytics.createEvent(
"<PROPERTY_ID>", // propertyId
"<NAME>", // name
"https://example.com", // url
"<DOMAIN>", // domain (optional)
"<REFERRER>", // referrer (optional)
0L, // screenWidth (optional)
"<SESSION_HASH>", // sessionHash (optional)
0L, // scrollDepth (optional)
0L, // engagementTime (optional)
List.of(), // props (optional)
"<USER_ID>", // userId (optional)
"<IP>", // ip (optional)
"<USER_AGENT>", // userAgent (optional)
Comment on lines +25 to +27

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omit API-key-only overrides from client analytics examples

The specification says userId, ip, and userAgent overrides require API-key authentication with analytics.write, but this client only sets a project ID, so the sample request cannot succeed with these nonempty overrides. Please omit them from client examples (and session-authenticated server examples), rather than requiring a secret API key in a client app.

Prompt To Fix With AI
This is a comment left during a code review.
Path: examples/2.3.x/client-android/java/analytics/create-event.md
Line: 25-27

Comment:
**Omit API-key-only overrides from client analytics examples**

The specification says `userId`, `ip`, and `userAgent` overrides require API-key authentication with `analytics.write`, but this client only sets a project ID, so the sample request cannot succeed with these nonempty overrides. Please omit them from client examples (and session-authenticated server examples), rather than requiring a secret API key in a client app.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · documentation · Reply if this doesn't apply.

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

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

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.createInstallationToken(
"<APP_ID>", // appId
"<INSTALLATION_ID>", // installationId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
26 changes: 26 additions & 0 deletions examples/2.3.x/client-android/java/apps/create-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.createKey(
"<APP_ID>", // appId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
26 changes: 26 additions & 0 deletions examples/2.3.x/client-android/java/apps/create-secret.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.createSecret(
"<APP_ID>", // appId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
44 changes: 44 additions & 0 deletions examples/2.3.x/client-android/java/apps/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.create(
"<APP_ID>", // appId
"<NAME>", // name
List.of(), // redirectUris
"<DESCRIPTION>", // description (optional)
"https://example.com", // clientUri (optional)
"https://example.com", // logoUri (optional)
"https://example.com", // privacyPolicyUrl (optional)
"https://example.com", // termsUrl (optional)
List.of(), // contacts (optional)
"<TAGLINE>", // tagline (optional)
List.of(), // tags (optional)
List.of(), // images (optional)
"https://example.com", // supportUrl (optional)
"https://example.com", // dataDeletionUrl (optional)
List.of(), // postLogoutRedirectUris (optional)
false, // enabled (optional)
"public", // type (optional)
false, // deviceFlow (optional)
"<TEAM_ID>", // teamId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
27 changes: 27 additions & 0 deletions examples/2.3.x/client-android/java/apps/delete-installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.deleteInstallation(
"<APP_ID>", // appId
"<INSTALLATION_ID>", // installationId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
27 changes: 27 additions & 0 deletions examples/2.3.x/client-android/java/apps/delete-key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.deleteKey(
"<APP_ID>", // appId
"<KEY_ID>", // keyId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
27 changes: 27 additions & 0 deletions examples/2.3.x/client-android/java/apps/delete-secret.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.deleteSecret(
"<APP_ID>", // appId
"<SECRET_ID>", // secretId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
26 changes: 26 additions & 0 deletions examples/2.3.x/client-android/java/apps/delete-tokens.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.deleteTokens(
"<APP_ID>", // appId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
26 changes: 26 additions & 0 deletions examples/2.3.x/client-android/java/apps/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```java
import android.util.Log;

import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Apps;

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

Apps apps = new Apps(client);

apps.delete(
"<APP_ID>", // appId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

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

```
Loading
Loading