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

## 3.2.0

* Added: `Client.setEnvironment` to act in a project environment; realtime, avatar and storage URLs carry it
* Added: optional `interactive` param on `Analytics.createEvent` to mark an event as telemetry that does not end a bounce
* Added: `OAuthProvider.Vipps`
* Fixed: Android background push reconnects inside the system's network windows instead of minutes later
* Updated: requests send `X-Appwrite-Response-Format: 2.7.0`; the SDK targets Appwrite 2.7.x

## 3.1.1

* Fixed: `Push` on Android verifies the push server's TLS hostname before sending credentials
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Appwrite React Native SDK

![License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.6.2-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.7.0-blue.svg?style=flat-square)
[![X Account](https://img.shields.io/badge/follow-%40appwrite-000000?logo=x&style=flat-square)](https://x.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK targets Appwrite server version 2.6.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-react-native/releases) when APIs differ.
**This SDK targets Appwrite server version 2.7.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-react-native/releases) when APIs differ.

Appwrite is an open-source backend as a service server that abstracts and simplifies 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 React Native 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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,10 @@ internal object PushBackground {
return
}
var client = mqtt
if (client != null && (current != connectedConfig || networkChanged(context))) {
// A client that lost its connection retries on its own backoff, which keeps firing while
// Android blocks a backgrounded app's network (the host lookup then fails at once), so it
// misses the short windows the scheduled runs are given. A run is such a window: reconnect now.
if (client != null && (current != connectedConfig || networkChanged(context) || !isConnected)) {
disconnect()
client = null
}
Expand Down Expand Up @@ -1298,6 +1301,19 @@ internal object PushBackground {
}
}
}

// The app may use the network again (it came on screen, or a run's window opened):
// reconnect now rather than when the client's backoff next fires.
override fun onBlockedStatusChanged(network: Network, blocked: Boolean) {
if (blocked) {
return
}
worker.execute {
if (mqtt != null && !isConnected) {
converge(context, heartbeat = false)
}
}
}
}
try {
context.getSystemService(ConnectivityManager::class.java)?.registerDefaultNetworkCallback(callback)
Expand Down
1 change: 1 addition & 0 deletions docs/examples/analytics/create-event.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const result = await analytics.createEvent({
userId: '<USER_ID>', // optional
ip: '<IP>', // optional
userAgent: '<USER_AGENT>', // optional
interactive: false, // optional
});

console.log(result);
Expand Down
Loading
Loading