How to catch a new chat message in an app using Quickblox (outside of the ChatView)? - quickblox

Using Quickblox it is very easy to send and receive messages when you're in the chat view. But what happens when you're not in the chat view and you receive a message? What is the best way to catch that new chat message in the app?
should I use notifications and rely on the appDelegate's didReceiveRemoteNotification? Or is there another way? (As I understand, remote notifications can be slower and less reliable than the chat itself).

You are right, you can use push notifications, if you are not in the chat.
Please find needed here http://quickblox.com/modules/messages/

Related

Prevent device notification client side with React Native Firebase when a FCM notification arrives (based on user preferences)

I'd like to know if there any a way to prevent the device display a notification when a FCM message with a notification arrives, in case the user has decided to mute notifications and only have them arrive silently (making them act as data only messages, but being notification messages). I imagine like, in the handler/callback call a method to prevent the device notification and do extra processing afterwards.
I know I can use data only messages, but that approach would be harder since I must use multiple topics or token lists and somewhat more backend logic to achieve that.
Thanks
If the message contains a notification property, it is automatically handled by the OS when the app is not active. There is nothing you can do to prevent that.
As you said: if the message only contains a data property, it is always passed to your code for handling, and you can decide what to do with it. So that's the way to go if you want full client-side control over whether a notification is displayed for a message.

Can we send collection of messages in QuickBlox using Android SDK

We are using QuickBlox Android SDK and are giving the users offline support for sending messages! So, there are situations where user is sending messages when he is offline. And when network comes we will have to send all those unsent messages.
Problem is, now I am able to send those messages one at a time using,
QBChatService.createMessage(message, QBEntityCallback())
But certainly, this is not really an optimised way. We need to send all messages at once.
Is there any way to solve this problem?
Currently there is no such possibility of sending bulk messages

Showing shell Toast notification on receiving message

I am trying to make a chat app using XMPP protocol. The app is working fine except it doesn't show message notification when the app is in background. In Android I have used a Service for this purpose, however in Windows Phone I couldn't find anything similar to this.
I am trying Background Tasks for this, but as far as I have understood, they're made to run on prespecified trigger and I cannot add any custom trigger to it. In Android I have put my socket connection and parsing message calls in the service itself so that they can run on background too and the socket doesn't get closed even when the app is stopped.
So my question is, is there any similar way to do it in Windows Phone 8.1 (WinRT, not silverlight) or if Background Task is the only option, can you suggest a way to implement the notification functionality. I don't need the exact code, I just need a push to the right direction.
First: You cannot run a network connection in background.
Suggested way is using PushNotifications:
Either directly with a Toast Notification
Or with a PushTrigger to handle a Raw Notification, work out what to do
with it (who was it from, prepare data, etc.) and then create a ShellToast from it. Adds flexibility and improves user experience, but is quite complex.
Known downside: You have to use a server.
Only workarounds: Background-Tasks that checks for new messages about every 30 Minutes.

Sending Push notification from client - Worklight

I know that push notifications are being sent from a backend server. Is it possible to send notification from client itself? My application goes like this: It acquires its position using Location services API. once it enters a specific circle, the trigger calls a callback function. What i want to do is to use the callback function to push a notification to the device. Is there any way to do this?
Thank you very much in advance!
If you just want a notification when the app is active in the background, you can use local notifications: https://github.com/katzer/cordova-plugin-local-notifications. The plug-in Javascript has to be modified somewhat to work with a Worklight app, but with some simple modifications it works great, and allows your app running in the background to raise a notification without going through the server side round trip involved when using push.
That said, I implemented an app that did exactly what you are looking for (in my case, I needed some server side processing to figure out what the text of the push message should be) The geo-fence callback called an adapter, providing it with event details and the device ID. The adapter determined what message to send, and used unicast push to send it back to the device.
You can invoke a procedure in the client side. I tried to invoke in the client side with httpAdapter and its working.
If the notification doesn't need to come from the server, you can also create a service that will run in the background and show a dialogbox once it enters the geofence.

asmack - make sent message don't shown in Gtalk

I have added online playing function for my chess game, with the help of asmack api. It works, but there's some minor issues left:
When I send/receive messages, these messages are not only received by by my game client, but also captured by Gtalk client on android phone. It's annoying and may bother user. How to make these messages captured just by my game client?
Thanks.
Did you have forgot to implement a MessageListener?