开发者

Sharing information between mobile web app and mobile app on iPhone

I am trying to do some kind of a user tracking mechanism between mobile web site and mobile app on i开发者_如何学JAVAPhone. Is there a way of storing information on a mobile web site using cookies or HTML 5 web database and then accessing it from a mobile app (I know this is a security problem)? Is there some other way of transferring information to a mobile app?


Get them to login twice; once on the website, once on the mobile app. Then you can use your cloud service to exchange data. Both should allow the user to save their credentials for a long time, so a user will not mind this.


Yes, you can access the same per-user info on both a mobile website and a mobile app. You do this by having the website and the mobile app both access a source of information somewhere (basically, a database), and you require the user to authenticate to identify themselves.

Cookies aren't really used for this is the way you mean (although they possibly would be used to track which user has established an identity with a web server and are useful). Cookies are a way for a web service to get a web client to remember little bits of information and report them back later.

A common approach to your scenario would be to have a web service offering access to the database -- for example, a web service might take RESTful URLs and serve up JSON or XML -- which your mobile app could access. Your mobile website would access the same data source behind the scenes (although not necessarily going via a web service interface).

A note on security: some services with high security concerns (e.g. banks) offer a secondary, mobile app only login, which is tied to a users' "proper" login. This helps avoid crucial information leakage -- mobile phones are prone to getting lost etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜