Giter Site home page Giter Site logo

Comments (7)

rdelrosario avatar rdelrosario commented on June 14, 2024

What payload are you sending?

from pushnotificationplugin.

rdelrosario avatar rdelrosario commented on June 14, 2024

Posible duplicate of: #13

from pushnotificationplugin.

javilopezruiz avatar javilopezruiz commented on June 14, 2024

I am sending this notification always:

'notification' => [
'title'=>'This is the title',
'body'=>'This is the message',
'sound' => 'default'
]

And the error appears when app in foreground only.

Version of your plugin: 1.1.2

from pushnotificationplugin.

javilopezruiz avatar javilopezruiz commented on June 14, 2024

It has to do with the sound..
If I delete the 'sound' key, then everything works fine in foreground and the device sounds when getting the notification.. but when app is not in foreground the device does not sound when it receives the push notification

What can I do to solve this?

Using FCM by the way..

from pushnotificationplugin.

javilopezruiz avatar javilopezruiz commented on June 14, 2024

Okay, solved. If you send this using FCM it works perfect in background and in foreground:
'data' => [
'title'=>'This is the title',
'body'=>'This is the message'
]

from pushnotificationplugin.

javilopezruiz avatar javilopezruiz commented on June 14, 2024

I realized that notification is not received when app is killed. Using data message in notification payload in FCM.

And you say in your documentation:

captura de pantalla 2017-11-25 a les 19 08 55

The situation is:

  • If the payload contains only the 'notification' key, it works when app is killed or in background and plays the default sound. But crashes the app when in foreground.
  • If the payload contains only the 'data' key, it works when app is in foreground/background and plays the default sound, but does nothing if app is killed (no notification, no sound, no crash).

from pushnotificationplugin.

rdelrosario avatar rdelrosario commented on June 14, 2024

The exception issue was happening when using sound on the payload. Should be fixed on latest release: https://www.nuget.org/packages/Plugin.PushNotification/1.1.5.

About the other issue, please open a new one and let me know what are you doing on the OnNotificationReceived and if is a Xamarin Forms application.

from pushnotificationplugin.

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.