Skip to content

Commit 1d006fc

Browse files
committed
Move from dev to stable
1 parent 7cd1650 commit 1d006fc

File tree

3 files changed

+119
-4
lines changed

3 files changed

+119
-4
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 117 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?v=1)
55
![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?v=1)
66

7-
**This SDK is compatible with Appwrite server version 0.7.0. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
7+
**This SDK is compatible with Appwrite server version 0.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
88

99
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.
1010
Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
@@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file:
2020

2121
```yml
2222
dependencies:
23-
appwrite: ^0.4.0-dev.3
23+
appwrite: ^0.4.0
2424
```
2525
2626
You can install packages from the command line:
@@ -30,6 +30,121 @@ pub get appwrite
3030
```
3131

3232

33+
## Getting Started
34+
35+
### Add your Flutter Platform
36+
To init your SDK and start interacting with Appwrite services, you need to add a new Flutter platform to your project. To add a new platform, go to your Appwrite console, choose the project you created in the step before, and click the 'Add Platform' button.
37+
38+
From the options, choose to add a new **Flutter** platform and add your app credentials. Appwrite Flutter SDK currently supports building apps for both iOS and Android.
39+
40+
If you are building your Flutter application for multiple devices, you have to follow this process for each different device.
41+
42+
#### iOS
43+
For **iOS** 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.
44+
45+
#### Android
46+
For **Android** add your app <u>name</u> and <u>package name</u>, Your package name is generally the applicationId in your app-level build.gradle file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API.
47+
48+
### iOS
49+
50+
The Appwrite SDK uses ASWebAuthenticationSession on iOS 12+ and SFAuthenticationSession on iOS 11 to allow OAuth authentication. You have to change your iOS Deployment Target in Xcode to be iOS >= 11 to be able to build your app on an emulator or a real device.
51+
52+
1. In Xcode, open Runner.xcworkspace in your app's ios folder.
53+
2. To view your app's settings, select the Runner project in the Xcode project navigator. Then, in the main view sidebar, select the Runner target.
54+
3. Select the General tab.
55+
4. In Deployment Info, 'Target' select iOS 11.0
56+
57+
### Android
58+
In order to capture the Appwrite OAuth callback url, the following activity needs to be added to your [AndroidManifest.xml](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/src/main/AndroidManifest.xml). Be sure to relpace the **[PROJECT_ID]** string with your actual Appwrite project ID. You can find your Appwrite project ID in you project settings screen in your Appwrite console.
59+
60+
```xml
61+
<manifest>
62+
<application>
63+
<activity android:name="com.linusu.flutter_web_auth.CallbackActivity" >
64+
<intent-filter android:label="flutter_web_auth">
65+
<action android:name="android.intent.action.VIEW" />
66+
<category android:name="android.intent.category.DEFAULT" />
67+
<category android:name="android.intent.category.BROWSABLE" />
68+
<data android:scheme="appwrite-callback-[PROJECT_ID]" />
69+
</intent-filter>
70+
</activity>
71+
</application>
72+
</manifest>
73+
```
74+
75+
### Web
76+
Appwrite 0.7, and the Appwrite Flutter SDK 0.3.0 have added support for Flutter Web. To build web apps that integrate with Appwrite successfully, all you have to do is add a web platform on your Appwrite project's dashboard and list the domain your website will use to allow communication to the Appwrite API.
77+
78+
#### Flutter Web Cross-Domain Communication & Cookies
79+
While running Flutter Web, make sure your Appwrite server and your Flutter client are using the same top-level domain and the same protocol (HTTP or HTTPS) to communicate. When trying to communicate between different domains or protocols, you may receive HTTP status error 401 because some modern browsers block cross-site or insecure cookies for enhanced privacy. In production, Appwrite allows you set multiple [custom-domains](https://appwrite.io/docs/custom-domains) for each project.
80+
81+
### Init your SDK
82+
83+
<p>Initialize your SDK code with your project ID, which can be found in your project settings page.
84+
85+
```dart
86+
import 'package:appwrite/appwrite.dart';
87+
Client client = Client();
88+
89+
90+
client
91+
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
92+
.setProject('5e8cf4f46b5e8') // Your project ID
93+
.setSelfSigned() // Remove in production
94+
;
95+
```
96+
97+
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.
98+
99+
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.
100+
101+
### Make Your First Request
102+
103+
<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 section.
104+
105+
```dart
106+
// Register User
107+
Account account = Account(client);
108+
Response user = await account
109+
.create(
110+
email: 'me@appwrite.io',
111+
password: 'password',
112+
name: 'My Name'
113+
);
114+
```
115+
116+
### Full Example
117+
118+
```dart
119+
import 'package:appwrite/appwrite.dart';
120+
Client client = Client();
121+
122+
123+
client
124+
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
125+
.setProject('5e8cf4f46b5e8') // Your project ID
126+
.setSelfSigned() // Remove in production
127+
;
128+
129+
130+
// Register User
131+
Account account = Account(client);
132+
133+
Response user = await account
134+
.create(
135+
email: 'me@appwrite.io',
136+
password: 'password',
137+
name: 'My Name'
138+
);
139+
```
140+
141+
### Learn more
142+
You can use followng resources to learn more and get help
143+
- πŸš€ [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
144+
- πŸ“œ [Appwrite Docs](https://appwrite.io/docs)
145+
- πŸ’¬ [Discord Community](https://appwrite.io/discord)
146+
- πŸš‚ [Appwrite Flutter Playground](https://github.com/appwrite/playground-for-flutter)
147+
33148
## Contribution
34149

35150
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.

β€Žlib/client.dartβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Client {
2525

2626
this.headers = {
2727
'content-type': 'application/json',
28-
'x-sdk-version': 'appwrite:flutter:0.4.0-dev.3',
28+
'x-sdk-version': 'appwrite:flutter:0.4.0',
2929
};
3030

3131
this.config = {};

β€Žpubspec.yamlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: appwrite
2-
version: 0.4.0-dev.3
2+
version: 0.4.0
33
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
44
homepage: https://appwrite.io
55
repository: https://github.com/appwrite/sdk-for-flutter

0 commit comments

Comments
Β (0)