donglu3243 2012-06-27 09:50
浏览 74

服务器可以在没有用户知晓的情况下通知iOS / Android应用程序有关更改吗?

I am new in mobile development and I have a project to do and I spent the whole past days searching for solution to a problem until I got lost so I hope I can find the final answer here.

I have a server (php & MySQL DB) and developing a mobile app in iOS + Android that retrieve data from the server. The mobile app should take the data from the server in the first run and save it in the phone so whenever it run again it take the stored data.

The server should notify the app "without the user being aware" whenever a change made so that the app can go and update the data immediately.

I thought about using webservice (probably REST with RestKit) or applying sort of timestamps on the server records, which are all not the problem.

My problem is that I can't find a way to let the server itself notify the app about the changes whenever a change happen and allowing the app then to update the new data. I thought about using push notifications but - specially in iOS - it can't be hidden from the users.

So is there a possible way to do it? is it complex? does it worth? other suggestions?

As I said I am new so maybe my thinking wrong so sorry in that case, and I searched through the questions and couldn't figure out an answer for my question.

  • 写回答

5条回答 默认 最新

  • dou91736 2012-06-27 09:55
    关注

    At least in iOS, a solution would be to use Apple Push Notifications. If you don't want to be intrusive and want it to be as transparent as possible, you can define what kind of "notifications" signals you want, like this:

    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
             (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
    

    As for the background process, I don't think you would be able to do that. Apple is very strict in what you can do in background (not background thread, but background as a working process while you are not in the application). What I would advise, would be using a notification badge, so the user would know that there is something new, and when he entered the application you could start your update.


    I have to agree with Yase:

    Why update the data if the user is not aware of it?.

    You should always make it as user friendly as possible. Not letting your user know that the application might consume resources is bad, in my opinion. Imagine that you are updating 2mb of information and the user is on 3G...

    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改