Get all dialogs in a QuickBlox application? - quickblox

Every one hour, our server has to notify all the users who haven't read the messages.
Can we do that with QuickBlox? We have the credentials of all users stored. So, we can login with each user and get his dialogs and check if there are any unread messages but that's a very long process. We can't login with each user. Is there any way we can get list of dialogs from the application level?

Related

Getting expo-token from logged in user

I am building my first multiuser react-native app with Expo and I am trying to set up notifications. In order to do that, I need to get the expo-token from a user. The way I logged in users is with AsyncStorage. How can I get the expo-token from a logged-in user so that I will send a user a notification once a different user makes an action?

Sending a mail using 365 instance

I am developing an app on Microsoft Teams, and I would like to send a mail with an instance of a logged in user.
This means that a user logs into my Microsoft Teams app, wants to send a custom mail that the app generated, now I want to send a request to my REST API to send this mail as the user.
I could not find any relevant information regarding sending an email like this, I only found methods to send emails with supplying username/password or using the current logged user on the machine (which I can't use since I want to do that using my REST API).
Example of what I found but is irrelevant:
https://www.add-in-express.com/creating-addins-blog/2011/09/02/outlook-create-send-message/
You don't mention if your app is a Tab or a Bot app (or something else), but I'm presuming a Tab. In any case, both Bots and Tab's offer the ability to do SSO sign-in of the user, in which case you can easily get a token for the user. In your backend API, you can exchange this for an "on behalf of" (OBO) token, which lets you access the Microsoft Graph API on the user's behalf. Once that's done, you can call the "send mail" operation on Graph.
To find out more about the above, see:
here for an excellent video overview on SSO with Tabs
here for a blog post on how to exchange the tokens and make the graph call securely
here for the specific operation in Graph (sending email)

How can I find telegram user by id

I'm using telegram bot and can get user id from incoming message.
Sometimes I want to find users who communicate with telegram bot and write them message by myself.
I have only user id and have not some additional information about the user.
Can I somehow find users by id or anonimity with only id available is by design?
At least what I've been using...
Program your bot to send you a message with link to that user.
This can be done by using link in your message (must be used as message entity or inline keyboard button):
tg://user?id=<user_id>
Or in case you are using MarkdownV2 for formatting
[inline mention of a user](tg://user?id=<user_id>)
Then, by clicking on that link, you will open a user profile, where you can message your target.
Note, user can change his privacy settings, and disable mentions. In this case these links will not work.

send notification to a particular user with notification hub - Azure and GCM

I am a software developer in Xamarin - Android, I want to create notification messages. For this purpose I use Azure notification hub, combined with Google's service - Google Cloud Messaging (GCM).
My problem comes when I want to send notification to a particular user. I realized that I need to use the "TAGS" When I compose a new user to the system (Uniqe TAG)
Indeed, it works great, but when the user logged off his account, and then connect to another one (with another TAGS) - the TAGS of his old account are kept in a certain time, and he continues to receive personal messages from the previous account!!!!
Does anyone know what can be done about it?
thank you very much
This is actually an issue a lot of people/apps have on iOS and Android.
What you should do is:
Register your app at your Azure Notification Hub (ANH) on first start and reregister at every app start, to keep registration in sync
If a user logs in, update the registration with an additional tag for this user (e.g. "user:XY")
Sending notifications to that user tag will of course result in notifications on all devices the user is logged in on
If a user logs out, update the registration without the user tag (omit the user tag, so the registration doesn't have user tag anymore afterwards)
The registration will be updated immediately on ANH and sending notifications to the user (tag) will not result in notifications on that specific client
If the user can logout on your app without internet connection, you won't be able to update the registration of course and you will still have the problem of getting notifications for a logged out user. But as soon as another user logs in, the registration should get updated with the new user tag and everything should be fine again...
What you shouldn't do:
"Developers should never unregister the client app as a mechanism for logout or for switching between users..."

How to send invitation to facebook friend from my application

Hi I am working on Rails application. My application is currently in 'invitation only' mode. What I want to do is once user signed up to my application then user should be able to invite his Facebook friends to my application. So what is the best way to do it? I want to do similar like pinterest does. pinterest is also in invitation only mode. But still it allows my facebook friend to whom I have sent an invite to sign up directly. So how I can implement it in my application? Any guidance will be helpful..
Use the requests dialog:
http://developers.facebook.com/docs/reference/dialogs/requests/
Store the list of user id's you get back (which you need to do anyhow
to delete the request programmatically when the come to your app)
When a user tries to login to your app, ensure that they're on your
list of id's you stored earlier.
Delete their app request
See http://developers.facebook.com/docs/reference/dialogs
Deleting Requests When a user is directed to your application, by
clicking a Request from the application, the games dashboard, or from
a Request notification, you must delete the request after it has been
accepted. Requests are not automatically deleted once they have been
clicked, thus it is the developer’s responsibility to clear them once
they have been consumed.