@Manel00 wrote:
Hi everyone,
I’m trying to show a local notification when there is a new firestore document on 1 collection, but i’m getting the error when i import into .ts this:
[ng] ERROR in node_modules/firebase-functions/lib/function-configuration.d.ts(4,64): error TS1005: ']' expected. [ng] node_modules/firebase-functions/lib/function-configuration.d.ts(4,66): error TS1134: Variable declaration expected. [ng] node_modules/firebase-functions/lib/function-configuration.d.ts(4,153): error TS1005: ';' expected. [ng] node_modules/firebase-functions/lib/function-configuration.d.ts(16,61): error TS1005: ']' expected. [ng] node_modules/firebase-functions/lib/function-configuration.d.ts(16,63): error TS1134: Variable declaration expected. [ng] node_modules/firebase-functions/lib/function-configuration.d.ts(16,93): error TS1005: ';' expected.
My code on TS:
import * as functions from 'firebase-functions'; initializeApp() { this.platform.ready().then(() => { this.statusBar.styleDefault(); this.splashScreen.hide(); this.activateNotifications(); }); } activateNotifications() { var x = functions.firestore .document('objects/{wildcard}') .onCreate((snap, context) => { const data = snap.data(); const name = data.name const title = data.title const message = `${name} uploaded ${title}, this one looks interesting :P` this.notifications.schedule({ badge: 1, title: 'New OBject!!!', text: message, foreground: true, }); }); }
Posts: 1
Participants: 1