Git Product home page Git Product logo

Comments (6)

jarthod avatar jarthod commented on September 7, 2024

Hello,

Thanks for the report, do you confirm that you already DO receive push notification and call consumeReceivedRemoteNotification, if you add some logging before this call for example you can see the notification?

What is the return value of consumeReceivedRemoteNotification in this case?
In which state are you, is the app closed, opened ? is the chat opened ?

Did you implement Dimelo.BasicNotificationDisplayer or Dimelo.NotificationDisplayer ?
The most probably cause is that the user identifier or installation id in the notification is not the same as in the app (last message in the chat sent as a different user). Is the notification you're testing received on the same instance and for the same user which wrote the last chat message?

from engage-digital-messaging-android.

 avatar commented on September 7, 2024

I receive intent of notification and call consumeReceivedRemoteNotification, it returns false, at that moment app is opened, but chat is not opened.
I use own implementation of BasicNotificationDisplayer, but I override only createPendingIntent and this method is not called when I try to handle notification.
I test the app on the same instance and with the same user. Whether it is possible that when I set the jwt, the user identifier is nullified, and because of it the notification is not processed?

from engage-digital-messaging-android.

jarthod avatar jarthod commented on September 7, 2024

If consumeReceivedRemoteNotification returns false it means the SDK did not recognized the notification as valid for this chat, there can be several reasons but the most probably in your case is that the notification's user_id or installation_id did not match the one provided to the SDK receiving it.

Could you please share a notification payload? (you can display it just before calling consumeReceivedRemoteNotification) and could you please also display the value of getUserIdentifier() and getInstallationIdentifier() on the Dimelo chat instance at the same time?

If you're using the JWT authentication, what's possible also is that the JWT payload returned by your server does not contain the same userIdentifier as the one you set in your app, if that's the case it should be visible in the debug I asked you to display above.

Thanks !

from engage-digital-messaging-android.

 avatar commented on September 7, 2024

Extras of the notification intent.
Bundle[{google.sent_time=1499241925641, dimelo=1.0, appdata={"a":false,"uid":"101059932","s":"a","t":"m","d":1499241925,"u":"Team Mobile","i":"5381ab1f-d13f-42df-93a4-9af0dac34287","uuid":"a65d05b6-36f7-420c-8b1a-5f3a1e2e95df","tr":false,"n":1}, from=1092766345379, alert=test, google.message_id=0:1499241925660648%1b50ee93f9fd7ecd}]

Values at the time of the calling consumeReceivedRemoteNotification
getJwt()
eyJhbGciOiJIUzI1NiJ9.eyJleHRyYSI6eyJuYW1lIjoiRVJJQyIsImJwIjoiMDEwMTA1OTkzMiIsImxhc3RuYW1lIjoiRkFMTEFTIiwiZW1haWwiOiJmYWxsYXMuZXJpY0BnbWFpbC5jb20ifSwidXNlcklkIjoiMTAxMDU5OTMyIiwidXNlck5hbWUiOiJNLiBFUklDIEZBTExBUyIsImFwaUtleSI6ImMzYzM3NDdlZTMzNjMyYzY2Zjg2NzRjM2Y3ZmQ0MTM3MzkwNmMyOWNiYjlmNDQ0YmYwNzViYjhmN2YwY2Y5Y2YiLCJpbnN0YWxsYXRpb25JZCI6IjUzODFhYjFmLWQxM2YtNDJkZi05M2E0LTlhZjBkYWMzNDI4NyJ9.Q-rVsshEjR3DLTEnRISHhfmAP1oF5vjSD4tQ20l1jwI

getUserIdentifier()
null

getInstallationIdentifier()
5381ab1f-d13f-42df-93a4-9af0dac34287

from engage-digital-messaging-android.

jarthod avatar jarthod commented on September 7, 2024

Ok thanks for these details!
That's what I though, your JWT contains a userId (101059932) but the Dimelo client isn't initialized with one (getUserIdentifier() == null). That's why the notification is ignored, because it means it's not for the currently connected account. You need to set the userIdentifier on the Dimelo instance when you instantiate it, even if you use JWT authentication.

from engage-digital-messaging-android.

jarthod avatar jarthod commented on September 7, 2024

Did you manage to fix this issue?

from engage-digital-messaging-android.

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.