Link to home
Start Free TrialLog in
Avatar of Marco Gasi
Marco GasiFlag for Spain

asked on

Hybrid app: howto keep user logged in

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
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

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.
Avatar of Marco Gasi

ASKER

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?
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.
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 :)
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you, Olaf