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

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Oct 8, 2018
1 parent dc2c6cb commit 085f45f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion demo-ng/app/tabs/firestore/firestore.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export class FirestoreComponent {
.set({
name: "Woofie",
last: "lastofwoofie",
lastKnownLocation: firebase.firestore().GeoPoint(5.34, 6.67),
lastKnownLocation2: firestore.GeoPoint(5.34, 6.67)
// note that this only works on iOS (there's a limitation in the Firestore Android SDK)
// updateTsSet: firebase.firestore().FieldValue().serverTimestamp()
},
Expand Down Expand Up @@ -143,7 +145,8 @@ export class FirestoreComponent {
city: sfDocRef,
updateTs: firestore.FieldValue.serverTimestamp(),
updateTsAlt: firebase.firestore().FieldValue().serverTimestamp(),
lastKnownLocation: firebase.firestore().GeoPoint(4.34, 5.67)
lastKnownLocation: firebase.firestore().GeoPoint(4.34, 5.67),
lastKnownLocation2: firestore.GeoPoint(4.34, 5.67)
})
.then(() => console.log("Woofie updated"))
.catch(err => console.log("Updating Woofie failed, error: " + JSON.stringify(err)));
Expand Down
6 changes: 3 additions & 3 deletions src/firebase-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export class FieldValue {
constructor(public type: firestore.FieldValueType, public value: any) {
};

serverTimestamp = () => "SERVER_TIMESTAMP";
arrayUnion = (fields: Array<any>) => new FieldValue("ARRAY_UNION", fields);
arrayRemove = (fields: Array<any>) => new FieldValue("ARRAY_REMOVE", fields);
static serverTimestamp = () => "SERVER_TIMESTAMP";
static arrayUnion = (fields: Array<any>) => new FieldValue("ARRAY_UNION", fields);
static arrayRemove = (fields: Array<any>) => new FieldValue("ARRAY_REMOVE", fields);
}

export class GeoPoint {
Expand Down
4 changes: 2 additions & 2 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-plugin-firebase",
"version": "7.1.2",
"version": "7.1.3",
"description": "Fire. Base. Firebase!",
"main": "firebase",
"typings": "index.d.ts",
Expand Down Expand Up @@ -61,7 +61,7 @@
"ci.tslint": "npm run tslint && npm run tslint.demo",
"development.setup": "npm run setup && npm link && cd ../demo && npm link nativescript-plugin-firebase && cd ../src",
"generate.typings.ios": "cd ../demo-ng && TNS_DEBUG_METADATA_PATH=\"$(pwd)/metadata\" tns build ios && TNS_TYPESCRIPT_DECLARATIONS_PATH=\"$(pwd)/typings\" tns build ios && echo 'Now look for your library typings in demo-ng/typings!'",
"generate.typings.android": "echo '##### Download the latest relevant .aar file from https://mvnrepository.com/artifact/com.google.firebase, rename .aar to .zip and extract it. Then move classes.jar to the plugin /src folder' && java -jar ../../android-dts-generator/dts-generator/build/libs/dts-generator.jar -input ./classes.jar -output platforms/android/typings/$npm_package_config_typings && rimraf classes.jar && echo '##### Done! Deleted src/classes.jar and generated typings in src/platforms/android/typings/'",
"generate.typings.android": "echo '##### Download the latest relevant .aar file from https://mvnrepository.com/artifact/com.google.firebase, rename .aar to .zip and extract it. Then move classes.jar to the plugin /src folder' && java -jar ../../android-dts-generator/dts-generator/build/libs/dts-generator.jar -input ./classes.jar -output platforms/android/typings/$npm_package_config_typings && rimraf classes.jar && echo '##### Done! Deleted src/classes.jar, and generated typings in src/platforms/android/typings/'",
"generate.typings.android.analytics": "npm run generate.typings.android --nativescript-plugin-firebase:typings=analytics-impl",
"generate.typings.android.auth": "npm run generate.typings.android --nativescript-plugin-firebase:typings=auth",
"generate.typings.android.core": "npm run generate.typings.android --nativescript-plugin-firebase:typings=core",
Expand Down

0 comments on commit 085f45f

Please sign in to comment.