Persistent Group using XMPP - mobile

I am using XMPP and MUC for creating a group and it works fine till the user is online. The user leaves the group as soon as he goes offline. I want a user to stay in the room when he is offline and receive the unseen messages when he comes back. How to achieve this in XMPP. And how to create group and add users dynamically.
Can i make the user online all the time..is it is a good approach.? if so then how can i do this - making user online all the time

XMPP MUC is based on user presence. A new upcoming protocol address this issue. It is called MIX: https://xmpp.org/extensions/xep-0369.html
It is still preliminary, but you can expect fast iterations and improvements.

Related

Signup for email accounts from GAE app

I am faced with a rather strange request and there isn't much material online tackling that.
I am building a web app on GAE ... front end, back end, datastore, blob store, user accounts, the whole nine yards ...
Part of the requirements is to have a user communication system, (users sending messages to each other, just like Facebook) as user emails are not to be shared among other users, and the web app shall only send emails to the user sign up email strictly for security and administration purposes, and wont flood their inbox with notifications like some websites do.
I have narrowed narrowed it down to 4 options
Option 1:
Reinvent the wheel - Build this whole system form scratch on the Datastore and Blob store. However, not only is it expensive, but also I am not gonna go through all of that (just saying honestly)
Option 2:
Build a bouncing system ... User A sends message to app ... app bounces email to User B. Not very Elegant, impossible to create threads and conversations, eats up app Mail Quota used for Marketing and what not.
Option 3:
Host My own Email server onsite. Patch an API servlet and run the whole show through API. Very valid, except that the client doesn't want anything on site, and I wont be around to maintain it for him.
Option 4:(Best option if someone helps out)
Implement option 3 on a 3rd party email provider. Which brings us to the question, is there any respectable email provider that allows account sign up through API ?? I need to create a shadow email account on a 3rd party server(that the user will never know it exists) every time someone makes an account on my app. Then store all emails and their generated passwords in the Datastore, and when user logs in my web app, web app logs in 3rd party server, retrieves messages and serves it. When he wants to send a message, web app gets the message, sends an email using API as well. If someone knows how to do that on Gmail, I would be eternally grateful (but I highly doubt google allows that)
Note
I can implement the whole setup on xmpp/Jabber servers as well but these free servers keep changing all the time and they change their configurations ... bottom line they are not very reliable.
Thanks a lot guys !! I really appreciate any feed back and if you have any other suggestions please don't hesitate !! This is by no means a solid plan yet.

Email confirmation best practices for mobile apps

So I'm writing a mobile app and have reached a point where I need to allow users to register a username. I'm doing this by asking for an email address, username and password.
Typically, it's been normal to set this sort of thing up on the web by having the user confirm his email address by clicking on a link sent to his inbox.
Needless to say, on a mobile app this is a bit clunky as the user will be redirected out of your app and into his browser.
So I had a look at how other mobile apps are doing it (WP7) and was surprised to see that DropBox and Evernote both allow you to sign up without confirming your email address. The end result of this is that I was able to sign up with completely bogus email addresses and/or valid email addresses that don't belong to me.
I assume this is done on purpose.
Your thoughts?
I came across the same issue when writing a social networking style app. I chose to have the user create a username and then provide and email and password. I do not verify the email address and I've never attempted to send any email to them (yet).
What I would suggest would be alternate ways to validate a users email address. My app allows users to do Facebook Connect. All they have to do is log into Facebook, and the app talks to Facebook to confirm that they are using a valid email address. No need to verify it with a URL in an email.
I believe Twitter has a similar service and there may even be a few others that provide an API.
I've also discovered that a lot of people just want to tinker around in the app and not create an account at all. It's definitely a balancing act
I'd say it depends on your app and how important it is to ensure users have valid email addresses. In an app I'm creating now, we want to discourage users from signing up with multiple bogus accounts (because our system could be gamed that way) so we're not allowing users to log in until their email address if verified. On other sites however, it might not be such a big deal so why bother users with that extra step?
As for a mobile device, I don't see why you can't still send a verification email that sends them to your website to verify their email address. There are plenty of mobile apps that also have a website users can log into to manage their account.
Another option is have multiple "states" for users. Before they validate their email, they are in a "pending" state. Once they click it, they're in an "active" state. If you store the createDate for the user, you can periodically remove pending users older than 1 week (or however long).
The bonus is that you can easily add more states, such as suspended or deleted.
Personally, I wasn't too happy for users to create accounts with any old email address.
I think a few decent options are:
send a confirmation email with a link that uses a Custom Url Schema to redirect back to the app (although this is only good if they use the link on the same device)
send a short PIN in the email for them to enter back in the app.
send a confirmation email with a web link, have your server confirm the valid email/token, and have your app check the account status either periodically or with some sort of realtime tech like SignalR or Firebase.
I prefer the last one, although hardest to implement. A user might well have their phone in their hand and their laptop next to them, register in the app and try to click the link in the email that just showed up on their laptop. I like the idea of the app then just "knowing" that they've validated.
Do you have a web server? Write a web service that does the validation for you on the server side, and sends back the result.
Either you can use some platform, such as Facebook connect as #Brian replied above, or you may give users a reasonable timeframe to verify, for example, a few days or even a week. After that, the account gets removed.
You can even have your app issue notifications to remind the user to verify his account (such as every day, or on the last date of the verification.
Don't ask for email confirmation on mobile and allow the user to use the service. When the user is using a PC, then ask the user to confirm his email.
I won't defend my recommendation because most of the solutions here are valid. There isn't one correct way. You asked for ideas and here's one.
A good strategy is to allow people to use as much of your app as possible given the amount of data they've provided.
For example, in the case of a newsreader you might let someone browse your app without registering, then require an account for offline syncing, and a verified email for alerts. Always give people a good reason to take the next step, and build engagement first, then people will forgive you pestering them later.

Online GAE Application User

How to know if a user is currently logged-in in your Google App Engine application?
The application allow its users to browse other users' profile. If the viewed profile is also using or logged-in in the application, i want a notification that the viewed profile is online.
How to achieve this requirements?
If you are managing user profiles, you know when a user logs in. At the end of the login process, just save the user's log-in information in the memcache somehow.
You will later be able to check if a user is logged-in just by searching for him in your memcache.
This way is easy to catch and track the connection events, but you also have to react when a user disconnects, to have your list up to date. To achieve this, you can use a Channel. See the google documentation.
You could, as Gaƫl suggests, use the Channel API to track this, but it's probably overkill. If you wanted to go that route, just listen for the connected & disconnected messages, and update a field in the db that indicates that the user is signed in.
A less expensive route might be to just update a field in your user's record that's something like "last time this user requested a page." If it's been more than n minutes since the last time the user requested a page, assume they're signed out. Indeed, you could even do this in memcache with a map from userid to last access time.
It comes down to what you want to do with the "signed in" information: if you just want to give a general sense of whether a user's around, or how many users are online, using the datastore or memcache solution is probably good. On the other hand, if you want to reflect the user's presence so they can respond to eg. IMs, then you'll probably want the Channel API anyway so you can immediately deliver messages to them.

XMPP/jabber client help

I want to develop a chat application with floowing features
1)user A visits website clinks on
chat .
2)Website picks another user B who
is single(who is not paired) and
pairs him with A.
3)Now A and B can chat till they
want.
Now here neight A or B are registered member of website.Neight they ave any accouunt.
Can i develop such things using jabber/XMPP on appengine ??If yes how??please provide some pointers so that i can start off.
This kind of app is absolutely possible on App Engine, using XMPP, but you won't be able to have them talk directly to eachother, only to your app. You can then "bounce" messages from User A to User B via your bot.
1.) A user visits site, enters their jabber ID (or you could have them log in). You would need to store this JID in the datastore
2.) Another user visits the site, enters JID, and you pick some random existing "single" JID.
3.) Mark both of the JIDs as "connected" and send each a message to start chatting.
4.) At this point, your app can receive messages from the first user, and send them to the second user, and vice versa. This will also help reduce spam and privacy issues, since users won't need to give their actual JID to a stranger.
As for pointers, the App Engine docs are a good place to start, specifically the section on XMPP (Java / Python).

How to: Create reminders that should trigger an event to be handled in a Windows application?

I need to develop a windows application with .NET 3.5 that needs to have a calendar and user can schedule appointments.
I want (not with a windows-service) that while the application is on, all the reminders that are set up for this user + reminders that admins set them up, should trigger an event in the application so I can handle it (showing the user a message, notify icon or whatever), once its datetime becomes now.
The data is saved in SQL Server and accessible from many computers, the admin should be able to externally create reminders for users.
Any approaches?
Locally, you could trigger the events using a timer that check the current time e.g. every 10 seconds or more often. The clients should regularily synchronize with the database server, querying all data for the current day or (on user demand) later events. This allows the clients to run and to remind the user even when the network fails for some time.
Another very interesting option is a server side reminder tool next to the database. It generates reminders and sends them via XMPP to the clients. The client machines don't need a special software anymore - any Jabber client would be sufficient, although a special software acting as an XMPP client would be possible, too.
You should really avoid popups. Popups are generally considered not user friendly. They interrupt the user's work flow. Even worse, they steal the keyboard input. What if the users was typing an important email right now?
Instead you might provide a nice, pleasant sound and a task bar bubble or similar.

Resources