This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.signInSocial = function() { | |
| return $q(function(resolve, reject) { | |
| $cordovaOauth.facebook("208207529514102", [ "public_profile", "email"]) | |
| .then(function (result) { | |
| var credentials = firebase.auth.FacebookAuthProvider.credential(result.access_token); | |
| return firebase.auth().signInWithCredential(credentials); | |
| }) | |
| .then(function (firebaseUser) { | |
| resolve(firebaseUser); | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.signInSocial = function() { | |
| return $q(function(resolve, reject) { | |
| $cordovaOauth.facebook("223434561234", [ "public_profile", "email"]) | |
| .then(function (result) { | |
| var credentials = firebase.auth.FacebookAuthProvider.credential(result.access_token); | |
| return firebase.auth().signInWithCredential(credentials); | |
| }) | |
| .then(function (firebaseUser) { | |
| resolve(firebaseUser); | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spyOn(firebase.database().ref(), 'set').and.callFake(function(fakeSetObj, fakeOnComplete) { | |
| return fakeOnComplete("error"); | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { "users": | |
| { | |
| "id1": {"name": "andrew"}, | |
| "id2": {"name:" "barbra"}, | |
| "id9513": {"name:" "charlie"} | |
| } | |
| } | |
| * assumption 1000 + users | |
| * have list of user id's in array ["id1", "id23", "id2342" ... x50], would like to retrieve object with those keys only |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var sessionsRef = firebase.database().ref('sessions'); | |
| var mySessionRef = sessionsRef.push(); | |
| mySessionRef.update({ startedAt: firebase.database.ServerValue.TIMESTAMP }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var test = { | |
| result: "result", | |
| zero: function() { | |
| return this.result; | |
| }, | |
| one: function() { | |
| return test.result; | |
| }, | |
| two: () => { | |
| return this.result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var FireFunc = require("../js/services-fb-functions.js"); | |
| describe('Firebase Testing Suite', function() { | |
| var firebase; | |
| var testPath; | |
| var testResult = {}; | |
| beforeAll(function() { | |
| var firebaseFunctions = ['check'] | |
| firebase = jasmine.createSpyObj('firebase', firebaseFunctions) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var request = require("request"); | |
| var FireFunc = require("../js/services-fb-functions.js") | |
| describe('Firebase Testing Suite', function() { | |
| var firebase; | |
| var testObj = { | |
| "testkey": "testVal" | |
| } | |
| var testPath; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| firebase.database().ref(childRef).set(SetObject, onComplete); | |
| // first attempt?! | |
| spyOn(firebase, 'database().ref().set()', function(params) { | |
| return { | |
| then: function(callback) { | |
| return callback("SET_SUCCESS"); | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "rules": { | |
| ".read": false, // read denied | |
| "test": { | |
| ".read": true // read allowed | |
| } | |
| } | |
| } | |