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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,19 +139,21 @@ The following checklist aims to balance consistency among languages, and follow
139
139
-[ ] Default Headers
140
140
-[ ] 'appwrite-sdk-version' header
141
141
-[ ] Add 'User-Agent' header with device/server name and version + platform name and version (ubuntu-20.04-php-7.0.1 / android-20.0-flutter-3.0)
142
+
-[ ] Add 'origin' header with the following syntax `<scheme>://<identifier>` where scheme is one of `http`, `https`, `appwrite-android`, `appwrite-ios`, `appwrite-macos`, `appwrite-windows`, `appwrite-linux` and identifier is the host name is case of web apps and the package name in case of ios, android and other platforms.
-[ ] Handle errors and throw `AppwriteException` with proper information
149
152
-[ ] Service Abstraction (optional)
150
153
-[ ] Constructor receiving an instance of the client class
151
154
-[ ] Service Class (extends the service abstraction if exists)
152
155
-[ ] Headers Support (Content Type)
153
156
-[ ] Parameters Support
154
-
-[ ] Default Values Support
155
157
-[ ] Required Values Support
156
158
-[ ] String Support
157
159
-[ ] Integer Support
@@ -183,6 +185,8 @@ After you finish initializing, make a series of HTTP calls using your new genera
183
185
1. tests/languages/tests-for-php.js
184
186
2. tests/languages/tests-for-node.js
185
187
188
+
> Note: In your test files, make sure that you begin the test with the following string "\nTest Started\n". We use this string to filter output from the build tool you're using.
189
+
186
190
Once done, add a Docker command that can execute your test file to the SDK test algorithm `$containers` array in this location: `./tests/SDKTest.php:17`. Make sure to add one command for each language version you wish to support.
187
191
188
192
A good example is the PHP test for 5 different PHP versions:
@@ -200,5 +204,5 @@ protected $containers = [
200
204
201
205
Finally, you can run the tests using
202
206
```sh
203
-
docker run --rm -v $(pwd):/app:rw -w /app -v /var/run/docker.sock:/var/run/docker.sock php:7.4-cli-alpine sh -c "apk add docker-cli && vendor/bin/phpunit tests/SDKTest.php"
207
+
docker run --rm -v $(pwd):$(pwd):rw -w $(pwd) -v /var/run/docker.sock:/var/run/docker.sock php:7.4-cli-alpine sh -c "apk add docker-cli && vendor/bin/phpunit tests/SDKTest.php"
// $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1'); // Enable only with Appwrite local server running on port 80
40
39
// $spec = getSSLPage('https://appwrite.io/v1/open-api-2.json?extensions=1&platform=console'); // Enable only with Appwrite local server running on port 80
->setDescription('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')
->setWarning('**This SDK is compatible with Appwrite server version 0.7.x. For older versions, please check previous releases.**')
438
-
->setGettingStarted("
439
-
### Add your Android Platform
440
-
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.
441
-
442
-
From the options, choose to add a new **Flutter** platform and add your app credentials, ignoring iOS.
443
-
444
-
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.
445
-
446
-
### OAuth
447
-
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.
<p>Initialize your SDK code with your project ID, which can be found in your project settings page.
467
-
468
-
```kotlin
469
-
import io.appwrite.Client
470
-
import io.appwrite.services.Account
471
-
472
-
val client = Client(context)
473
-
.setEndpoint(\"https://[HOSTNAME_OR_IP]/v1\") // Your API Endpoint
474
-
.setProject(\"5df5acd0d48c2\") // Your project ID
475
-
.setSelfSigned(true) // Remove in production
476
-
```
477
-
478
-
Before starting to send any API calls to your new Appwrite instance, make sure your Android emulators has network access to the Appwrite server hostname or IP address.
479
-
480
-
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.
481
-
482
-
### Make Your First Request
483
-
484
-
<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.
0 commit comments