Giter Site home page Giter Site logo

Comments (10)

dpa99c avatar dpa99c commented on August 16, 2024 3

As you'll see from the CHANGELOG, this fork has deviated from cordova-plugin-firebase such that cordova-plugin-firebasex is no longer the same plugin as cordova-plugin-firebase - it has a different API and behaviour, e.g. onNotificationOpen() renamed to onMessageReceived()

The @ionic-native/firebase wrapper points at cordova-plugin-firebase so if you want to use this fork, you'll need to use it directly via the JS API rather than via the Ionic Native Typescript wrapper for cordova-plugin-firebase.

from cordova-plugin-firebasex.

hiepxanh avatar hiepxanh commented on August 16, 2024 1

I feel you, we can have this transform as onNotificationOpen:

onNotificationOpen() {
      return new Observable(observer => {
            (window as any).FirebasePlugin.onMessageReceived((response) => {
                observer.next(response);
            });
       });
}

from cordova-plugin-firebasex.

Abdulrahmanh995 avatar Abdulrahmanh995 commented on August 16, 2024

@dpa99c Does downgrading cordova-plugin-firebasex to version 4.0.0 resolve onNotificationOpen problem?

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on August 16, 2024

@Abdulrahmanh95 v4.0.0 is out-of-date with respect to the version which contains numerous bug fixes and additional features. I would not recommend using 4.0.0 for this reason.

from cordova-plugin-firebasex.

Abdulrahmanh995 avatar Abdulrahmanh995 commented on August 16, 2024

@dpa99c Thanks a lot.
I've just fix it with version 6 is working properly with my ionic 3 application.

from cordova-plugin-firebasex.

benskarunya avatar benskarunya commented on August 16, 2024

@Abdulrahmanh95,
I am using ionic 3 and added this plugin as well. And i am struck without import firebase how to use the methods? can i get some sample script. Thanks Benny

from cordova-plugin-firebasex.

hiepxanh avatar hiepxanh commented on August 16, 2024

before:
this.firebase.onNotificationOpen();
after:
(this.firebase as any).onMessageReceived();

from cordova-plugin-firebasex.

Abdulrahmanh995 avatar Abdulrahmanh995 commented on August 16, 2024

@benskarunya
You just have to use without firebase service (using plain JavaScript):

(<any>window).FirebasePlugin.onNotificationOpen(function (response) {
    if (response.tap) { console.log('push to some page'); }
 })

and you can receive the token the same way:

(<any>window).FirebasePlugin.getToken(function (token) { console.log('token', token); })

from cordova-plugin-firebasex.

sahyun1 avatar sahyun1 commented on August 16, 2024

I'm getting Cannot read property 'setScreenName' of undefined

if I do ionic cordova run android
and set a breakpoint, FirebasePlugin is undefined..
(window as any).FirebasePlugin

anyone have any idea..?

from cordova-plugin-firebasex.

sahyun1 avatar sahyun1 commented on August 16, 2024

my bad make sure you use cordova android >8

from cordova-plugin-firebasex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.