Giter Club home page Giter Club logo

Comments (6)

fechanique avatar fechanique commented on September 7, 2024

I have checked myself and its working...

Maybe check that you are calling onNotification inside the onDeviceReady event handler

from cordova-plugin-fcm.

grassick avatar grassick commented on September 7, 2024

I double checked it and I'm calling it directly in document.addEventListener('deviceready', function() { ...

It works great when the app is in the foreground. I'm running Android 5.0.1 on an S4 with latest Cordova.

I get the success messages on the console too:

I/chromium(32319): [INFO:CONSOLE(5)] "FCMPlugin.js: is created", source: file:///android_asset/www/plugins/cordova-plugin-fcm/www/FCMPlugin.js (5)
I/chromium(32319): [INFO:CONSOLE(29)] "FCMPlugin Ready OK", source: file:///android_asset/www/plugins/cordova-plugin-fcm/www/FCMPlugin.js (29)
I/chromium(32319): [INFO:CONSOLE(10464)] "Cordova deviceready", source: file:///android_asset/www/js/app.js (10464)
I/chromium(32319): [INFO:CONSOLE(10464)] "fcm success!!", source: file:///android_asset/www/js/app.js (10464)

But no callback to the alert function, ever.

from cordova-plugin-fcm.

fechanique avatar fechanique commented on September 7, 2024

Make sure you are including:

"click_action":"FCM_PLUGIN_ACTIVITY",
and at least one data parameter in your payload

from cordova-plugin-fcm.

grassick avatar grassick commented on September 7, 2024

Worked like a charm. Thanks for the support!

from cordova-plugin-fcm.

bmwertman avatar bmwertman commented on September 7, 2024

I implemented the "click_action":"FCM_PLUGIN_ACTIVITY" fix and can redirect to the desired $state using UI-router if my app is in the background. But if the app is closed it only opens it to the $urlRouterProvider.otherwise() default state. How can I catch the app being opened from cold start by a click_action?

from cordova-plugin-fcm.

rakeshbaral92 avatar rakeshbaral92 commented on September 7, 2024

I implemented the "click_action":"FCM_PLUGIN_ACTIVITY" fix and can redirect to the desired $state using UI-router if my app is in the background. But if the app is closed it only opens it to the $urlRouterProvider.otherwise() default state. How can I catch the app being opened from cold start by a click_action?

Have you got a solution yet. Similar situation I am facing now. When app is closed or killed notification is coming but if I tap the notification then it only opens the first page. But I want to redirect to other page by clicking the notification.

from cordova-plugin-fcm.

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.