1- import * as firebase from "nativescript-plugin-firebase" ;
2- import { AddEventListenerResult , admob as firebaseAdMob , crashlytics as firebaseCrashlytics , GetRemoteConfigResult , IdTokenResult , LogComplexEventTypeParameter , performance as firebasePerformance , storage as firebaseStorage , User } from "nativescript-plugin-firebase" ;
3- import { RewardedVideoAdReward } from "nativescript-plugin-firebase/admob/admob" ;
4- import { FirebaseTrace } from "nativescript-plugin-firebase/performance/performance" ;
5- import { Observable } from "tns-core-modules/data/observable" ;
6- import * as fs from "tns-core-modules/file-system" ;
7- import { isAndroid , isIOS } from "tns-core-modules/platform" ;
8- import { alert , prompt } from "tns-core-modules/ui/dialogs" ;
1+ import { firebase , AddEventListenerResult , admob as firebaseAdMob , crashlytics as firebaseCrashlytics , GetRemoteConfigResult , IdTokenResult , LogComplexEventTypeParameter , performance as firebasePerformance , storage as firebaseStorage , User } from "@nativescript/firebase" ;
2+ import { RewardedVideoAdReward } from "@nativescript/firebase/admob/admob" ;
3+ import { FirebaseTrace } from "@nativescript/firebase/performance/performance" ;
4+ import { Observable , isAndroid , isIOS , Dialogs , knownFolders , File } from "@nativescript/core" ;
95import { UploadMetadata } from "../../src/storage/storage" ;
106import { MessagingViewModel } from "./messaging-view-model" ;
117
12- const firebaseWebApi = require ( "nativescript-plugin- firebase/app" ) ;
8+ const firebaseWebApi = require ( "@ nativescript/ firebase/app" ) ;
139
1410declare const Crashlytics : any ;
1511
@@ -309,7 +305,7 @@ export class HelloWorldModel extends Observable {
309305
310306 public doWebUploadFile ( ) : void {
311307 // let's first create a File object using the tns file module
312- const appPath = fs . knownFolders . currentApp ( ) . path ;
308+ const appPath = knownFolders . currentApp ( ) . path ;
313309 const logoPath = appPath + "/images/telerik-logo.png" ;
314310
315311 const storageRef = firebaseWebApi . storage ( ) . ref ( ) ;
@@ -324,7 +320,7 @@ export class HelloWorldModel extends Observable {
324320 }
325321 } ;
326322
327- childRef . put ( fs . File . fromPath ( logoPath ) , metadata ) . then (
323+ childRef . put ( File . fromPath ( logoPath ) , metadata ) . then (
328324 uploadedFile => {
329325 console . log ( "Uploaded! " + JSON . stringify ( uploadedFile ) ) ;
330326 this . set ( "storageFeedback" , "Uploaded!" ) ;
@@ -341,7 +337,7 @@ export class HelloWorldModel extends Observable {
341337 const childRef = storageRef . child ( "uploads/images/telerik-logo-uploaded.png" ) ;
342338
343339 // let's first determine where we'll create the file using the 'file-system' module
344- const documents = fs . knownFolders . documents ( ) ;
340+ const documents = knownFolders . documents ( ) ;
345341 const logoPath = documents . path + "/telerik-logo-downloaded.png" ;
346342
347343 childRef . download ( logoPath )
@@ -1666,7 +1662,7 @@ export class HelloWorldModel extends Observable {
16661662
16671663 public doUploadFile ( ) : void {
16681664 // let's first create a File object using the tns file module
1669- const appPath = fs . knownFolders . currentApp ( ) . path ;
1665+ const appPath = knownFolders . currentApp ( ) . path ;
16701666 const logoPath = appPath + "/images/telerik-logo.png" ;
16711667
16721668 const metadata : UploadMetadata = {
@@ -1680,7 +1676,7 @@ export class HelloWorldModel extends Observable {
16801676
16811677 firebaseStorage . uploadFile ( {
16821678 remoteFullPath : 'uploads/images/telerik-logo-uploaded.png' ,
1683- localFile : fs . File . fromPath ( logoPath ) , // use this (a file-system module File object)
1679+ localFile : File . fromPath ( logoPath ) , // use this (a file-system module File object)
16841680 // localFullPath: logoPath, // or this, a full file path
16851681 onProgress : status => {
16861682 console . log ( "Uploaded fraction: " + status . fractionCompleted + " (" + status . percentageCompleted + "%)" ) ;
@@ -1702,7 +1698,7 @@ export class HelloWorldModel extends Observable {
17021698
17031699 public doDownloadFile ( ) : void {
17041700 // let's first determine where we'll create the file using the 'file-system' module
1705- const documents = fs . knownFolders . documents ( ) ;
1701+ const documents = knownFolders . documents ( ) ;
17061702 const logoPath = documents . path + "/telerik-logo-downloaded.png" ;
17071703
17081704 // this will create or overwrite a local file in the app's documents folder
0 commit comments