When App deletes (uninstall) getting a mail iOS - ios

I made uninstall some apps from my iOS device. Then i got a mail from app developer for particular app.
How they get particular device make uninstall the app?
I followed below links but not getting proper solution.
Detect iOS application about to delete?
How to get the device details when user uninstalls the ios application

Basically, As you know there is no event is fired when App is deleted from the iPhone.
But you can do your tasks when the app installs so basically you can check application by sending the silent push notification.
Apple server will inform you when you try to push to an uninstalled instance the notification response at the sender side will come 410 means, user, no longer activate.
APNS REQUEST/RESPONSE
If you do not get the proper response from application side that means your application is uninstalled and you can send the mail.
Helpful links:
Call status change web-service when my App is deleted

Related

VOIP token won't get invalid after uninstalling an app from a device or disconnected from the network in iOS

I am working on one VOIP-based application where one user calls another user everything works fine like calling and all.
But whenever I didn't log out from the application and directly uninstall the application at that time any another user tries to call the user who already uninstalled the application. At that time backend get a successful response from apple (i.e. 200 Success). Why won't give an error if that app is not installed
Actually, we need to give some specific alert to the user who called the person who already uninstalled the application but we are unable to find from backend too that the voip push failed.
One another thing just for testing : We tried to send FCM silent notification too which works synchronously with VOIP notification but in that too FCM gives success in backend while app already uninstalled from device.
If anyone facing same issue and having solution regarding that then please let me know.
In the short term, Apple doesn't know that the user has uninstalled the app, so it accepts the push.
Pushes are delivered asynchronously (Since a device may be offline when you send the push; it will be queued for delivery later).
The APNs cannot provide immediate feedback on the delivery of your push. The 200 status simply means that the push was successfully accepted for delivery.
Eventually Apple will determine that the push token is invalid and return a 410 response. At that time you can remove the push token from your database.
In the short term you can detect if the device doesn't respond to the VoIP push in a reasonable time frame and return a "call failed" or "recipient unavailable" response to caller.

Query OneSignal server from device to get info about push notifications received while app was closed

I'm using OneSignal Swift in a native iOS application. So far i'm able to handle all kinds of push notification cases (foreground/background) except one. When user has force closed the application from "task bar switcher".
I'm using 'content-available':'true' in all my notifications through OneSignal in order to wake up my app and start running code the exact moment the notification is received. So far so good everything is working as expected.
When the app is closed and push notification arrives, if user taps it, then handling with OneSignal works with OSHandleNotificationActionBlock callback.
The problem though is if user doesn't tap and just opens through application icon, then notification data are completely lost. Online reference dictates that the correct way of handling this (what most apps like Facebook do), is query tour APNS (OneSignal in my case) for unhandled notifications and re-fetch them on application start. So the question is how to do that from OneSignal iOS native SDK? Is it possible? There is ofc the REST Service -which might be the case- but users are clearly discouraged to call the API from inside client application. An app key is necessary which shouldn't be saved in device's keychain apparently for security reasons(??)...

iOS Detect whether my app is still installed on device

I am developing for enterprise application and no need to submit to app store.
We need our user to install our app as mandatory. If they delete, we need to track and may advice to install back.
Currently, I am thinking to do like this.
1) Send silent push notification to device and app reply back to server.
2) Run background service daily and post to server back.
Problem is that for push notification, if user deny access, it will not be working. For background service, if user don't accept allow, it won't be working too.
Is there any way to do for that?

remove iOS push notification after fresh reinstall

I have application which has successfully integrated apple push notifications, when user logs in to the application app registers with the push notification and token is saved on our back-end, when user sign out from the app, we remove the push notification tokens from our back-end. but if user uninstall app from the device WITHOUT SIGN-OUT from app, and then re-install,in that case we can still send push notifications to the device, since app is newly installed and not logged in any user we have to remove tokens from the backend. since iOS app does not have any API for uninstallation events how can I remove device token from back-end. I can use push notification feedback service to get uninstalled device tokens but how can I resolve the issue when user removes the application and then reinstall.
I tested this scenario with skype, it also have this issue. (install Skype > Log In > (now you can send app to Background and send some chats from any other device, you will get push notifications) > then Remove app from Device without Sign-Out from Skype > Re-Install Skype > now if we send skype chat we receives push notifications but skype app is newly installed and no one is logged in)
I guess the best thing you can do is to preventively unregister/remove the tokens, when the app is started without a logged in user. You should update the registration anyways each time the app is started, so register/unregister at each app start, depending on if a user is logged in or not. This way, if the user reinstalls the app and starts it the first time, it will be unregistered.
This is the best behaviour you can achieve, as it is the same for Twitter, Facebook, Skype, etc...
I think you are not able to get an event or detect if a user has removed the app or not. What you can do is to send periodic notifications to a device (only setting the badge, without sending a notification) and remove the tokens for what you get a 401 status code. Then you know the app has been removed and you can delete the token.
Yeah! as you have quoted yourself it will continue to send notification unless your server has the info that someone has logged out. Obviously you won't get the info when your app was uninstalled and then reinstalled.
Workaround: If your app is reinstalled you can call an API to deregister since no user is logged in.

How should I send push notifications only to active devices?

I have an iOS app with a Rails backend (and frontend). I am using Parse for push notifications.
I am trying to figure out the best way to only send push notifications that will be received; that is, I want to avoid sending them to:
Users who only use the web app and don't have the iOS app
Users who had the iOS app but then uninstalled it
The way that the Parse Push API works is that I can broadcast a notification on a certain channel, and any device that is listening to that channel will receive the notifications. Therefore, I am planning to make separate channels for each user.
Obviously, I am going to need to store some sort of information on the server side about who is running the iOS app. I'm curious as to whether anyone out there has experience solving a problem like this and can offer any wisdom. Thanks!
Parse already stores information about who is running iOS and Android apps. Check out the Data Browser, there is an Installation table with a deviceType field.
Have the iOS app register a unique (per-user) channel. If you're only sending push notifications on user channels, it will only be sent to users who have installed the iOS app.
There's not much you can do for users who had the iOS app but uninstalled it. Apple doesn't provide a way for applications to run any code before being uninstalled, so you can't unregister the device with Parse. I'm not sure if Parse does this, but Urban Airship polls the APNS servers and removes devices that have had the app uninstalled after a certain amount of days.

Resources