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

Commit 5f09214

Browse files
author
Dick Smith
committed
Merge branch 'master' of github.com:EddyVerbruggen/nativescript-plugin-firebase
2 parents 5f96c7d + 55cfb4f commit 5f09214

File tree

12 files changed

+446
-97
lines changed

12 files changed

+446
-97
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ matrix:
4040
os: osx
4141
env:
4242
- Webpack="iOS"
43-
osx_image: xcode8.3
43+
osx_image: xcode9.2
4444
language: node_js
4545
node_js: "6"
4646
jdk: oraclejdk8
@@ -67,8 +67,8 @@ matrix:
6767
- os: osx
6868
env:
6969
- BuildiOS="10.3"
70-
- Xcode="8.3"
71-
osx_image: xcode8.3
70+
- Xcode="9.2"
71+
osx_image: xcode9.2
7272
language: node_js
7373
node_js: "6"
7474
jdk: oraclejdk8

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44
[Firebase Android SDK Changelog](https://firebase.google.com/support/release-notes/android)
55

66

7+
## 5.1.7 (2018, February 11)
8+
9+
### New
10+
11+
- [#624](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/624) Get push key avoiding .then()
12+
13+
14+
## 5.1.6 (2018, February 1)
15+
16+
### Fixes
17+
- [#618](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/618) iOS app crashes straight after splash screen (iOS 11.2, iPhones X, 8 & 7 on simulator)
18+
19+
20+
## 5.1.5 (2018, January 30)
21+
22+
### Fixes
23+
- [#272](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/272) Unusual error message when retrieving data set and binding to layout
24+
25+
726
## 5.1.4 (2018, January 23)
827

928
### New

demo/app/main-page.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<TabViewItem.view>
1919
<ScrollView>
2020
<GridLayout columns="*, *"
21-
rows="auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto"
21+
rows="auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto, auto"
2222
horizontalAlignment="stretch"
2323
class="tab-content">
2424
<Button row="0" colSpan="2" text="init firebase - do this first" tap="{{ doWebInit }}" class="button button-positive"/>
@@ -48,17 +48,17 @@
4848
<Button row="11" col="0" text="ordered query" tap="{{ doWebQueryBulgarianCompanies }}" class="button button-company"/>
4949
<Button row="11" col="1" text="remove path" tap="{{ doWebRemoveCompanies }}" class="button button-company"/>
5050

51-
<Label row="12" col="0" text="Last update path:" class="message"/>
52-
<Label row="12" col="1" text="{{ path }}" class="message" textWrap="true"/>
51+
<Button row="12" col="0" text="store with key" tap="{{ doWebStoreCompanyByFirstCreatingKey }}" class="button button-company"/>
52+
<Button row="12" col="1" text="get server info" tap="{{ doWebGetServerInfo }}" class="button button-company"/>
5353

54-
<Label row="13" col="0" text="Key:" class="message"/>
55-
<Label row="13" col="1" text="{{ key }}" class="message" textWrap="true"/>
54+
<Label row="13" col="0" text="Last update path:" class="message"/>
55+
<Label row="13" col="1" text="{{ path }}" class="message" textWrap="true"/>
5656

57-
<Label row="14" col="0" text="Value:" class="message"/>
58-
<Label row="14" col="1" text="{{ value }}" class="message" textWrap="true"/>
57+
<Label row="14" col="0" text="Key:" class="message"/>
58+
<Label row="14" col="1" text="{{ key }}" class="message" textWrap="true"/>
5959

60-
<!--<Button row="10" col="0" text="query with range" tap="{{ doQueryBulgarianCompanies }}" class="button button-company"/>-->
61-
<!--<Button row="10" col="1" text="delete path" tap="{{ doRemoveCompanies }}" class="button button-company"/>-->
60+
<Label row="15" col="0" text="Value:" class="message"/>
61+
<Label row="15" col="1" text="{{ value }}" class="message" textWrap="true"/>
6262

6363
</GridLayout>
6464
</ScrollView>

demo/app/main-view-model.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export class HelloWorldModel extends Observable {
5151
public doWebLoginAnonymously(): void {
5252
this.ensureWebOnAuthChangedHandler();
5353
firebaseWebApi.auth().signInAnonymously()
54+
.then(() => console.log("User logged in"))
5455
.catch(err => {
5556
alert({
5657
title: "Login error",
@@ -64,6 +65,7 @@ export class HelloWorldModel extends Observable {
6465
public doWebLoginByPassword(): void {
6566
this.ensureWebOnAuthChangedHandler();
6667
firebaseWebApi.auth().signInWithEmailAndPassword('[email protected]', 'firebase')
68+
.then(() => console.log("User logged in"))
6769
.catch(err => {
6870
alert({
6971
title: "Login error",
@@ -79,7 +81,7 @@ export class HelloWorldModel extends Observable {
7981
if (!user || !user.email) {
8082
alert({
8183
title: "Can't fetch providers",
82-
message: "No user with emailaddress logged in.",
84+
message: "No user with an emailaddress logged in.",
8385
okButtonText: "OK, makes sense.."
8486
});
8587
return;
@@ -182,6 +184,18 @@ export class HelloWorldModel extends Observable {
182184
firebaseWebApi.database().ref(path).off("value");
183185
}
184186

187+
public doWebGetServerInfo(): void {
188+
const path = ".info";
189+
firebaseWebApi.database().ref(path)
190+
.once("value")
191+
.then(result => {
192+
this.set("path", path);
193+
this.set("key", result.key);
194+
this.set("value", JSON.stringify(result.val()));
195+
})
196+
.catch(error => console.log("doWebGetServerTime error: " + error));
197+
}
198+
185199
public doWebGetValueForCompanies(): void {
186200
const path = "/companies";
187201
firebaseWebApi.database().ref(path)
@@ -227,6 +241,22 @@ export class HelloWorldModel extends Observable {
227241
firebaseWebApi.database().ref(path).orderByChild(child);
228242
}
229243

244+
public doWebStoreCompanyByFirstCreatingKey(): void {
245+
const path = "companies",
246+
companyRef = firebaseWebApi.database().ref().child(path),
247+
newCompanyKey = companyRef.push().key,
248+
storeAtPath = `/${path}/${newCompanyKey}`,
249+
value = {
250+
name: `Company with key ${newCompanyKey}`,
251+
updateTs: firebase.ServerValue.TIMESTAMP
252+
};
253+
254+
firebaseWebApi.database().ref(storeAtPath).set(value).then(() => {
255+
this.set("path", storeAtPath);
256+
this.set("key", newCompanyKey);
257+
this.set("value", JSON.stringify(value));
258+
});
259+
}
230260

231261

232262
/***********************************************
@@ -1129,7 +1159,6 @@ export class HelloWorldModel extends Observable {
11291159
).then(
11301160
result => {
11311161
console.log("This 'result' should be available since singleEvent is true: " + JSON.stringify(result));
1132-
console.log("firebase.doQueryUsers done; added a listener");
11331162
},
11341163
errorMessage => {
11351164
alert({

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
},
1111
"dependencies": {
12-
"nativescript-plugin-firebase": "5.1.4",
12+
"nativescript-plugin-firebase": "5.1.5",
1313
"nativescript-theme-core": "^1.0.4",
1414
"nativescript-unit-test-runner": "^0.3.4",
1515
"tns-core-modules": "~3.4.0"

0 commit comments

Comments
 (0)