-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from QuangNguyen1412/dev/wifi_manager
Dev/wifi manager
- Loading branch information
Showing
21 changed files
with
1,233 additions
and
189 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default class FireStoreConstant { | ||
static collections = { | ||
users: 'users', | ||
devices: 'devices', | ||
mac_addresses: 'mac_addresses', | ||
}; | ||
|
||
static documentField = { | ||
users: { | ||
devices: 'devices', | ||
email: 'email', | ||
first_name: 'first_name', | ||
last_name: 'last_name', | ||
}, | ||
}; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default class GlobalConstants { | ||
static SERVER_DOMAIN_NAME = 'https://scottgale.appspot.com/'; | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import FireStoreConstants from '../Constants/fireStoreConstants'; | ||
import firebase from 'react-native-firebase'; | ||
|
||
export default class FireStoreHelper { | ||
static async getUserDevices() { | ||
console.log('getUserDevices'); | ||
var devicesData; | ||
const user = await firebase | ||
.firestore() | ||
.collection(FireStoreConstants.collections.users) | ||
.doc(global.email); | ||
console.log('firebase.firestore().runTransaction'); | ||
await firebase | ||
.firestore() | ||
.runTransaction(async transaction => { | ||
const doc = await transaction.get(user); | ||
devicesData = await doc.data().devices; | ||
console.log(devicesData); | ||
}) | ||
.catch(err => {}); | ||
return await Promise.resolve(devicesData); | ||
} | ||
} |
Oops, something went wrong.