chemerisuk / cordova-plugin-firebase-config

Cordova plugin for Firebase Remote Config
MIT License
21 stars 31 forks source link

ERROR Error: Uncaught (in promise): TypeError: Object(...) #11

Closed devsubairariyil closed 4 years ago

devsubairariyil commented 5 years ago

I am getting the below error on integrating this library in my demo app. <vendor.js:1774 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at FirebaseConfig.getString (vendor.js:76672) at new HomePage (main.js:172) at createClass (vendor.js:12808) at createDirectiveInstance (vendor.js:12651) at createViewNodes (vendor.js:14109) at createRootView (vendor.js:13998) at callWithDebugContext (vendor.js:15423) at Object.debugCreateRootView [as createRootView] (vendor.js:14706) at ComponentFactory_.create (vendor.js:11603) at ComponentFactoryBoundToModule.create (vendor.js:4355) at c (polyfills.js:3) at c (polyfills.js:3) at polyfills.js:3 at t.invokeTask (polyfills.js:3) at Object.onInvokeTask (vendor.js:5076) at t.invokeTask (polyfills.js:3) at r.runTask (polyfills.js:3) at o (polyfills.js:3) defaultErrorLogger @ vendor.js:1774

Please find the source code below, `import { FirebaseConfig } from '@ionic-native/firebase-config/ngx';

@Component({ selector: 'page-home', templateUrl: 'home.html' }) export class HomePage {

constructor(public navCtrl: NavController, private firebaseConfig: FirebaseConfig) {

      this.firebaseConfig.getString('key_test', "")
          .then((res: any) => console.log(res))
          .catch((error: any) => console.error(error));

}

}`

rdss-jpupeter commented 5 years ago

@devsubairariyil do you use ionic 3 or ionic 4?

chemerisuk commented 4 years ago

Better to ask ionic team.

newuser44 commented 3 years ago

Any solution for this?
Getting the same error.
I'm on ionic 3.

this.firebaseConfig.getString("Android_Key").then(res => { alert("The value is " + res); return Promise.resolve; }) .catch(error => { alert("The error is " + error); return Promise.reject; })

TypeError: this.firebaseConfig.getString(...).then is not a function