Hybrid app: howto keep user logged in

Marco Gasi
Marco Gasi used Ask the Experts™
on
Hi everybody.
I'm working an hybrid app using jQuery Mobile. The app connect to the php code to get/post data.
I'm wondering how to keep user logged in even when the app is not active so we can send notifications (like native apps such as Facebook or WhatsApp).
Thank you for any suggestion
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Olaf DoschkeSoftware Developer

Commented:
I haven't done that at all, but the concept is push notifications. It actually works with apps not started, in the first place you communicate with the OS and the app registering with it may only get a number of incoming notifications at the start icon or tile as MS calls it.

Bye, Olaf.
Marco GasiFreelancer
Top Expert 2010

Author

Commented:
Sorry, but I don't understand what you mean:
you communicate with the OS and the app registering with it may only get a number of incoming notifications at the start icon or tile as MS calls it.
What does this mean, exactly?
Olaf DoschkeSoftware Developer

Commented:
Well, any app is installed on some OS and device. At that stage you can also register with some services of the OS, for example push notifications. The OS is the one "application" always running, so obviously it is the one getting notifications for all installed apps and their users and sorting them to the apps in their inactive state. The OS is displaying the start icon and also the added number of notifications waiting.

As said, I haven't done this and can't tell you the details, especially not for all the OSes, but the principle is as that. The apps are not running in silent mode all the time to handle their push notifications.

You have a term you may look up and find more than I can give you about this: Push notifications.
For example:http://quickblox.com/developers/SimpleSample-messages_users-android or http://stackoverflow.com/questions/17565307/how-to-display-count-of-notifications-in-app-launcher-icon
Android actually has no native API for the start icon change, but the push notifications appearing for all apps are possible through GCM. Apple has APN and Windows WNS.

Bye, Olaf.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Marco GasiFreelancer
Top Expert 2010

Author

Commented:
Mmmh, I'm not sure that be what I'm looking for. Let me explain.
My client already has a site where user can create their images' collection, connect each other and so on.
Now he asked me to develop a mobile app nd I started a hybrid app with jQuery Mobile and Cordova.
The client wants the app be able to receive notification from the website, substantially from php code in the site to make the user be alerted when someone, for instance, adds a his image to a collection.
Cordova has a notification plugin which allow me to use notifications.
What I'm wondering is how can I receive notifications from my custom code in the server and serve them to the mobile app. How can I keep the user logged in? And what is the mechanism I have to implement to allow my server code to send notification to the phone where the app is installed?
Being a hybrid app, I'm looking something non-native tip...
I admit my ignorance about this, so forgive if I am not clear enough, or if I don't understand quickly :)
Software Developer
Commented:
Even non native apps have some native container typically serving the real "app" in some browser control of it. So look up how notifications work in cordova. You surely don't let users be logged in all time to do this, but your server side surely will know all users and their app installations and will have some way to send notifications to the user from which an image was picked by someone else.

http://ngcordova.com/docs/plugins/pushNotifications/

Bye, Olaf.
Marco GasiFreelancer
Top Expert 2010

Author

Commented:
Thank you, Olaf

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial