Server side XMPP client for QuickBlox using Smack - smack

I'm building a chat application using QuickBlox, and I understand that it provides SDKs for Android/iOS/JS. As part of the implementation, I have to implement a server side bot that can chat with users. Is it possible to create a XMPP client on the web server that can maintain a stateful connection with QuickBlox's cloud and act as a client, and thus chat with users as a bot? I was planning on using Smack, but I'm totally unsure of how to integrate that with QuickBlox.
I've seen a python implementation of a possible server side bot, but I was looking for a Java based solution.
QuickBlox doesn't provide a Java SDK. Can anyone point me to a sample code that uses Smack and talks to QuickBlox?
Thanks!

There is another one Python bot implementation with some commands set
https://github.com/soulfly/MehDoh-q-municate-chat-xmpp-bot
it works with QuickBlox Q-municate http://qm.quickblox.com
and you can try to play with it - it's a user with name I am IgorK, just register and add him as a friend.
With Java and Smack it's also possible
How to start:
Use Smack guide to understand how it works https://www.igniterealtime.org/builds/smack/docs/latest/documentation/gettingstarted.html
Register an account in QuickBlox Admin panel and create an application there - use 5 mins guide http://quickblox.com/developers/5_Minute_Guide
Then go to Users module in admin panel and create a couple of users
Here is how to connect to QuickBlox Chat http://quickblox.com/developers/Chat#Connecting_to_server . Just build user's jid and password using users you created in admin panel and then use these credentials for Smack
that's all, should be quite simple

Related

How to implement "Use one-click single sign-on" correctly in order to publish to Google Apps Marketplace

We already have a web app that integrate with differente Google services. Right now, you can loguin using a Google account, can import a contact lists from any Google account, and can sync a Google Calendar with our Calendar in the webapp (We implemented all of this using OAuth 2 and invoking the GoogleApi with a REST Client).
We are now trying to publish this app in the GoogleApp Marketplace, but we are failing to comply with the "Use one-click single sign-on" rule (https://developers.google.com/apps-marketplace/practices#5_use_one-click_single_sign-on).
We are believing that the problem is we the way we are solving the fact that we need offline access for all the integrated users in the app. Right now, the only way we found to get the refresh tokens for them, was starting the OAuth2 process with the parameters access_type=offline&approval_prompt=force, but this forces them to enter their credentials.
We aren't using the 'Google+ Domains API', and we are starting to believe that we should. Is the use of this API mandatory for complying with the "Use one-click single sign-on" rule?
Thanks,
Well, we finally figured it out. We had to use the Google Admin SDK in order to implement SSO. We had some troubles with the scopes, but after we polished that, everything seems to be working OK.

Push Notifications Using Notification Hub and .NET Web API as Backend

I am working on a project where I have implemented web API with asp.net identity to authenticate users. An iPhone app will be accessing this web API in order to perform several tasks like authorization using identity db, subscribe to groups etc.
I am going to publish this web API in windows azure and going to use Azure notification hub for sending the notifications. Now in my iPhone app the user can subscribe to one or more groups to get notified to that group events. i.e A user can subscribe to "Cricket" and "Math" group in order to receive the notifications of that groups. So these groups really becomes Tags for the notification hub.
Now my question is There are two ways to register device to notification hub.
1) using app itself
2) using the web API that I have created.
I want to follow the second approach. I want the users devices to be registered to notification hub through my web API.
How can I achieve that? I didn't found any satisfactory code snippet for this purpose. Can any one provide me better clarification or code snippet on this?
Thanks
you can refer to the following link- http://www.ankitblog.com/2014/11/azure-notificationhub-sending-push.html and http://www.codeproject.com/Tips/845491/Azure-Notificationhub-Sending-Push-Notification-to for details of that. Its fairly simple

Gtalk implementation in iOS

Is there any way to implement Gtalk in iOS application,i just want to create an application, in which user can simply login with his/her gmail account and, chat with those people who are in his chat list.
if any one know how to do this, then please help me.
thanks in advance
Google Talk uses XMPP (Extensible Messaging and Presence Protocol). You can use for example the XMPPFramework framework to implement it. This framework is listed on a XMPP Foundation website.
XMPPFramework provides a core implementation of RFC-3920 (the xmpp
standard), along with the tools needed to read & write XML.
Check out the Getting Started Guide for iOS. It contains an example iOS project.
Furthermore, have a look into Google Talk Developer Documentation. There is a section called: I want to build a client that connects to the Google Talk service which describes steps you should take to implement a client.

What is the most efficient way to create end-points for an Amazon SNS service?

I am using Amazon SNS Service for an iOS application that needs push notifications.
I have figured most of the things, except for the part where I have to register my device tokens.
This is where Amazon talks about it. It can be done manually or with the help of createPlatformEndpoint API which they obviously recommend for bulk uploads. My question is how we can directly register tokens from devices that will install the app later on. The documentation talks about a proxy server which I would want to avoid as of now. Isn't there a direct way of doing this, like where I can directly call a method and push the device token received in the application to my SNS Platform?
This, is a possible duplicate except that it is in reference to Android.
The AWS Mobile SDKs support accessing SNS directly from the mobile device. If you're interested in seeing code demonstrating this on iOS, we included some as a sample we prepared for re:Invent 2013 called Mobile Photo Share.
The important thing to note when accessing SNS directly from the mobile device is that you'll want to restrict the credentials delivered to the device to only those services and resources you'll need to access. You can accomplish this via web identity federation or a token vending machine with appropriately restricted policy.
If you want to learn more about the Mobile Photo Share app, we had two talks at re:Invent about the app and its architecture. The video and slides for those talks are available here:
Building Cloud-Backed Mobile Apps
Integrating Social Login Into Mobile Apps

What do I need for integrating XMPP into Rails?

Here's what I have so far.
XMPP Server - Ejabberd or Vine
XMPP Library in Rails - Blather
XMPP Library on Client - Strophe.js
Is this what I need to integrate chat into my rails app?
EDIT: from the creator of Vine.
"It's probably safer to use ejabberd, since its a more full-featured server than vines."
I would have add a comment but unfortunately I don't have enough reputation yet.
If you want to do your chat client side, Strophe is recommended. If you want to store some conversations, you'll do it server-side, but not 'rails server'-side, you should do it 'xmpp server'-side : Ejabberd should store your old messages, romm topics or your contact list. It's his job.
Blather could be usefull to make rails communicate with your xmpp-server. Typical use cases could be making server to server communication, or creating an xmpp bot to interact in your chat : it could be asking questions for a game or managing the room to kick flooders.
You need only a server and a client library. So you go either with Blather or Strophe.
Strophe is a JavaScript library and runs on the web browser, while blather is a rails library and runs on your server.
When you want to create a web chat then I think you should go with Strophe.

Resources