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
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions examples/1.9.x/client-android/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 examples/1.9.x/client-android/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 examples/1.9.x/client-android/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 examples/1.9.x/client-android/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 examples/1.9.x/client-android/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());
})
);

```
15 changes: 15 additions & 0 deletions examples/1.9.x/client-android/kotlin/presences/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```kotlin
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Presences

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

val presences = Presences(client)

val result = presences.delete(
presenceId = "<PRESENCE_ID>",
)
```
15 changes: 15 additions & 0 deletions examples/1.9.x/client-android/kotlin/presences/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```kotlin
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Presences

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

val presences = Presences(client)

val result = presences.get(
presenceId = "<PRESENCE_ID>",
)
```
17 changes: 17 additions & 0 deletions examples/1.9.x/client-android/kotlin/presences/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```kotlin
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Presences

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

val presences = Presences(client)

val result = presences.list(
queries = listOf(), // (optional)
total = false, // (optional)
ttl = 0, // (optional)
)
```
22 changes: 22 additions & 0 deletions examples/1.9.x/client-android/kotlin/presences/update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```kotlin
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Presences
import io.appwrite.Permission
import io.appwrite.Role

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

val presences = Presences(client)

val result = presences.update(
presenceId = "<PRESENCE_ID>",
status = "<STATUS>", // (optional)
expiresAt = "2020-10-15T06:38:00.000+00:00", // (optional)
metadata = mapOf( "a" to "b" ), // (optional)
permissions = listOf(Permission.read(Role.any())), // (optional)
purge = false, // (optional)
)
```
21 changes: 21 additions & 0 deletions examples/1.9.x/client-android/kotlin/presences/upsert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```kotlin
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Presences
import io.appwrite.Permission
import io.appwrite.Role

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

val presences = Presences(client)

val result = presences.upsert(
presenceId = "<PRESENCE_ID>",
status = "<STATUS>",
permissions = listOf(Permission.read(Role.any())), // (optional)
expiresAt = "2020-10-15T06:38:00.000+00:00", // (optional)
metadata = mapOf( "a" to "b" ), // (optional)
)
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let bytes = try await avatars.getScreenshot(
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // optional
fullpage: true, // optional
locale: "en-US", // optional
timezone: .americaNewYork, // optional
timezone: .africaAbidjan, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
Expand Down
14 changes: 14 additions & 0 deletions examples/1.9.x/client-apple/examples/presences/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```swift
import Appwrite

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

let presences = Presences(client)

let result = try await presences.delete(
presenceId: "<PRESENCE_ID>"
)

```
14 changes: 14 additions & 0 deletions examples/1.9.x/client-apple/examples/presences/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```swift
import Appwrite

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

let presences = Presences(client)

let presence = try await presences.get(
presenceId: "<PRESENCE_ID>"
)

```
16 changes: 16 additions & 0 deletions examples/1.9.x/client-apple/examples/presences/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```swift
import Appwrite

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

let presences = Presences(client)

let presenceList = try await presences.list(
queries: [], // optional
total: false, // optional
ttl: 0 // optional
)

```
19 changes: 19 additions & 0 deletions examples/1.9.x/client-apple/examples/presences/update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```swift
import Appwrite

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

let presences = Presences(client)

let presence = try await presences.update(
presenceId: "<PRESENCE_ID>",
status: "<STATUS>", // optional
expiresAt: "2020-10-15T06:38:00.000+00:00", // optional
metadata: [:], // optional
permissions: [Permission.read(Role.any())], // optional
purge: false // optional
)

```
18 changes: 18 additions & 0 deletions examples/1.9.x/client-apple/examples/presences/upsert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```swift
import Appwrite

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

let presences = Presences(client)

let presence = try await presences.upsert(
presenceId: "<PRESENCE_ID>",
status: "<STATUS>",
permissions: [Permission.read(Role.any())], // optional
expiresAt: "2020-10-15T06:38:00.000+00:00", // optional
metadata: [:] // optional
)

```
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Uint8List bytes = await avatars.getScreenshot(
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
timezone: enums.Timezone.americaNewYork, // optional
timezone: enums.Timezone.africaAbidjan, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
Expand Down Expand Up @@ -53,7 +53,7 @@ FutureBuilder(
userAgent:'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15' , // optional
fullpage:true , // optional
locale:'en-US' , // optional
timezone: enums.Timezone.americaNewYork, // optional
timezone: enums.Timezone.africaAbidjan, // optional
latitude:37.7749 , // optional
longitude:-122.4194 , // optional
accuracy:100 , // optional
Expand Down
13 changes: 13 additions & 0 deletions examples/1.9.x/client-flutter/examples/presences/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```dart
import 'package:appwrite/appwrite.dart';

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

Presences presences = Presences(client);

await presences.delete(
presenceId: '<PRESENCE_ID>',
);
```
13 changes: 13 additions & 0 deletions examples/1.9.x/client-flutter/examples/presences/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```dart
import 'package:appwrite/appwrite.dart';

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

Presences presences = Presences(client);

Presence result = await presences.get(
presenceId: '<PRESENCE_ID>',
);
```
15 changes: 15 additions & 0 deletions examples/1.9.x/client-flutter/examples/presences/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```dart
import 'package:appwrite/appwrite.dart';

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

Presences presences = Presences(client);

PresenceList result = await presences.list(
queries: [], // optional
total: false, // optional
ttl: 0, // optional
);
```
Loading