From 98d7d13f1611fc76e9be2dd99814be4232641cab Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 11 Mar 2021 14:38:44 +0545 Subject: [PATCH 1/4] remove other files --- docs/sdks/dart/GETTING_STARTED.md | 30 ---------------- docs/sdks/deno/GETTING_STARTED.md | 59 ------------------------------- 2 files changed, 89 deletions(-) delete mode 100644 docs/sdks/dart/GETTING_STARTED.md delete mode 100644 docs/sdks/deno/GETTING_STARTED.md diff --git a/docs/sdks/dart/GETTING_STARTED.md b/docs/sdks/dart/GETTING_STARTED.md deleted file mode 100644 index 78d7c4972..000000000 --- a/docs/sdks/dart/GETTING_STARTED.md +++ /dev/null @@ -1,30 +0,0 @@ -## Getting Started - -### Initialize & Make API Request -Once you add the dependencies, its extremely easy to get started with the SDK; All you need to do is import the package in your code, set your Appwrite credentials, and start making API calls. Below is a simple example: - -```dart -import 'package:dart_appwrite/dart_appwrite.dart'; - -void main() async { - Client client = Client(); - .setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible - .setProject('5ff3379a01d25') // Your project ID - .setKey('cd868c7af8bdc893b4...93b7535db89') - - Users users = Users(client); - - try { - final response = await users.create(email: ‘email@example.com’,password: ‘password’, name: ‘name’); - print(response.data); - } on AppwriteException catch(e) { - print(e.message); - } -} -``` - -### Learn more -You can use followng resources to learn more and get help -- [Appwrite Docs](https://appwrite.io/docs) -- [Discord Community](https://appwrite.io/discord) -- [Appwrite Dart Playground](https://github.com/appwrite/playground-for-dart) \ No newline at end of file diff --git a/docs/sdks/deno/GETTING_STARTED.md b/docs/sdks/deno/GETTING_STARTED.md deleted file mode 100644 index d06f5ff58..000000000 --- a/docs/sdks/deno/GETTING_STARTED.md +++ /dev/null @@ -1,59 +0,0 @@ -## Getting Started - -### Init your SDK -Initialize your SDK code with your project ID which can be found in your project settings page and your new API secret Key from previous phase. - -```typescript -let client = new sdk.Client(); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -``` - -### Make your first request - -Once your SDK object is set, create any of the Appwrite service project objects 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. - -```typescript -let users = new sdk.Users(client); - -let promise = users.create('email@example.com', 'password'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); -``` - -### Full Example -```typescript -import * as sdk from "https://deno.land/x/appwrite/mod.ts"; - -let client = new sdk.Client(); -let users = new sdk.Users(client); - -client - .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint - .setProject('5df5acd0d48c2') // Your project ID - .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key -; - -let promise = users.create('email@example.com', 'password'); - -promise.then(function (response) { - console.log(response); -}, function (error) { - console.log(error); -}); -``` - -### Learn more -You can use followng resources to learn more and get help -- [Appwrite Docs](https://appwrite.io/docs) -- [Discord Community](https://appwrite.io/discord) -- [Appwrite Deno Playground](https://github.com/appwrite/playground-for-deno) \ No newline at end of file From 95ba49c1c0589cd3389764a7ea2c46fb2c8e60f3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Mar 2021 16:26:41 +0545 Subject: [PATCH 2/4] updates --- docs/sdks/flutter/GETTING_STARTED.md | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/sdks/flutter/GETTING_STARTED.md b/docs/sdks/flutter/GETTING_STARTED.md index c66ec5c09..40da71b35 100644 --- a/docs/sdks/flutter/GETTING_STARTED.md +++ b/docs/sdks/flutter/GETTING_STARTED.md @@ -1,7 +1,4 @@ -## Getting Started for Flutter - -### Create Your First Appwrite Project -Go to your new Appwrite console, and once inside, click the (plus) icon in the top navigation header or on the **'Create Project'** button on your console homepage. Choose a name for your project and click create to get started. +## Getting Started ### Add your Flutter Platform 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. @@ -10,11 +7,11 @@ From the options, choose to add a new **Flutter** platform and add your app cred If you are building your Flutter application for multiple devices, you have to follow this process for each different device. -### iOS +#### iOS 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. ### Android -For **Android** add your app name and package name, 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. +For **Android** add your app name and package name, 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. #### iOS @@ -44,16 +41,16 @@ In order to capture the Appwrite OAuth callback url, the following activity need ``` #### Web -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.

+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. ### Flutter Web Cross-Domain Communication & Cookies -

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 for each project.

+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. ### Init your SDK

Initialize your SDK code with your project ID, which can be found in your project settings page. -``` +```dart import 'package:appwrite/appwrite.dart'; Client client = Client(); @@ -65,13 +62,15 @@ client ; ``` -

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.

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 to proxy the Appwrite API.

+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. + +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 to proxy the Appwrite API. ### Make Your First Request

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. -``` +```dart // Register User Account account = Account(client); Response user = await account @@ -84,7 +83,7 @@ name: 'My Name' ### Full Example -``` +```dart import 'package:appwrite/appwrite.dart'; Client client = Client(); @@ -110,6 +109,7 @@ name: 'My Name' ### Learn more You can use followng resources to learn more and get help -- [Appwrite Docs](https://appwrite.io/docs) -- [Discord Community](https://appwrite.io/discord) -- [Appwrite Flutter Playground](https://github.com/appwrite/playground-for-flutter) \ No newline at end of file +- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter) +- 📜 [Appwrite Docs](https://appwrite.io/docs) +- 💬 [Discord Community](https://appwrite.io/discord) +- 🚂 [Appwrite Flutter Playground](https://github.com/appwrite/playground-for-flutter) \ No newline at end of file From b250364562c341aef868d83a6e3d18b7334d4fd2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 15 Mar 2021 16:29:13 +0545 Subject: [PATCH 3/4] updates to docs --- docs/sdks/flutter/GETTING_STARTED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sdks/flutter/GETTING_STARTED.md b/docs/sdks/flutter/GETTING_STARTED.md index 40da71b35..5320dba38 100644 --- a/docs/sdks/flutter/GETTING_STARTED.md +++ b/docs/sdks/flutter/GETTING_STARTED.md @@ -23,7 +23,7 @@ The Appwrite SDK uses ASWebAuthenticationSession on iOS 12+ and SFAuthentication 4. In Deployment Info, 'Target' select iOS 11.0 ### Android -In order to capture the Appwrite OAuth callback url, the following activity needs to be added to your 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. +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. ```xml @@ -64,7 +64,7 @@ client 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. -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 to proxy the Appwrite API. +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. ### Make Your First Request From 57a3978d7d1350745fc000054de4d7d69fbd45f1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Mar 2021 15:03:16 +0545 Subject: [PATCH 4/4] fix indentation and headings --- docs/sdks/flutter/GETTING_STARTED.md | 43 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/docs/sdks/flutter/GETTING_STARTED.md b/docs/sdks/flutter/GETTING_STARTED.md index 5320dba38..9dae492f7 100644 --- a/docs/sdks/flutter/GETTING_STARTED.md +++ b/docs/sdks/flutter/GETTING_STARTED.md @@ -10,10 +10,10 @@ If you are building your Flutter application for multiple devices, you have to f #### iOS 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. -### Android +#### Android For **Android** add your app name and package name, 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. -#### iOS +### iOS 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. @@ -40,10 +40,10 @@ In order to capture the Appwrite OAuth callback url, the following activity need ``` -#### Web +### Web 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. -### Flutter Web Cross-Domain Communication & Cookies +#### Flutter Web Cross-Domain Communication & Cookies 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. ### Init your SDK @@ -56,9 +56,9 @@ Client client = Client(); client -.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint -.setProject('5e8cf4f46b5e8') // Your project ID -.setSelfSigned() // Remove in production + .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint + .setProject('5e8cf4f46b5e8') // Your project ID + .setSelfSigned() // Remove in production ; ``` @@ -74,11 +74,11 @@ When trying to connect to Appwrite from an emulator or a mobile device, localhos // Register User Account account = Account(client); Response user = await account -.create( -email: 'me@appwrite.io', -password: 'password', -name: 'My Name' -); + .create( + email: 'me@appwrite.io', + password: 'password', + name: 'My Name' + ); ``` ### Full Example @@ -89,22 +89,21 @@ Client client = Client(); client -.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint -.setProject('5e8cf4f46b5e8') // Your project ID -.setSelfSigned() // Remove in production -; + .setEndpoint('https://localhost/v1') // Your Appwrite Endpoint + .setProject('5e8cf4f46b5e8') // Your project ID + .setSelfSigned() // Remove in production + ; // Register User Account account = Account(client); - Response user = await account -.create( -email: 'me@appwrite.io', -password: 'password', -name: 'My Name' -); + .create( + email: 'me@appwrite.io', + password: 'password', + name: 'My Name' + ); ``` ### Learn more