Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit d7e3790

Browse files
EddyVerbruggeneddyverbruggen
authored andcommitted
Merge remote-tracking branch 'origin/master'
2 parents 7a683de + 48ba3cf commit d7e3790

File tree

4 files changed

+44
-6
lines changed

4 files changed

+44
-6
lines changed

docs/AUTHENTICATION.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,18 @@ Then add the following lines to your code and check for setup instructions for y
256256

257257
For a complete list of the available scope permissions, visit Facebook's documentation: https://developers.facebook.com/docs/facebook-login/permissions.
258258

259+
#### Post-login Graph API querying
260+
Upon successful authentication, Facebook creates an access token that can be obtained from the login method's result object. This access token can then be used for querying the Facebook Graph API, by feeding it to either Facebook's Javascript SDK or their iOS/Android native SDKs:
261+
262+
```js
263+
"providers": [
264+
{
265+
"id": "facebook.com",
266+
"token": "<FB token>"
267+
}
268+
]
269+
```
270+
259271
#### iOS
260272
1. If you didn't choose this feature during installation you can open the `Podfile` in the plugin's `platforms/ios` folder and uncomment the Facebook line.
261273
2. Add a bit of config to `app\App_Resources\iOS\Info.plist` as instructed in Step 4 [here](https://developers.facebook.com/docs/ios/getting-started).

docs/DATABASE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,34 @@ Changes the values of the keys specified in the dictionary without overwriting o
150150
);
151151
```
152152

153+
#### atomic writes across multiple locations
154+
Changes values in multiple locations
155+
156+
```js
157+
var entriesPath = 'entries';
158+
var usersPath = 'users';
159+
160+
var data = {};
161+
data[entriesPath] = {'foo':'bar'};
162+
data[usersPath] = {'name': 'John'};
163+
164+
firebase.update('/', data);
165+
```
166+
167+
#### atomic remove across multiple locations
168+
Removes values in multiple locations
169+
170+
```js
171+
var entriesPath = 'entries';
172+
var usersPath = 'users';
173+
174+
var data = {};
175+
data[entriesPath] = null;
176+
data[usersPath] = null;
177+
178+
firebase.update('/', data);
179+
```
180+
153181
### addChildEventListener
154182
To listen for changes in your database you can pass in a listener callback function.
155183
You get to control which path inside you database you want to listen to, by default it's `/` which is the entire database.

firebase.android.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,9 +777,8 @@ function toLoginResult(user) {
777777
var providerData = user.getProviderData();
778778
for (var i = 0; i < providerData.size(); i++) {
779779
var pid = providerData.get(i).getProviderId();
780-
providers.push({
781-
id: pid
782-
});
780+
if (pid==='facebook.com') { providers.push({ id: pid, token: firebase._facebookAccessToken }); }
781+
else { providers.push({ id: pid }); }
783782
}
784783

785784
return {

firebase.ios.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,8 @@ function toLoginResult(user) {
856856
for (i = 0, l = user.providerData.count; i < l; i++) {
857857
var firUserInfo = user.providerData.objectAtIndex(i);
858858
var pid = firUserInfo.valueForKey("providerID");
859-
providers.push({
860-
id: pid
861-
});
859+
if (pid==='facebook.com') { providers.push({ id: pid, token: FBSDKAccessToken.currentAccessToken().tokenString }); }
860+
else { providers.push({ id: pid }); }
862861
}
863862

864863
return {

0 commit comments

Comments
 (0)