oracle / pushiomanager-react-native

React Native Module for Responsys SDK
Universal Permissive License v1.0
16 stars 17 forks source link

Background messages only work if the message priority is set to 'high' #59

Open giovanijfc opened 2 years ago

giovanijfc commented 2 years ago

Hello, I updated my react-native from version 0.66.3 to 0.69.5 and notifications on Android are not showing, iOS works normally.

Found this error in Android Studio Logcat:

2022-09-22 16:51:46.996 9240-9240/com.app E/RNFirebaseMsgReceiver: Background messages only work if the message priority is set to 'high' android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { cmp=com.app/io.invertase.firebase.messaging.ReactNativeFirebaseMessagingHeadlessService (has extras) }: app is in background uid UidRecord{b3a7cf6 u0a870 RCVR idle change:idle|uncached procs:0 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1941) at android.app.ContextImpl.startService(ContextImpl.java:1887) at android.content.ContextWrapper.startService(ContextWrapper.java:793) at android.content.ContextWrapper.startService(ContextWrapper.java:793) at io.invertase.firebase.messaging.ReactNativeFirebaseMessagingReceiver.onReceive(ReactNativeFirebaseMessagingReceiver.java:55) at android.app.ActivityThread.handleReceiver(ActivityThread.java:4843) at android.app.ActivityThread.access$1800(ActivityThread.java:315) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2297) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8751) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

JulioCVaz commented 1 year ago

the same here @neerhaj some solution?

adniltonsantos commented 1 year ago

heloo @JulioCVaz , aaah tu eh brasileiro , já ia mandar um INGLESHAO aqui kkk

https://github.com/oracle/pushiomanager-react-native/wiki/Android:-Handling-Push-Notifications-In-App-Background-or-Killed-State

cara tenta isso, tivemos o mesmo problema aqui na empresa e resolvemos com isso.

Qualquer coisa me chama. boa sorte .

JulioCVaz commented 1 year ago

Maravilha @adniltonsantos! Obrigado por compartilhar! Vamos implementar. 🤝

adniltonsantos commented 1 year ago

@giovanijfc

try this https://github.com/oracle/pushiomanager-react-native/wiki/Android:-Handling-Push-Notifications-In-App-Background-or-Killed-State

Solved it for me , But if you use Firebase push, I'm having a problem with multiple Oracle notification pushes


@JulioCVaz , se voce utiliza firebase , tome cuidado ... estou tendo problema com multiplos envios de notificacao da sdk da oracle apos ter recebido pelo menos uma notificacao de push do firebase , abrindo um chamado pra eles verem isso..

AndriySikora commented 9 months ago

The issue is solvable with those changes - https://github.com/oracle/pushiomanager-react-native/wiki/Android:-Handling-Push-Notifications-In-App-Background-or-Killed-State

It is not recommended to set priority to 'High', but in case it is needed please check the following docs:

High priority messages for the Android platform should be requested from Oracle.