Merge branch '0.9.x' of https://github.com/appwrite/appwrite into feat-265-realtime
This commit is contained in:
commit
bba39596fd
|
@ -8,7 +8,10 @@
|
|||
- Renamed *Devices* to *Sessions*
|
||||
- Add Provider Icon to each Session
|
||||
- Add Anonymous Account Placeholder
|
||||
- Upgraded telegraf docker image version to v1.1.0
|
||||
- Upgraded telegraf docker image version to v1.2.0
|
||||
- Added new environment variables to the `telegraf` service:
|
||||
- _APP_INFLUXDB_HOST
|
||||
- _APP_INFLUXDB_PORT
|
||||
|
||||
## Bugs
|
||||
|
||||
|
|
|
@ -56,13 +56,13 @@
|
|||
|
||||
.main {
|
||||
background: {{bg-content}};
|
||||
border-radius: 3px;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
padding: 30px 30px 15px 30px;
|
||||
}
|
||||
|
||||
.content-block {
|
||||
|
@ -97,16 +97,15 @@
|
|||
|
||||
.btn table td {
|
||||
background-color: {{bg-content}};
|
||||
border-radius: 5px;
|
||||
border-radius: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn a {
|
||||
background-color: {{bg-content}};
|
||||
border: solid 1px {{bg-cta}};
|
||||
border-radius: 5px;
|
||||
border-radius: 20px;
|
||||
box-sizing: border-box;
|
||||
color: #3498db;
|
||||
color: #577590;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
|
@ -123,45 +122,17 @@
|
|||
|
||||
.btn-primary a {
|
||||
background-color: {{bg-cta}};
|
||||
border-color: {{bg-cta}};
|
||||
color: {{text-cta}};
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 620px) {
|
||||
table[class=body] h1 {
|
||||
font-size: 28px !important;
|
||||
margin-bottom: 10px !important;
|
||||
.container {
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table[class=body] p {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
table[class=body] .wrapper {
|
||||
padding: 10px !important;
|
||||
}
|
||||
|
||||
table[class=body] .content {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
table[class=body] .container {
|
||||
padding: 0 !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
table[class=body] .main {
|
||||
border-left-width: 0 !important;
|
||||
border-radius: 0 !important;
|
||||
border-right-width: 0 !important;
|
||||
}
|
||||
|
||||
table[class=body] .btn table {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
table[class=body] .btn a {
|
||||
width: 100% !important;
|
||||
.btn-primary a {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,12 +169,11 @@
|
|||
}
|
||||
|
||||
.btn-primary table td:hover {
|
||||
background-color: {{bg-cta-hover}} !important;
|
||||
opacity: 0.7 !important;
|
||||
}
|
||||
|
||||
.btn-primary a:hover {
|
||||
background-color: {{bg-cta-hover}} !important;
|
||||
border-color: {{bg-cta-hover}} !important;
|
||||
opacity: 0.7 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -220,15 +190,17 @@
|
|||
<td class="wrapper">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
{{content}}
|
||||
</td>
|
||||
<td>{{content}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- <div style="text-align: center; line-height: 25px; margin: 15px 0; font-size: 12px; color: #40404c;">
|
||||
<a href="https://appwrite.io" style="text-decoration: none; color: #40404c;">Powered by <img src="https://appwrite.io/images/appwrite-footer-light.svg" height="15" style="margin: -3px 0" /></a>
|
||||
</div> -->
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
|
|
@ -109,19 +109,20 @@ return [
|
|||
'gitUserName' => 'appwrite',
|
||||
],
|
||||
[
|
||||
'key' => 'kotlin',
|
||||
'name' => 'Kotlin',
|
||||
'url' => '',
|
||||
'package' => '',
|
||||
'enabled' => false,
|
||||
'beta' => false,
|
||||
'key' => 'android',
|
||||
'name' => 'Android',
|
||||
'version' => '0.0.0-SNAPSHOT',
|
||||
'url' => 'https://github.com/appwrite/sdk-for-android',
|
||||
'package' => 'https://repo1.maven.org/maven2/io/appwrite/sdk-for-android/',
|
||||
'enabled' => true,
|
||||
'beta' => true,
|
||||
'dev' => false,
|
||||
'hidden' => false,
|
||||
'family' => APP_PLATFORM_CLIENT,
|
||||
'prism' => 'kotlin',
|
||||
'source' => false,
|
||||
'gitUrl' => 'git@github.com:appwrite/sdk-for-kotlin.git',
|
||||
'gitRepoName' => 'sdk-for-kotlin',
|
||||
'source' => \realpath(__DIR__ . '/../sdks/client-android'),
|
||||
'gitUrl' => 'git@github.com:appwrite/sdk-for-android.git',
|
||||
'gitRepoName' => 'sdk-for-android',
|
||||
'gitUserName' => 'appwrite',
|
||||
],
|
||||
// [
|
||||
|
|
|
@ -1466,17 +1466,16 @@ App::post('/v1/account/recovery')
|
|||
$cta = new Template(__DIR__.'/../../config/locale/templates/email-cta.tpl');
|
||||
|
||||
$body
|
||||
->setParam('{{content}}', $content->render())
|
||||
->setParam('{{content}}', $content->render(false))
|
||||
->setParam('{{cta}}', $cta->render())
|
||||
->setParam('{{title}}', $locale->getText('account.emails.recovery.title'))
|
||||
->setParam('{{direction}}', $locale->getText('settings.direction'))
|
||||
->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]']))
|
||||
->setParam('{{name}}', $profile->getAttribute('name'))
|
||||
->setParam('{{redirect}}', $url)
|
||||
->setParam('{{bg-body}}', '#f6f6f6')
|
||||
->setParam('{{bg-body}}', '#f7f7f7')
|
||||
->setParam('{{bg-content}}', '#ffffff')
|
||||
->setParam('{{bg-cta}}', '#3498db')
|
||||
->setParam('{{bg-cta-hover}}', '#34495e')
|
||||
->setParam('{{bg-cta}}', '#073b4c')
|
||||
->setParam('{{text-content}}', '#000000')
|
||||
->setParam('{{text-cta}}', '#ffffff')
|
||||
;
|
||||
|
@ -1669,17 +1668,16 @@ App::post('/v1/account/verification')
|
|||
$cta = new Template(__DIR__.'/../../config/locale/templates/email-cta.tpl');
|
||||
|
||||
$body
|
||||
->setParam('{{content}}', $content->render())
|
||||
->setParam('{{content}}', $content->render(false))
|
||||
->setParam('{{cta}}', $cta->render())
|
||||
->setParam('{{title}}', $locale->getText('account.emails.verification.title'))
|
||||
->setParam('{{direction}}', $locale->getText('settings.direction'))
|
||||
->setParam('{{project}}', $project->getAttribute('name', ['[APP-NAME]']))
|
||||
->setParam('{{name}}', $user->getAttribute('name'))
|
||||
->setParam('{{redirect}}', $url)
|
||||
->setParam('{{bg-body}}', '#f6f6f6')
|
||||
->setParam('{{bg-body}}', '#f7f7f7')
|
||||
->setParam('{{bg-content}}', '#ffffff')
|
||||
->setParam('{{bg-cta}}', '#3498db')
|
||||
->setParam('{{bg-cta-hover}}', '#34495e')
|
||||
->setParam('{{bg-cta}}', '#073b4c')
|
||||
->setParam('{{text-content}}', '#000000')
|
||||
->setParam('{{text-cta}}', '#ffffff')
|
||||
;
|
||||
|
|
|
@ -434,7 +434,7 @@ App::post('/v1/teams/:teamId/memberships')
|
|||
$title = \sprintf($locale->getText('account.emails.invitation.title'), $team->getAttribute('name', '[TEAM-NAME]'), $project->getAttribute('name', ['[APP-NAME]']));
|
||||
|
||||
$body
|
||||
->setParam('{{content}}', $content->render())
|
||||
->setParam('{{content}}', $content->render(false))
|
||||
->setParam('{{cta}}', $cta->render())
|
||||
->setParam('{{title}}', $title)
|
||||
->setParam('{{direction}}', $locale->getText('settings.direction'))
|
||||
|
@ -442,10 +442,9 @@ App::post('/v1/teams/:teamId/memberships')
|
|||
->setParam('{{team}}', $team->getAttribute('name', '[TEAM-NAME]'))
|
||||
->setParam('{{owner}}', $user->getAttribute('name', ''))
|
||||
->setParam('{{redirect}}', $url)
|
||||
->setParam('{{bg-body}}', '#f6f6f6')
|
||||
->setParam('{{bg-body}}', '#f7f7f7')
|
||||
->setParam('{{bg-content}}', '#ffffff')
|
||||
->setParam('{{bg-cta}}', '#3498db')
|
||||
->setParam('{{bg-cta-hover}}', '#34495e')
|
||||
->setParam('{{bg-cta}}', '#073b4c')
|
||||
->setParam('{{text-content}}', '#000000')
|
||||
->setParam('{{text-cta}}', '#ffffff')
|
||||
;
|
||||
|
|
|
@ -8,6 +8,7 @@ use Utopia\Validator\WhiteList;
|
|||
use Appwrite\Network\Validator\Email;
|
||||
use Utopia\Validator\Text;
|
||||
use Utopia\Validator\Range;
|
||||
use Utopia\Validator\Boolean;
|
||||
use Utopia\Audit\Audit;
|
||||
use Utopia\Audit\Adapters\MySQL as AuditAdapter;
|
||||
use Appwrite\Auth\Auth;
|
||||
|
@ -369,6 +370,43 @@ App::patch('/v1/users/:userId/status')
|
|||
$response->dynamic($user, Response::MODEL_USER);
|
||||
});
|
||||
|
||||
App::patch('/v1/users/:userId/verification')
|
||||
->desc('Update Email Verification')
|
||||
->groups(['api', 'users'])
|
||||
->label('event', 'users.update.verification')
|
||||
->label('scope', 'users.write')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'users')
|
||||
->label('sdk.method', 'updateVerification')
|
||||
->label('sdk.description', '/docs/references/users/update-user-verification.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->param('userId', '', new UID(), 'User unique ID.')
|
||||
->param('emailVerification', false, new Boolean(), 'User Email Verification Status.')
|
||||
->inject('response')
|
||||
->inject('projectDB')
|
||||
->action(function ($userId, $emailVerification, $response, $projectDB) {
|
||||
/** @var Appwrite\Utopia\Response $response */
|
||||
/** @var Appwrite\Database\Database $projectDB */
|
||||
|
||||
$user = $projectDB->getDocument($userId);
|
||||
|
||||
if (empty($user->getId()) || Database::SYSTEM_COLLECTION_USERS != $user->getCollection()) {
|
||||
throw new Exception('User not found', 404);
|
||||
}
|
||||
|
||||
$user = $projectDB->updateDocument(\array_merge($user->getArrayCopy(), [
|
||||
'emailVerification' => $emailVerification,
|
||||
]));
|
||||
|
||||
if (false === $user) {
|
||||
throw new Exception('Failed saving user to DB', 500);
|
||||
}
|
||||
|
||||
$response->dynamic($user, Response::MODEL_USER);
|
||||
});
|
||||
|
||||
App::patch('/v1/users/:userId/prefs')
|
||||
->desc('Update User Preferences')
|
||||
->groups(['api', 'users'])
|
||||
|
|
|
@ -15,7 +15,7 @@ use Appwrite\SDK\Language\Deno;
|
|||
use Appwrite\SDK\Language\DotNet;
|
||||
use Appwrite\SDK\Language\Flutter;
|
||||
use Appwrite\SDK\Language\Go;
|
||||
use Appwrite\SDK\Language\Java;
|
||||
use Appwrite\SDK\Language\Kotlin;
|
||||
use Appwrite\SDK\Language\Swift;
|
||||
|
||||
$cli
|
||||
|
@ -134,9 +134,6 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
case 'go':
|
||||
$config = new Go();
|
||||
break;
|
||||
case 'java':
|
||||
$config = new Java();
|
||||
break;
|
||||
case 'swift':
|
||||
$config = new Swift();
|
||||
break;
|
||||
|
@ -144,6 +141,9 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
$cover = '';
|
||||
$config = new DotNet();
|
||||
break;
|
||||
case 'android':
|
||||
$config = new Kotlin();
|
||||
break;
|
||||
default:
|
||||
throw new Exception('Language "'.$language['key'].'" not supported');
|
||||
break;
|
||||
|
@ -155,9 +155,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
|
||||
$sdk
|
||||
->setName($language['name'])
|
||||
->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 {$language['name']} 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)")
|
||||
->setNamespace('io appwrite')
|
||||
->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 {$language['name']} 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)")
|
||||
->setShortDescription('Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API')
|
||||
->setLicense($license)
|
||||
->setLicenseContent($licenseContent)
|
||||
|
|
|
@ -240,11 +240,11 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
|
|||
<li>
|
||||
<div class="link flutter-new"><img src="/images/clients/flutter.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="Flutter Platform Logo" class="avatar xxs margin-end-small" loading="lazy" /> New Flutter App <span class="text-size-tiny">(beta)</span></div>
|
||||
</li>
|
||||
<li class="disabled">
|
||||
<div class="link ios-new"><img src="/images/clients/ios.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="iOS Platform Logo" class="avatar xxs margin-end-small" loading="lazy" /> New iOS App <span class="text-fade text-size-small">(soon)</span></div>
|
||||
<li>
|
||||
<div class="link android-new"><img src="/images/clients/android.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="Android Platform Logo" class="avatar xxs margin-end-small" loading="lazy" /> New Android App</div>
|
||||
</li>
|
||||
<li class="disabled">
|
||||
<div class="link android-new"><img src="/images/clients/android.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="Android Platform Logo" class="avatar xxs margin-end-small" loading="lazy" /> New Android App <span class="text-fade text-size-small">(soon)</span></div>
|
||||
<div class="link ios-new"><img src="/images/clients/ios.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="iOS Platform Logo" class="avatar xxs margin-end-small" loading="lazy" /> New iOS App <span class="text-fade text-size-small">(soon)</span></div>
|
||||
</li>
|
||||
<li class="disabled">
|
||||
<div class="link unity-new"><img src="/images/clients/unity.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="Unity Platform Logo" class="avatar xxs margin-end-small" loading="lazy" /> New Unity Game <span class="text-fade text-size-small">(soon)</span></div>
|
||||
|
@ -329,6 +329,42 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
|
|||
</form>
|
||||
</script>
|
||||
|
||||
<div data-ui-modal class="modal box close" data-button-alias=".android-new">
|
||||
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
||||
|
||||
<h1 class="margin-bottom-xl">Register your Android App</h1>
|
||||
|
||||
<form
|
||||
data-analytics
|
||||
data-analytics-activity
|
||||
data-analytics-event="submit"
|
||||
data-analytics-category="console"
|
||||
data-analytics-label="Create Project Platform (Android)"
|
||||
data-service="projects.createPlatform"
|
||||
data-scope="console"
|
||||
data-event="submit"
|
||||
data-success="alert,trigger,reset"
|
||||
data-success-param-alert-text="Registered new platform successfully"
|
||||
data-success-param-trigger-events="projects.createPlatform"
|
||||
data-failure="alert"
|
||||
data-failure-param-alert-text="Failed to register platform"
|
||||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
|
||||
<input type="hidden" name="type" data-ls-bind="android" />
|
||||
|
||||
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
|
||||
<input type="text" class="full-width" name="name" required autocomplete="off" placeholder="My Android App" maxlength="128" />
|
||||
|
||||
<label for="key">Package Name <span class="tooltip large" data-tooltip="Your package name is generally the applicationId in your app-level build.gradle file."><i class="icon-question"></i></span></label>
|
||||
<input type="text" class="full-width" name="key" required autocomplete="off" placeholder="com.company.appname" />
|
||||
|
||||
<hr />
|
||||
|
||||
<button type="submit">Register</button> <button data-ui-modal-close="" type="button" class="reverse">Back</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div data-ui-modal class="modal box close width-large" data-button-alias=".flutter-new">
|
||||
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
||||
|
||||
|
|
|
@ -417,11 +417,14 @@ services:
|
|||
- appwrite-influxdb:/var/lib/influxdb:rw
|
||||
|
||||
telegraf:
|
||||
image: appwrite/telegraf:1.1.0
|
||||
image: appwrite/telegraf:1.2.0
|
||||
container_name: appwrite-telegraf
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- appwrite
|
||||
environment:
|
||||
- _APP_INFLUXDB_HOST
|
||||
- _APP_INFLUXDB_PORT
|
||||
|
||||
networks:
|
||||
gateway:
|
||||
|
|
|
@ -481,10 +481,13 @@ services:
|
|||
- appwrite-influxdb:/var/lib/influxdb:rw
|
||||
|
||||
telegraf:
|
||||
image: appwrite/telegraf:1.1.0
|
||||
image: appwrite/telegraf:1.2.0
|
||||
container_name: appwrite-telegraf
|
||||
networks:
|
||||
- appwrite
|
||||
environment:
|
||||
- _APP_INFLUXDB_HOST
|
||||
- _APP_INFLUXDB_PORT
|
||||
|
||||
# Dev Tools Start ------------------------------------------------------------------------------------------
|
||||
#
|
||||
|
|
1
docs/references/users/update-user-verification.md
Normal file
1
docs/references/users/update-user-verification.md
Normal file
|
@ -0,0 +1 @@
|
|||
Update the user email verification status by its unique ID.
|
1
docs/sdks/android/CHANGELOG.md
Normal file
1
docs/sdks/android/CHANGELOG.md
Normal file
|
@ -0,0 +1 @@
|
|||
# Change Log
|
94
docs/sdks/android/GETTING_STARTED.md
Normal file
94
docs/sdks/android/GETTING_STARTED.md
Normal file
|
@ -0,0 +1,94 @@
|
|||
## Getting Started
|
||||
|
||||
### Add your Android Platform
|
||||
To initialize your SDK and start interacting with Appwrite services, you need to add a new Android platform to your project. To add a new platform, go to your Appwrite console, select your project (create one if you haven't already), and click the 'Add Platform' button on the project Dashboard.
|
||||
|
||||
From the options, choose to add a new **Android** platform and add your app credentials.
|
||||
|
||||
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 a new platform, you are allowing your app to communicate with the Appwrite API.
|
||||
|
||||
### Registering additional activities
|
||||
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-android/blob/master/app/src/main/AndroidManifest.xml). Be sure to replace the **[PROJECT_ID]** string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in the console.
|
||||
|
||||
```xml
|
||||
<manifest>
|
||||
<application>
|
||||
<activity android:name="io.appwrite.views.CallbackActivity" >
|
||||
<intent-filter android:label="android_web_auth">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="appwrite-callback-[PROJECT_ID]" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
```
|
||||
|
||||
### Init your SDK
|
||||
|
||||
<p>Initialize your SDK with your Appwrite server API endpoint and project ID, which can be found in your project settings page.
|
||||
|
||||
```kotlin
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.services.Account
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setSelfSigned(true) // Remove in production
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
When trying to connect to Appwrite from an emulator or a mobile device, localhost is the hostname of the device or emulator and not your local Appwrite instance. You should replace localhost with your private IP. You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API.
|
||||
|
||||
### Make Your First Request
|
||||
|
||||
<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.
|
||||
|
||||
```kotlin
|
||||
// Register User
|
||||
val account = Account(client)
|
||||
val response = account.create(
|
||||
"email@example.com",
|
||||
"password"
|
||||
)
|
||||
```
|
||||
|
||||
### Full Example
|
||||
|
||||
```kotlin
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.services.Account
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
.setSelfSigned(true) // Remove in production
|
||||
|
||||
val account = Account(client)
|
||||
val response = account.create(
|
||||
"email@example.com",
|
||||
"password"
|
||||
)
|
||||
```
|
||||
|
||||
### Error Handling
|
||||
The Appwrite Android SDK raises an `AppwriteException` object with `message`, `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.
|
||||
|
||||
```kotlin
|
||||
try {
|
||||
var response = account.create("email@example.com", "password")
|
||||
Log.d("Appwrite response", response.body?.string())
|
||||
} catch(e : AppwriteException) {
|
||||
Log.e("AppwriteException",e.message.toString())
|
||||
}
|
||||
```
|
||||
|
||||
### Learn more
|
||||
You can use following resources to learn more and get help
|
||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-android)
|
||||
- 📜 [Appwrite Docs](https://appwrite.io/docs)
|
||||
- 💬 [Discord Community](https://appwrite.io/discord)
|
||||
- 🚂 [Appwrite Android Playground](https://github.com/appwrite/playground-for-android)
|
|
@ -1,7 +1,7 @@
|
|||
## 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 project's API keys section.
|
||||
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
|
||||
|
||||
```typescript
|
||||
let client = new sdk.Client();
|
||||
|
@ -17,7 +17,7 @@ client
|
|||
|
||||
### Make your first request
|
||||
|
||||
Once your SDK object is set, create any of the Appwrite service 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.
|
||||
Once your SDK object is set, create any of the Appwrite service 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](https://appwrite.io/docs) section.
|
||||
|
||||
```typescript
|
||||
let users = new sdk.Users(client);
|
||||
|
|
|
@ -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](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.
|
||||
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 replace the **[PROJECT_ID]** string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in the console.
|
||||
|
||||
```xml
|
||||
<manifest>
|
||||
|
@ -48,7 +48,7 @@ While running Flutter Web, make sure your Appwrite server and your Flutter clien
|
|||
|
||||
### Init your SDK
|
||||
|
||||
<p>Initialize your SDK code with your project ID, which can be found in your project settings page.
|
||||
<p>Initialize your SDK with your Appwrite server API endpoint and project ID, which can be found in your project settings page.
|
||||
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
@ -68,7 +68,7 @@ When trying to connect to Appwrite from an emulator or a mobile device, localhos
|
|||
|
||||
### Make Your First Request
|
||||
|
||||
<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.
|
||||
<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.
|
||||
|
||||
```dart
|
||||
// Register User
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## 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 project API keys section.
|
||||
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key project API keys section.
|
||||
|
||||
```js
|
||||
const sdk = require('node-appwrite');
|
||||
|
@ -17,7 +17,7 @@ client
|
|||
```
|
||||
|
||||
### Make Your First Request
|
||||
Once your SDK object is set, create any of the Appwrite service 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.
|
||||
Once your SDK object is set, create any of the Appwrite service 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](https://appwrite.io/docs) section.
|
||||
|
||||
```js
|
||||
let users = new sdk.Users(client);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## 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 project's API keys section.
|
||||
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
|
||||
|
||||
```php
|
||||
$client = new Client();
|
||||
|
@ -15,7 +15,7 @@ $client
|
|||
```
|
||||
|
||||
### Make Your First Request
|
||||
Once your SDK object is set, create any of the Appwrite service 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.
|
||||
Once your SDK object is set, create any of the Appwrite service 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](https://appwrite.io/docs) section.
|
||||
|
||||
```php
|
||||
$users = new Users($client);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## 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 project's API keys section.
|
||||
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
|
||||
|
||||
```python
|
||||
from appwrite.client import Client
|
||||
|
@ -18,7 +18,7 @@ client = Client()
|
|||
```
|
||||
|
||||
### Make Your First Request
|
||||
Once your SDK object is set, create any of the Appwrite service 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.
|
||||
Once your SDK object is set, create any of the Appwrite service 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](https://appwrite.io/docs) section.
|
||||
|
||||
```python
|
||||
users = Users(client)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## 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 project's API keys section.
|
||||
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key from project's API keys section.
|
||||
|
||||
```ruby
|
||||
require 'appwrite'
|
||||
|
@ -17,7 +17,7 @@ client
|
|||
```
|
||||
|
||||
### Make Your First Request
|
||||
Once your SDK object is set, create any of the Appwrite service 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.
|
||||
Once your SDK object is set, create any of the Appwrite service 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](https://appwrite.io/docs) section.
|
||||
|
||||
```ruby
|
||||
users = Appwrite::Users.new(client);
|
||||
|
|
|
@ -6,7 +6,7 @@ For you to init your SDK and interact with Appwrite services you need to add a w
|
|||
From the options, choose to add a **Web** platform and add your client app hostname. By adding your hostname to your project platform you are allowing cross-domain communication between your project and the Appwrite API.
|
||||
|
||||
### Init your SDK
|
||||
Initialize your SDK code with your project ID which can be found in your project settings page.
|
||||
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page.
|
||||
|
||||
```js
|
||||
// Init your Web SDK
|
||||
|
@ -19,7 +19,7 @@ sdk
|
|||
```
|
||||
|
||||
### 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.
|
||||
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.
|
||||
|
||||
```js
|
||||
// Register User
|
||||
|
|
|
@ -13,6 +13,9 @@ class Origin extends Validator
|
|||
const CLIENT_TYPE_FLUTTER_MACOS = 'flutter-macos';
|
||||
const CLIENT_TYPE_FLUTTER_WINDOWS = 'flutter-windows';
|
||||
const CLIENT_TYPE_FLUTTER_LINUX = 'flutter-linux';
|
||||
const CLIENT_TYPE_ANDROID = 'android';
|
||||
const CLIENT_TYPE_IOS = 'ios';
|
||||
|
||||
|
||||
const SCHEME_TYPE_HTTP = 'http';
|
||||
const SCHEME_TYPE_HTTPS = 'https';
|
||||
|
@ -69,6 +72,8 @@ class Origin extends Validator
|
|||
case self::CLIENT_TYPE_FLUTTER_MACOS:
|
||||
case self::CLIENT_TYPE_FLUTTER_WINDOWS:
|
||||
case self::CLIENT_TYPE_FLUTTER_LINUX:
|
||||
case self::CLIENT_TYPE_ANDROID:
|
||||
case self::CLIENT_TYPE_IOS:
|
||||
$this->clients[] = (isset($platform['key'])) ? $platform['key'] : '';
|
||||
break;
|
||||
|
||||
|
@ -90,7 +95,7 @@ class Origin extends Validator
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if Origin has been whiltlisted
|
||||
* Check if Origin has been allowed
|
||||
* for access to the API
|
||||
*
|
||||
* @param mixed $origin
|
||||
|
|
|
@ -55,6 +55,8 @@ class V07 extends Filter {
|
|||
case Response::MODEL_ANY:
|
||||
case Response::MODEL_PREFERENCES: /** ANY was replaced by PREFERENCES in 0.8.x but this is backward compatible with 0.7.x */
|
||||
case Response::MODEL_NONE:
|
||||
case Response::MODEL_ERROR:
|
||||
case Response::MODEL_ERROR_DEV:
|
||||
$parsedResponse = $content;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -122,6 +122,35 @@ trait UsersBase
|
|||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetUser
|
||||
*/
|
||||
public function testUpdateEmailVerification(array $data):array
|
||||
{
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$user = $this->client->call(Client::METHOD_PATCH, '/users/' . $data['userId'] . '/verification', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'emailVerification' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals($user['headers']['status-code'], 200);
|
||||
$this->assertEquals($user['body']['emailVerification'], true);
|
||||
|
||||
$user = $this->client->call(Client::METHOD_GET, '/users/' . $data['userId'], array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($user['headers']['status-code'], 200);
|
||||
$this->assertEquals($user['body']['emailVerification'], true);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetUser
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue