Skip to content

Commit 77c77b1

Browse files
authored
Merge pull request #129 from appwrite/dev
feat: Android SDK update for version 25.1.0
2 parents 3fd4f34 + aebe93d commit 77c77b1

17 files changed

Lines changed: 305 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Change Log
22

3+
## 25.1.0
4+
5+
* Added: Email metadata fields to `User` (`emailCanonical`, `emailIsFree`, `emailIsDisposable`, `emailIsCorporate`, `emailIsCanonical`).
6+
* Added: `Membership.userAccessedAt` field.
7+
* Updated: Requests now send an explicit `accept` header matching each endpoint's response type.
8+
39
## 25.0.0
410

511
* Breaking: `avatars.getScreenshot` `theme` parameter now uses the `BrowserTheme` enum
612
* Breaking: Removed generic type parameters from `presences` service methods
7-
* Added: `BrowserTheme` enum
13+
* Replaced: `BrowserTheme` enum
814
* Updated: `Presence` model is now concrete and adds a `metadata` field
915

1016
## 24.1.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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:25.0.0")
41+
implementation("io.appwrite:sdk-for-android:25.1.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>25.0.0</version>
52+
<version>25.1.0</version>
5353
</dependency>
5454
</dependencies>
5555
```

docs/examples/java/account/update-password.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Account account = new Account(client);
1111

1212
account.updatePassword(
1313
"", // password
14-
"password", // oldPassword (optional)
14+
"<OLD_PASSWORD>", // oldPassword (optional)
1515
new CoroutineCallback<>((result, error) -> {
1616
if (error != null) {
1717
error.printStackTrace();

docs/examples/kotlin/account/update-password.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ val account = Account(client)
1111

1212
val result = account.updatePassword(
1313
password = "",
14-
oldPassword = "password", // (optional)
14+
oldPassword = "<OLD_PASSWORD>", // (optional)
1515
)
1616
```

library/src/main/java/io/appwrite/Client.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class Client @JvmOverloads constructor(
9494
"x-sdk-name" to "Android",
9595
"x-sdk-platform" to "client",
9696
"x-sdk-language" to "android",
97-
"x-sdk-version" to "25.0.0",
97+
"x-sdk-version" to "25.1.0",
9898
"x-appwrite-response-format" to "1.9.5"
9999
)
100100
config = mutableMapOf()
@@ -113,7 +113,6 @@ class Client @JvmOverloads constructor(
113113
*/
114114
fun setProject(value: String): Client {
115115
config["project"] = value
116-
addHeader("x-appwrite-project", value)
117116
return this
118117
}
119118

@@ -366,7 +365,10 @@ class Client @JvmOverloads constructor(
366365
suspend fun ping(): String {
367366
val apiPath = "/ping"
368367
val apiParams = mutableMapOf<String, Any?>()
369-
val apiHeaders = mutableMapOf("content-type" to "application/json")
368+
val apiHeaders = mutableMapOf(
369+
"content-type" to "application/json",
370+
"X-Appwrite-Project" to config["project"].orEmpty(),
371+
)
370372

371373
return call(
372374
"GET",

library/src/main/java/io/appwrite/models/Membership.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ data class Membership(
8585
@SerializedName("mfa")
8686
val mfa: Boolean,
8787

88+
/**
89+
* Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console.
90+
*/
91+
@SerializedName("userAccessedAt")
92+
val userAccessedAt: String,
93+
8894
/**
8995
* User list of roles
9096
*/
@@ -106,6 +112,7 @@ data class Membership(
106112
"joined" to joined as Any,
107113
"confirm" to confirm as Any,
108114
"mfa" to mfa as Any,
115+
"userAccessedAt" to userAccessedAt as Any,
109116
"roles" to roles as Any,
110117
)
111118

@@ -128,6 +135,7 @@ data class Membership(
128135
joined = map["joined"] as String,
129136
confirm = map["confirm"] as Boolean,
130137
mfa = map["mfa"] as Boolean,
138+
userAccessedAt = map["userAccessedAt"] as String,
131139
roles = map["roles"] as List<String>,
132140
)
133141
}

library/src/main/java/io/appwrite/models/User.kt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,36 @@ data class User<T>(
9191
@SerializedName("emailVerification")
9292
val emailVerification: Boolean,
9393

94+
/**
95+
* Canonical form of the user email address.
96+
*/
97+
@SerializedName("emailCanonical")
98+
var emailCanonical: String?,
99+
100+
/**
101+
* Whether the user email is from a free email provider.
102+
*/
103+
@SerializedName("emailIsFree")
104+
var emailIsFree: Boolean?,
105+
106+
/**
107+
* Whether the user email is from a disposable email provider.
108+
*/
109+
@SerializedName("emailIsDisposable")
110+
var emailIsDisposable: Boolean?,
111+
112+
/**
113+
* Whether the user email is from a corporate domain.
114+
*/
115+
@SerializedName("emailIsCorporate")
116+
var emailIsCorporate: Boolean?,
117+
118+
/**
119+
* Whether the user email is in its canonical form.
120+
*/
121+
@SerializedName("emailIsCanonical")
122+
var emailIsCanonical: Boolean?,
123+
94124
/**
95125
* Phone verification status.
96126
*/
@@ -149,6 +179,11 @@ data class User<T>(
149179
"email" to email as Any,
150180
"phone" to phone as Any,
151181
"emailVerification" to emailVerification as Any,
182+
"emailCanonical" to emailCanonical as Any,
183+
"emailIsFree" to emailIsFree as Any,
184+
"emailIsDisposable" to emailIsDisposable as Any,
185+
"emailIsCorporate" to emailIsCorporate as Any,
186+
"emailIsCanonical" to emailIsCanonical as Any,
152187
"phoneVerification" to phoneVerification as Any,
153188
"mfa" to mfa as Any,
154189
"prefs" to prefs.toMap() as Any,
@@ -174,6 +209,11 @@ data class User<T>(
174209
email: String,
175210
phone: String,
176211
emailVerification: Boolean,
212+
emailCanonical: String?,
213+
emailIsFree: Boolean?,
214+
emailIsDisposable: Boolean?,
215+
emailIsCorporate: Boolean?,
216+
emailIsCanonical: Boolean?,
177217
phoneVerification: Boolean,
178218
mfa: Boolean,
179219
prefs: Preferences<Map<String, Any>>,
@@ -196,6 +236,11 @@ data class User<T>(
196236
email,
197237
phone,
198238
emailVerification,
239+
emailCanonical,
240+
emailIsFree,
241+
emailIsDisposable,
242+
emailIsCorporate,
243+
emailIsCanonical,
199244
phoneVerification,
200245
mfa,
201246
prefs,
@@ -224,6 +269,11 @@ data class User<T>(
224269
email = map["email"] as String,
225270
phone = map["phone"] as String,
226271
emailVerification = map["emailVerification"] as Boolean,
272+
emailCanonical = map["emailCanonical"] as? String,
273+
emailIsFree = map["emailIsFree"] as? Boolean,
274+
emailIsDisposable = map["emailIsDisposable"] as? Boolean,
275+
emailIsCorporate = map["emailIsCorporate"] as? Boolean,
276+
emailIsCanonical = map["emailIsCanonical"] as? Boolean,
227277
phoneVerification = map["phoneVerification"] as Boolean,
228278
mfa = map["mfa"] as Boolean,
229279
prefs = Preferences.from(map = map["prefs"] as Map<String, Any>, nestedType),

0 commit comments

Comments
 (0)