Git Product home page Git Product logo

Comments (3)

hansemannn avatar hansemannn commented on May 26, 2024

You have to require „firebase.core“ and call configure(args) first.

from titanium-firebase.

DCareClues avatar DCareClues commented on May 26, 2024

This is the code which I am trying

var core = require('firebase.core');
var fcm = require('firebase.cloudmessaging');

// Configure core module (required for all Firebase modules)
core.configure();

// Called when the Firebase token is ready
fcm.addEventListener('didRefreshRegistrationToken', onToken);

// Called when direct messages arrive. Note that these are different from push notifications
fcm.addEventListener('didReceiveMessage', onMessage);

fcm.registerForPushNotifications();

function onToken(e) {
    Ti.API.info('Token', e.fcmToken);
}

function onMessage(e) {
    Ti.API.info('Message', e.message);
}

This is the exception

[ERROR] :  TiExceptionHandler: (main) [0,655] - Message: Uncaught Default FirebaseApp is not initialized in this process com.careclues.patient. Make sure to call FirebaseApp.initializeApp(Context) first.
[ERROR] :  TiExceptionHandler: (main) [0,655] - Source: 		fcm.registerForPushNotifications();
[ERROR] :  V8Exception: Exception occurred at /alloy/controllers/index.js:65: Uncaught Default FirebaseApp is not initialized in this process com.careclues.patient. Make sure to call FirebaseApp.initializeApp(Context) first.
[ERROR] :  V8Exception: Default FirebaseApp is not initialized in this process com.careclues.patient. Make sure to call FirebaseApp.initializeApp(Context) first.

from titanium-firebase.

hansemannn avatar hansemannn commented on May 26, 2024

You should pass the configuration arguments like projectId.

from titanium-firebase.

Related Issues (18)

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.