sinch sending old deleted messages in onMessageSent - parse-platform

Why is sinch sending old deleted messages in onMessageSent of MessageClientListener? These messages were deleted in my Parse backend. I've deleted data of the app on phone, so sinch should n't have this locally. From where is Sinch bringing in all these messages and what should I do to avoid this?

hi sinch evangelist here.
I am going to try and explain this. Parse and Sinch has nothing to do with each other (we have a tutorial where we show how you can save messages to your own backend like parse) So the fact that you delete from parse has nothing to do with Sinch.
Regarding delivery of messages, we keep all messages for delivery to all devices a user might have for 30 days.
So if you i.e install your app on a new device and login we will ship those messages to that device. And we consider this to be a feature :D
I can agree with you that it might be confusing sometimes, since if you uninstall and app you will get all messages again.
I can see a couple of workarounds for this delete of app and deletions of messages.
You could either mark messages as deleted in parse and not display to the user, or look at timestamps.

Related

Teams proactive messages with uninstalled app

I'm trying to build a personal Teams bot which has to send proactive messages regularly. I made it work by storing the conversation when the user installed the app, just like the examples here. Now it works great, but I realized that I keep messaging users that have uninstalled my application. I can't seem to find any event that is triggered when a user uninstalls a personal scoped bot (app).
I tried conversation events, but nothing seems to be triggered for personal scoped bots at least.
I'm using the NodeJs botbuilder SDK.
Open to any suggestions, thanks.
To my knowledge, there is no such event unfortunately. I think you'll just receive a 403 at the moment without much info. This is due to change though - Microsoft just made an announcement about this yesterday in fact. See https://developer.microsoft.com/en-us/office/blogs/best-practices-and-updates-for-bot-lifecycle-events-in-microsoft-teams/ in the paragraph "Changes to post uninstall behavior for bots in personal scope":
Moving forward we’ll also align the post uninstall behavior for bots in the personal scope with the teams and groupChat scopes and you will not be able to send or receive messages after an app has been uninstalled. Your bot will receive a 403 response code to new messages posted by your bot. The 403 response code will have fields telling you the reason behind the it – which is either the app was uninstalled or the bot was blocked. We expect these changes to roll out in the coming few months.

How messenger works in sync with multiple devices

I am trying to introduce a messenger (chat) feature in my application.
I ma unable to figure out how to make the feature sync on multiple devices.
Let's say I am using the chat on my phone, and then I login to my desktop and start chatting there. How would I get the messages on both devices and how will both be in sync with each other. Additionally, for the sender to get a read confirmation, the message should be read from either one of the device, but the notification of unread should be shown on sender's device on which the message in unread unless he opens and reads it.
For First Part of the question you want to do Like FB Messenger where you loggin you will find your whole messages found not related to a device. To Achieve that you can have at the device app Last Login time which will be posted to the server, and all messages from that time will be retrieved to the user. But imagine the user has read all his messages from the mobile but he didnt open the computer since one Month. IF you didnt mark the message as read, he will find enourmous amount of messages coming as unread but he actually read on his mobile which will cause you huge usability issue.
For your Case I feel you need to do exaclty what FB Messenger does. Retrieve your latest messages from your conv with their actual status. And while scrolling up load by demand.
So Your Message will have only 1 Status(Read or UnRead) And date where you can match with Device Last Sync time.

Sending and receiving own message

Hi everyone.
I have right now a simple multiplayer game but it is out of sync.
If I could receive my own message from the RealTimeMessageReceivedListener that would be awesome but I can't.
How I am sending my info:
for(Participant p : participants){
Games.RealTimeMultiplayer.sendUnreliableMessage(_gameHelper.getApiClient(),message.getBytes(),roomId,p.getParticipantId());
}
As you can see I'm sending my messages to everyone (even to myself). However at the RealTimeMessageReceivedListener I don't receive any information about my own message.
can you help me with this?
The API does not allow this according to:
the Real-time Multiplayer documentation. See section on Sending Messages. Also, the "sender participant" needs to be excluded if you intend to switch to sending broadcast messages with the API instead;
rationale provided in issue submitted to the Google Play Plugin for Unity project on GitHub.

Looking for clarifications on how to build a group chat app using Sinch platform

I am trying to figure out how to use sinch to build a basic group messaging app. It looks pretty simple but I have a few questions to help me understand the platform:
1) It seems like the platform doesn't support multiple conversations for one user. For example facebook messenger allows you to have many conversations with different people (different chats). But sinch only lets you send a message to a user with no conversation meta data. Or is it possible to send your message with meta data?
2)Do you manage users on the sinch platform? This means creating user objects and giving them id's etc or must this be done on another platform like parse?
3)How do you handle messaging logs? Like if I send a message to someone that's not logged in- how do I save it and also send them a push notification that a message was sent?
Thanks for the help everyone- the documentation is a bit dilute so I haven't been able to find answers to these questions yet :/.
You can send meta data with headers, to create your own meta data thing. But to be fair Sinch is more like multi recipient message than groups with channels.
No, we use delegated security
We will automatically deliver the message when the user logs on, we keep messages for 30 days for delivery.

Debugging Google cloud messaging push messages

I am trying to send push messages to an android application.
The POST https://android.googleapis.com/gcm/send
seems to succeed and I get something (with some numbers changed) like:
{"multicast_id":9999063399994069899,
"success":1,
"failure":0,
"canonical_ids":0,
"results":[{"message_id":"0:1416520599679103%8d7d198de508343a"}]}
but I don't seem to get the notification on the device...
Is there anything that can be done with the message_id it track it forward ?
Can I somehow tell me if Google actually tired to deliver it to the device and what was the result of the attempt?
I know it's an old question and you might have solved it yourself by now, but for completeness I would like to post a solution here.
By now you can find the option GCM Diagnostics in your Google Play Developer Console when you have your app selected. It's placed on the left hand side.
You just post a registration token or a message id and will shortly see a summary of push notifications connected to this token/id, plus additional debug information.
Cheers!
well, at least until someone would provide a better answer about debugging based on message ids.
It turns out the problem in my case was that the phone gap plugin in I was using was expecting a "message" field in the push notification message payload.
A bug on my server side made this message not to exist so it was not displayed in the phones notification area...
my thanks to #Eran for partially pushing my towards the right line of thought.

Resources