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: README.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Firebase in ActionScript
2
2
3
-
Firebase is a back end platform that offers several services to aid in the development of software, especially the ones that rely on server side infraestructure.
3
+
Firebase is a back end platform that offers several services to aid in the development of apps and games, specially the ones that rely on server side infrastructure.
4
4
5
-
Some of its services can be accesed by using RESTful techniques. This repository contains detailed guides and examples explaining how to use those services in your `Adobe AIR ` projects.
5
+
Some of its services can be accessed by using RESTful techniques. This repository contains detailed guides and [examples](./examples) explaining how to use those services in your `Adobe AIR ` projects.
6
6
7
7
You won't need an `ANE` for these guides, all of them work only using `StageWebView`, `URLRequest` and `URLLoader`.
8
8
@@ -13,7 +13,7 @@ This service allows you to securely authenticate users into your app. It uses Go
13
13
14
14
* Leverages the use of OAuth, saving time and effort.
15
15
* Authenticate with `Facebook`, `Google`, `Twitter`, `Email`, `Anonymous` and more.
16
-
* Generates a `tokenId` that can be used for secure operations against Firebase Storage and Firebase Database.
16
+
* Generates an `idToken` that can be used for secure operations against Firebase Storage and Firebase Database.
17
17
18
18
## Firebase Database
19
19
*Main guide: [Firebase Database](./database)*
@@ -29,7 +29,7 @@ This service allows you to save and retrieve text based data. Some of its key fe
29
29
## Firebase Storage
30
30
*Main guide: [Firebase Storage](./storage)*
31
31
32
-
This service allows you to upload and maintain all kinds of files, including images, sounds, videos and binaries. It uses Google Cloud Messaging to provide this service. Some of its key features are:
32
+
This service allows you to upload and maintain all kinds of files, including images, sounds, videos and binaries. It uses Google Cloud Storage to provide this service. Some of its key features are:
33
33
34
34
* Securely save, retrieve and delete files using rules and Firebase Auth.
35
35
* Load end edit metadata from files.
@@ -54,7 +54,7 @@ You can read the guides in any order but it is recommended to start with the [Fi
54
54
55
55
Firebase ANEs are based on the Android and iOS official SDKs, providing all of their native features.
56
56
57
-
These guides are based on the JavaScript SDK, keeping the same functionality inside the AIR runtime instead of a web browser.
57
+
These guides are based on the JavaScript SDK, while keeping the same functionality inside the AIR runtime instead of a web browser.
58
58
59
59
### **Which are the benefits of using these guides?**
Copy file name to clipboardExpand all lines: auth/README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -192,7 +192,7 @@ This information is formatted the same for all providers, the most important val
192
192
Name | Description
193
193
---|---
194
194
`localId`| A unique id assigned for the logged in user for your specific Firebase project. This is very useful when working with Firebase Database and Firebase Storage.
195
-
`idToken`| An Auth token used to access protected data and files from Firebase Database and Firebase Storage. For more information you can read the Firebase Database and Firebase Storage guides.
195
+
`idToken`| An Authentication token that is used to identify the current logged in user. The `idToken` is heavily used in all Firebase features.
196
196
`displayName`| The logged in user full name (Google and Facebook) or their handler in Twitter.
197
197
`photoUrl`| The logged in user avatar.
198
198
`email`| The logged in user email address.
@@ -201,7 +201,7 @@ Note that not all providers return the same information, for example Twitter doe
201
201
202
202
Once you have the profile information you might want to save it on an Object that can be globally accessed, you will need it when performing Auth requests against Firebase Database and Firebase Storage.
203
203
204
-
The `idToken` you receive from this response doesn't work with `auth`requests. You must exchange it for a new one using the next method.
204
+
The `idToken` you receive from this response doesn't work with Firebase Database and Firebase Storage requests. You must exchange it for a new one using the next method. It still works for further Firebase Auth requests.
205
205
206
206
## Refreshing the idToken
207
207
@@ -254,5 +254,5 @@ A successful response will look like the following JSON structure:
254
254
}
255
255
```
256
256
257
-
Once you have got the `access_token` you are ready to continue performing secure operations against the Firebase Database and Firebase Storage.
257
+
Once you have got the `access_token` you are ready to perform secure operations against the Firebase Database and Firebase Storage services.
Copy file name to clipboardExpand all lines: auth/email/README.md
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ The user will be automatically registered in the Auth section from your Firebase
78
78
79
79
For an Anonymous approach you don't need to specify anything in the request body. You will still get a response similar to the above just without an Email Address.
80
80
81
-
The `idToken` received from this response does work for `auth` requests.
81
+
The `idToken` received from this response does work for the Firebase Database, Firebase Storage and Firebase Auth requests.
82
82
83
83
## Verifying Credentials (Sign In)
84
84
@@ -125,7 +125,8 @@ A successful response will look like the following JSON structure:
125
125
126
126
Note that failing to enter the correct password 3 times in a row will block the IP for future login attempts for a while.
127
127
128
-
The `idToken` received from this response doesn't work for `auth` requests. You must refresh the `idToken` to get a functional one (see bottom of this guide).
128
+
The `idToken` received from this response doesn't work for Firebase Databasae and Firebase Storage requests. You must refresh the `idToken` to get a functional one (see bottom of this guide).
129
+
It does still work for Firebase Auth requests.
129
130
130
131
## Password Reset
131
132
@@ -435,4 +436,6 @@ A successful response will look like the following JSON structure:
435
436
"user_id": "ZJ7ud0CEpHYPF6QFWRGTe1U1Gvy2",
436
437
"project_id": "545203846422"
437
438
}
438
-
```
439
+
```
440
+
441
+
Once you have got the `access_token` you are ready to perform secure operations against the Firebase Database and Firebase Storage services.
Copy file name to clipboardExpand all lines: examples/README.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ It is strongly recommended to use recent versions of `Adobe AIR` and `Apache Fle
8
8
9
9
An Apache Flex example that demonstrates how to use the Firebase Database with realtime data and Email auth. This project makes use of the `Responses.as` file that can be found in the [utils folder](./../utils).
10
10
11
-
You will require to enable the `Email` provider for your project, you will also require the following rules in your project:
11
+
You will require to enable the `Email` provider for your project, you will also require the following Database rules in your project:
12
12
13
13
```json
14
14
{
@@ -23,7 +23,7 @@ You will require to enable the `Email` provider for your project, you will also
23
23
24
24
## SimpleCRUD.mxml
25
25
26
-
An Apache Flex example that demonstrates how to use the Firebase Database with non realtime data. You only require the following rules in your project:
26
+
An Apache Flex example that demonstrates how to use the Firebase Database with non realtime data. You only require the following Database rules in your project:
Copy file name to clipboardExpand all lines: storage/README.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,11 @@
2
2
3
3
Firebase Storage is based on Google Cloud Storage, a very easy and flexible solution for storing all kinds of files.
4
4
5
-
Files are stored the same way as in your personal computer, using a tree hierarchy. This means there's a root folder, which can contain more folders and those folders can contain additional folders and files.
5
+
Files are stored the same way as in your personal computer, using a tree hierarchy. This means there's a root folder which can contain more folders and those folders can contain additional folders and files.
6
6
7
7
It is strongly recommended to avoid the use of special characters when naming files and folders.
8
8
9
-
You need to have specific care for the slash character `(/)`. I recommend using this helper function to URL encode them:
9
+
You need special care for the slash character `(/)`. I recommend using this helper function to URL encode them:
10
10
11
11
```actionscript
12
12
private function formatUrl(url:String):String
@@ -19,7 +19,7 @@ In the context of this guide a `bucket` is a synonymous to your Firebase project
19
19
20
20
## Firebase Rules
21
21
22
-
The Firebase Rules are a flexible way to set permissions on who can access certain data.
22
+
The Firebase Rules are a flexible way to set permissions on who can access certain files and data.
23
23
24
24
By default all the data is private and can only be accessed by Authenticated users.
25
25
@@ -72,7 +72,7 @@ service firebase.storage {
72
72
}
73
73
```
74
74
75
-
These rules will allow anyone to read the contents of a folder named `public`.
75
+
The following rules will allow anyone to read but not to write the contents of a folder named `public`.
76
76
77
77
```
78
78
service firebase.storage {
@@ -88,7 +88,7 @@ service firebase.storage {
88
88
89
89
To upload a file you require to send it as a `ByteArray`. The following snippets show the most common scenarios.
90
90
91
-
All of the following examples use the following `Event.COMPLETE` and `IOErrorEvent.IOERROR` listeners.
91
+
All of the examples use the following `Event.COMPLETE` and `IOErrorEvent.IOERROR` listeners.
92
92
93
93
```actionscript
94
94
private function uploadComplete(event:flash.events.Event):void
@@ -152,7 +152,7 @@ A successful response will look like the following JSON structure:
152
152
}
153
153
```
154
154
155
-
Your new file and `savegames` folder will instantly appear in the Storage section from the Firebase console.
155
+
Your new file and a `savegames` folder will instantly appear in the Storage section from the Firebase console.
156
156
157
157
The download link for this specific file would be:
158
158
@@ -162,7 +162,7 @@ The metadata link for this specific file would be:
Notice that you need to provide the `?alt=media` parameter in order to download the actual file.
165
+
Note that you need to provide the `?alt=media` parameter in order to download the actual file.
166
166
167
167
You will also need to replace all the `/` for `%2F` after the bucket name. Otherwise it will return an error.
168
168
@@ -343,7 +343,7 @@ service firebase.storage {
343
343
}
344
344
```
345
345
346
-
The following snippet requires that you already have an `idToken` and a `localId`. You can obtain those after a successful Log In or Sign Up. For more information you can read the [Firebase Auth guide](./../auth).
346
+
The following snippet requires that you already have a valid `idToken` and a `localId`. You can obtain those after a successful `Refresh Token` request. For more information you can read the [Firebase Auth guide](./../auth).
347
347
348
348
```actionscript
349
349
private function uploadPersonalFile(idToken:String, localId:String):void
@@ -358,7 +358,7 @@ private function uploadPersonalFile(idToken:String, localId:String):void
358
358
359
359
var header:URLRequestHeader = new URLRequestHeader("Authorization", "Bearer "+idToken);
360
360
361
-
var request:URLRequest = new URLRequest(FIREBASE_STORAGE_URL+"savegames%2F"+localId+"%2Fsavegame.data");
361
+
var request:URLRequest = new URLRequest("https://firebasestorage.googleapis.com/v0/b/<YOUR-PROJECT-ID>.appspot.com/o/"+"savegames%2F"+localId+"%2Fsavegame.data");
0 commit comments