Giter Site home page Giter Site logo

Comments (5)

dpa99c avatar dpa99c commented on July 17, 2024

Your options are:

  1. Use this forked plugin directly via its Javascript API (vs Ionic Native Typescript API), e.g.
window['FirebasePlugin'].onTokenRefresh((token) => {
    console.log("Token refreshed: " + token);
}, (error) => {
    console.error("Failed to refresh token: " + error);
});
  1. Locally hack the Ionic Native plugin configuation in node_modules/@ionic-native/firebase/ - search and replace any references to cordova-plugin-firebase with cordova-plugin-firebasex

  2. Raise an issue against Ionic Native

from cordova-plugin-firebasex.

T-moz avatar T-moz commented on July 17, 2024

@dpa99c I just tried the first option you propose and it's not working. I can build my application, but the token is not refreh, and i don't recieve notification.

from cordova-plugin-firebasex.

T-moz avatar T-moz commented on July 17, 2024

How exactly window['FirebasePlugin'] is working ?

from cordova-plugin-firebasex.

dpa99c avatar dpa99c commented on July 17, 2024

This plugin exposes its API as FirebasePlugin in the global Javascript namespace.

So from JS you'd reference it as window.FirebasePlugin, e.g. window.FirebasePlugin.onTokenRefresh().

But since Ionic is Typescript-based, window.FirebasePlugin will raise a lint error because FirebasePlugin is not a defined property of the window object.
So by referencing the key as a string (window['FirebasePlugin']), it passes Typescript validation and allows you to reference the plugin's JS API directly.

For a working reference illustrating this plugin's usage, see the example project which references the JS API directly

from cordova-plugin-firebasex.

T-moz avatar T-moz commented on July 17, 2024

@dpa99c Thank you, i going to take a look !

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.