Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add React Native samples to Storage Quick Start #1064

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
27f75d5
docs: add client react native code snippet sample to docs/products/st…
choir241 Jun 20, 2024
ebb00f7
docs: update code snippets based on client-react-native manual test
choir241 Jun 21, 2024
6ec110e
docs: add specific parameters for FILE type in client-react-native
choir241 Jun 24, 2024
c7fc26b
docs: add field to uri object in code snippet
choir241 Jun 25, 2024
fe4b26f
docs: update file type object properties with FILE properties from co…
choir241 Jun 25, 2024
678f269
docs: update file object properties in code snippet based on testing …
choir241 Jun 25, 2024
655c0d3
docs: replace double quotes with single quotes, change object to mult…
choir241 Jun 26, 2024
56c1460
docs: replace double quotes with single quotes for react-native-appwrite
choir241 Jun 26, 2024
2ffe92b
docs: replace placeholder [] for <> in code snippets
choir241 Jun 26, 2024
a22e4f7
docs: remove Permission from code snippets to remove optional paramet…
choir241 Jun 27, 2024
7234c11
chore: fix spacing in blog post
choir241 Jun 27, 2024
9598a60
docs: revert flutter, android-kotlin, and client-apple file object pr…
choir241 Jun 28, 2024
6da8fb5
chore: remove extra space
choir241 Jun 28, 2024
b5759ef
update http code snipeet
choir241 Jun 28, 2024
b21be3f
Update src/routes/docs/products/storage/quick-start/+page.markdoc
choir241 Jul 2, 2024
2a7caa3
Update src/routes/docs/products/storage/quick-start/+page.markdoc
choir241 Jul 2, 2024
4e57243
docs: revert web file object to previous iteration, include imports f…
choir241 Jul 2, 2024
180aaa0
docs: replace double quotes for single quotes and update image type f…
choir241 Jul 2, 2024
0280cc3
replace setProject argument with placeholder <PROJECT_ID for consistency
choir241 Jul 2, 2024
dd9610e
Merge branch 'main' into docs-react-native-samples
choir241 Jul 2, 2024
0e45184
Merge branch 'main' into docs-react-native-samples
choir241 Jul 8, 2024
babfa8e
docs: change file comment to sentence case for consistency, update qu…
choir241 Jul 8, 2024
e7f0d1e
Merge branch 'docs-react-native-samples' of https://github.com/appwri…
choir241 Jul 8, 2024
3a8a58d
Merge branch 'main' into docs-react-native-samples
choir241 Jul 15, 2024
113112b
Update src/routes/docs/products/storage/quick-start/+page.markdoc
choir241 Jul 15, 2024
4c001ab
Update src/routes/docs/products/storage/quick-start/+page.markdoc
choir241 Jul 15, 2024
9e24a53
docs: fix duplicate import to ensure accuracy. Add underscore to main…
choir241 Jul 15, 2024
48debf9
docs: remove redundant comment
choir241 Jul 15, 2024
3d32999
Merge branch 'main' into docs-react-native-samples
choir241 Jul 16, 2024
a23eff1
docs: Align comments and replace single quotes for double quotes in k…
choir241 Jul 19, 2024
aa9fd32
docs: update indentation for code snippet
choir241 Jul 19, 2024
27b8aeb
docs: remove setEndpoint from code snippets in storage quick start
choir241 Jul 20, 2024
605ad36
Update src/routes/docs/products/storage/quick-start/+page.markdoc
choir241 Jul 25, 2024
cf823e3
docs: add quotes to match consistency with other code snippet example…
choir241 Aug 13, 2024
dd67e5f
Merge branch 'main' into docs-react-native-samples
choir241 Aug 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/routes/docs/products/storage/quick-start/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,28 @@ To upload a file, add this to you web, Flutter, Apple, or Android app.

--cec8e8123c05ba25--
```
```client-react-native
import { Client, Storage, ID } from "react-native-appwrite";

const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<PROJECT_ID>'); // Your project ID

const storage = new Storage(client);

const promise = await storage.createFile(
'[BUCKET_ID]',
ID.unique(),
{name: "file.txt", type: "text/plain", size: 37967, uri: ""}, // FILE
stnguyen90 marked this conversation as resolved.
Show resolved Hide resolved
["read(\"any\")"]
);

promise.then(function (response) {
console.log(response); // Success
}, function (error) {
console.log(error); // Failure
});
```
{% /multicode %}


Expand Down Expand Up @@ -224,4 +245,20 @@ class MainActivity : AppCompatActivity() {
}
}
```
```client-react-native
import { Client, Storage, ID } from "react-native-appwrite";

const client = new Client();

const storage = new Storage(client);

client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
choir241 marked this conversation as resolved.
Show resolved Hide resolved

const result = storage.getFileDownload('[BUCKET_ID]', '[FILE_ID]');

console.log(result); // Resource URL
```
{% /multicode %}
Loading