You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
10
+
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
11
11
12
12
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 Flutter 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)
13
13
@@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
21
21
22
22
```yml
23
23
dependencies:
24
-
appwrite: ^17.1.0
24
+
appwrite: ^18.0.0
25
25
```
26
26
27
27
You can install packages from the command line:
@@ -50,7 +50,7 @@ In order to capture the Appwrite OAuth callback url, the following activity need
50
50
....
51
51
<application ...>
52
52
....
53
-
<!-- Add this inside the <application> tag, along side the existing <activity> tags -->
53
+
<!-- Add this inside the <application> tag, alongside the existing <activity> tags -->
@@ -76,8 +76,8 @@ The Appwrite SDK uses ASWebAuthenticationSession on iOS 12+ and SFAuthentication
76
76
### Linux
77
77
For **Linux** add your app <u>name</u> and <u>package name</u>, Your package name is generally the **name** in your <ahref="https://github.com/appwrite/playground-for-flutter/blob/0fdbdff98384fff940ed0b1e08cf14cfe3a2be3e/pubspec.yaml#L1"target="_blank"rel="noopener">pubspec.yaml<a> file. If you cannot find the correct package name, run the application in linux, and make any request with proper exception handling, you should get the application ID needed to add in the received error message.
78
78
79
-
### Mac OS
80
-
For **Mac OS** add your app name and Bundle ID, You can find your Bundle Identifier in the General tab for your app's primary target in Xcode.
79
+
### macOS
80
+
For **macOS** add your app name and Bundle ID, You can find your Bundle Identifier in the General tab for your app's primary target in Xcode.
81
81
82
82
The Appwrite SDK uses ASWebAuthenticationSession on macOS 10.15+ to allow OAuth authentication. You have to change your macOS Deployment Target in Xcode to be macOS >= 10.15 to be able to build your app for macOS.
83
83
@@ -121,77 +121,53 @@ For **Windows** add your app <u>name</u> and <u>package name</u>, Your package n
121
121
122
122
### Init your SDK
123
123
124
-
<p>Initialize your SDK with your Appwrite server API endpoint and project ID, which can be found in your project settings page.
124
+
<p>Initialize your SDK with your project ID, which can be found in your project settings page.
125
125
126
126
```dart
127
-
import 'package:appwrite/appwrite.dart';
128
-
129
-
void main() {
130
-
Client client = Client();
131
-
132
-
client
133
-
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
134
-
.setProject('5e8cf4f46b5e8') // Your project ID
135
-
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
Before starting to send any API calls to your new Appwrite instance, make sure your Android or iOS emulators has network access to the Appwrite server hostname or IP address.
141
-
142
-
When trying to connect to Appwrite from an emulator or a mobile device, localhost is the hostname for the device or emulator and not your local Appwrite instance. You should replace localhost with your private IP as the Appwrite endpoint's hostname. You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API.
130
+
> If using a self-hosted instance, you will also need to set your Appwrite endpoint using the `setEndpoint` method. Before starting to send any API calls to your new Appwrite instance, make sure your Android or iOS emulators has network access to the Appwrite server hostname or IP address.
131
+
> When trying to connect to a local Appwrite instance from an emulator or a mobile device, localhost is the hostname for the device or emulator and not your machine. You should replace localhost with your machine's private IP as the Appwrite endpoint's hostname (e.g. 192.168.1.100). You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API.
143
132
144
133
### Make Your First Request
145
134
146
135
<p>Once your SDK object is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.
The Appwrite Flutter SDK raises `AppwriteException` object with `message`, `type`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
185
165
186
166
```dart
187
-
Account account = Account(client);
188
-
189
167
try {
190
-
final user = await account.create(userId: ID.unique(), email: "[email protected]", password: "password", name: "Walter O'Brien");
191
-
print(user.toMap());
168
+
User user = await account.create(...);
192
169
} on AppwriteException catch(e) {
193
-
//show message to user or do other operation based on error as required
0 commit comments