删除我的应用程序时,呼叫状态更改Web服务 [英] Call status change web-service when my App is deleted

查看:207
本文介绍了删除我的应用程序时,呼叫状态更改Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用网络服务,当用户登录我的应用程序时,我的应用程序正在发送状态为1的请求,这意味着在登出按钮时单击发送状态为0的请求。

In my application , i works with web-services and when user log in into my app my app is sending a request with status 1 means loged in and when on log out button click sending a request with status 0.

现在的问题是,当用户从设备中删除应用程序时,我服务器中的状态保持为1(登录),因此其他用户可以在他的应用程序不在设备中时看到他可用。那么,当我的应用程序从设备中删除时,我可以通过哪种方式发送请求(我认为不可能)或者我可以在后端进行其他任何方式吗?

Now problem is , when user removes app from devices , status in my server is remain 1(log in) , hence other user can see him available while his app is not in device. so is there any way by which i can send request when my app removes from device (i don't think it is possible) or is there any other way that i can do in my backend side ?

提前致谢。

推荐答案

当用户从ios设备删除应用程序时,无法调用Web服务。有三种方法可以知道您的应用程序是否存在于用户的ios设备中。但也有一些限制。

It is not possible to call a web service when the user deleting the app from an ios device. There are three methods to came to know that whether your application is there in user's ios device. But there are few limitations also.


  1. 激活推送通知:通过这样做,设备将获得注册Apple的推送通知服务。当用户从设备中删除应用程序时,将从APNS服务器撤消注册,并通过APNS反馈服务,您可以了解该应用程序是否存在。 (限制:如果用户不同意接收推送通知,那么该应用程序将不会向APNS注册,并且您永远不会知道应用程序是否存在)

  1. Activate Push notification: By doing this, device will get registered with Apple's push notification service. When user delete the app from device, the registration will be revoked from APNS server and through the APNS feedback service, you can get to know whether the application is existing. (Limitation: If the user did not agree with receiving push notifications, then the app will not be registered with APNS and you never came to know that whether application is existing or not)

激活基于位置的服务:如果您的应用程序启用了基于位置的服务,那么您的应用程序将在位置委托方法中定期更新位置。在此委托中,您可以调用Web服务并保持更新用户的状态,即使应用程序在后台也是如此。 (限制:如果用户禁用位置更新,那么您的服务器将无法获取有关用户状态的信息)

Activate Location Based service: If your application enables location based service, then your application will get periodic location updates in a location delegate method. In this delegate, you can call a webservice and keep update the status of user even the application is in background. (Limitation: If user disables the location update, then your server will not get info about user status)

定期从您的应用程序调用Web服务:仅当您的应用处于活动状态时才可以执行此操作。 (限制:当您将应用程序推送到后台时,您的应用程序将处于挂起模式,因此无法调用webservice)

Periodically Call a Webservice From you app: This is possible only if your app is active. (Limitation: When you application pushed in to background, your application will be in suspended mode, so it will not possible to call webservice)

这篇关于删除我的应用程序时,呼叫状态更改Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆