Skip to content

Commit 7c4c939

Browse files
authored
Merge pull request #49 from appwrite/dev
Dev
2 parents c5974e0 + 354ebb7 commit 7c4c939

File tree

256 files changed

+3861
-1281
lines changed

Some content is hidden

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

256 files changed

+3861
-1281
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ jobs:
1212
steps:
1313
- name: Check out code
1414
uses: actions/checkout@v2
15-
- name: Set up JDK 11
15+
- name: Set up JDK 17
1616
uses: actions/setup-java@v1
1717
with:
18-
java-version: 11
19-
# Base64 decodes and pipes the GPG key content into the secret file
18+
java-version: 17
2019
- name: Prepare environment
2120
env:
2221
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
@@ -37,7 +36,7 @@ jobs:
3736
# Runs upload, and then closes & releases the repository
3837
- name: Publish Release Version to MavenCentral
3938
run: |
40-
if ${{ endswith(github.event.release.tag_name, '-SNAPSHOT') }}; then
39+
if ${{ contains(github.event.release.tag_name, '-rc') }}; then
4140
echo "Publising Snapshot Version ${{ github.event.release.tag_name}} to Snapshot repository"
4241
./gradlew publishToSonatype
4342
else

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
1+
Copyright (c) 2024 Appwrite (https://appwrite.io) and individual contributors.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.4.12-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.5.0-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
99

10-
**This SDK is compatible with Appwrite server version 1.4.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**
10+
**This SDK is compatible with Appwrite server version 1.5.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**
1111

1212
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Android SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1313

14-
![Appwrite](https://appwrite.io/images/github.png)
14+
![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)
1515

1616
## Installation
1717

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

4040
```groovy
41-
implementation("io.appwrite:sdk-for-android:4.0.1")
41+
implementation("io.appwrite:sdk-for-android:5.0.0")
4242
```
4343

4444
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
4949
<dependency>
5050
<groupId>io.appwrite</groupId>
5151
<artifactId>sdk-for-android</artifactId>
52-
<version>4.0.1</version>
52+
<version>5.0.0</version>
5353
</dependency>
5454
</dependencies>
5555
```
@@ -109,8 +109,9 @@ When trying to connect to Appwrite from an emulator or a mobile device, localhos
109109
val account = Account(client)
110110
val response = account.create(
111111
ID.unique(),
112-
113-
"password"
112+
113+
"password",
114+
"Walter O'Brien"
114115
)
115116
```
116117

@@ -129,8 +130,9 @@ val client = Client(context)
129130
val account = Account(client)
130131
val user = account.create(
131132
ID.unique(),
132-
133-
"password"
133+
134+
"password",
135+
"Walter O'Brien"
134136
)
135137
```
136138

@@ -139,7 +141,7 @@ The Appwrite Android SDK raises an `AppwriteException` object with `message`, `c
139141

140142
```kotlin
141143
try {
142-
var user = account.create(ID.unique(), "[email protected]", "password")
144+
var user = account.create(ID.unique(),"[email protected]","password","Walter O'Brien")
143145
Log.d("Appwrite user", user.toMap())
144146
} catch(e : AppwriteException) {
145147
e.printStackTrace()
@@ -153,6 +155,7 @@ You can use the following resources to learn more and get help
153155
- 💬 [Discord Community](https://appwrite.io/discord)
154156
- 🚂 [Appwrite Android Playground](https://github.com/appwrite/playground-for-android)
155157

158+
156159
## Contribution
157160

158161
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.

build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@ apply plugin: 'io.github.gradle-nexus.publish-plugin'
22

33
// Top-level build file where you can add configuration options common to all sub-projects/modules.
44
buildscript {
5-
ext.kotlin_version = "1.8.0"
5+
ext.kotlin_version = "1.9.10"
6+
67
version System.getenv("SDK_VERSION")
8+
79
repositories {
810
maven { url "https://plugins.gradle.org/m2/" }
911
google()
1012
mavenCentral()
1113
}
1214
dependencies {
13-
classpath "com.android.tools.build:gradle:4.2.2"
15+
classpath "com.android.tools.build:gradle:8.2.2"
1416
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15-
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
16-
17-
// NOTE: Do not place your application dependencies here; they belong
18-
// in the individual module build.gradle files
17+
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
1918
}
2019
}
2120

docs/examples/java/account/create-anonymous-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client(context)
99
Account account = new Account(client);
1010

1111
account.createAnonymousSession(new CoroutineCallback<>((result, error) -> {
12-
if (error != null)
12+
if (error != null) {
1313
error.printStackTrace();
1414
return;
1515
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2"); // Your project ID
8+
9+
Account account = new Account(client);
10+
11+
account.createEmailPasswordSession(
12+
"[email protected]", // email
13+
"password", // password
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
Log.d("Appwrite", result.toString());
21+
})
22+
);
23+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2"); // Your project ID
8+
9+
Account account = new Account(client);
10+
11+
account.createEmailToken(
12+
"<USER_ID>", // userId
13+
"[email protected]", // email
14+
false, // phrase (optional)
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
Log.d("Appwrite", result.toString());
22+
})
23+
);
24+

docs/examples/java/account/create-j-w-t.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client(context)
99
Account account = new Account(client);
1010

1111
account.createJWT(new CoroutineCallback<>((result, error) -> {
12-
if (error != null)
12+
if (error != null) {
1313
error.printStackTrace();
1414
return;
1515
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2"); // Your project ID
8+
9+
Account account = new Account(client);
10+
11+
account.createMagicURLToken(
12+
"<USER_ID>", // userId
13+
"[email protected]", // email
14+
"https://example.com", // url (optional)
15+
false, // phrase (optional)
16+
new CoroutineCallback<>((result, error) -> {
17+
if (error != null) {
18+
error.printStackTrace();
19+
return;
20+
}
21+
22+
Log.d("Appwrite", result.toString());
23+
})
24+
);
25+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Account;
4+
import io.appwrite.enums.AuthenticatorType;
5+
6+
Client client = new Client(context)
7+
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
8+
.setProject("5df5acd0d48c2"); // Your project ID
9+
10+
Account account = new Account(client);
11+
12+
account.createMfaAuthenticator(
13+
AuthenticatorType.TOTP, // type
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
Log.d("Appwrite", result.toString());
21+
})
22+
);
23+

0 commit comments

Comments
 (0)