Too many push-notifications (Parse.com) - ios

Using Parse.com for one of my iOS apps, aready on the appStore, I recently experienced a large number of remote notifications sent to users, in a rather short time.
The number of notifications sent in such a short time cannot be due to the normal functionning of the app.
What could make such a thing happen?
I made an Export Data on the same day. Could that be the cause?
I also modified one record, on one of the tables, but that only explains one push notification.
I was also working on the app, preparing for a future version, but do not think I did anything to fire a great number of notifications, or any notification at all.
Thanks for any suggestion.

Export Data has nothing to do with push notifications - that is not the cause.
Look through all of your push notifications that you sent. You can see your push records by going to the 'Push' tab on the Parse.com dashboard. It will allow you to see who was send each of the pushes and when they were sent, along with the JSON payload.
I would recommend taking a hard look at your push notification code to ensure you do not have an accidental loop, as that sounds like the most likely culprit.

Related

What is the best way to keep updated the info of an iOS App?

Since push notifications may not be delivered sometimes (you can lose a few of them), you can not run code after the iPhone is turned on to check if there is new information available from the server, and you can not run code if your iOS App is closed... What can you do if you want to be as more accurate as possible in for example a Chat App in iOS?
I mean, inform the user as faster as possible that he has new info available. Comparisons: WhatsApp is updated without any delay.
You can do background fetch if your App is in background. But if the App is closed and you miss a push, it's not going to be up to date until the next push arrives or user opens the App. The same with silent notifications. If the app is terminated by the user, you are not going to receive it. Is there any way to solve it? It must be because other Apps do it... If there is any "private and secret" API that they are using (I read about this answer when no one know how to do that)... Is there any way to apply to use it?
UPDATE:
I'm using push notifications. The goal is to fix when a push doesn't arrive. Example: User A send chat message to user B. User B doesn't have the App open. The system lose the push. User B is not going to receive the message until he open the App.
Push notifications seems to be your only way even if you do loose a few of them, which I don't know how you would since they are pushed to apples secure server... but what do I know. As long as the user turns on the push notifications you should be fine. They may be delayed due to apples way of handling them. Honestly push seems to be the future, having your app constantly every minute or two check for new messages is a huge battery water in conjunction with normal texting apps. Your app should provide the best live data but since apple restricts to push notifications when the app is off or not running just stick to push notifications and only push major events to the user. I believe you can set up a job scheduler using quartz or schedulator to setup your server to push notifications to your app.

How can a sync of IOS reminders programmatically be triggered / forced?

I am writing a task mgmt app that is using EKReminder.
Works perfectly when using on one iOS device.
When I use on two devices (same apple account), I realise that reminder changes sync is with significant delay and even often incomplete. (tried iCloud, google, company outlook)
This thus seems unrelated to my app (same happens if I change reminders directly in Reminder iOS app).
Can I programmatically force a sync of reminders with whatever service (e.g. iCloud) that they are linked to and trigger this out of my app?
#Losiowaty suggests a valid solution in the comments to the question, but I think there's a bit more information the following solution(s) could provide. To be fair, I have actually noticed this exact same issue specifically with the Apple Reminders app, and think that in general the solution applies to iOS but could carry over to the same notifications that have similar issues on macOS as well.
For iOS, though, the issue seems to be:
Two iOS devices on the same Apple iCloud account will both get a specific Reminder push notification. The issue is, though, that clearing that push notification on 1 device does not sync the second device properly in almost all cases as of right now. This is the question asked above's context, from what I understand.
The second, not as well recognized problem, from what I can tell, is that this problem is due to the fact the "host" application isn't properly clearing it's own push notifications, so to speak. What I mean by this is:
iPad and iPhone receive push notification from Reminders app about a 12:00 TODO item, at 12:00.
iPad push notification is acted on, marked as completed, and cleared on iPad immediately
iPhone push notification is still there (the issue we're attempting to solve), but will likely not be removed until itself is removed (opening Reminders app not from the push notification will often not clear this).
The reason for this is the push notification isn't being cleared by the application, and so even though it's now irrelevant information (since it was cleared after being marked as completed (or snoozed) on another device), but the push notification system doesn't know that (since pushes are just payloads of information, unless you properly use TTL on these, but that's a different answer). The way to fix that, that most/some apps use to an extent, could be:
1) As stated in the comment, in bullet point 2 the action (marked as completed, and cleared from device 1) could update the backend (iCloud in this case) that this item is complete, which then sends a silent push to all associated devices which properly clears the push notification (this would likely happen in a form of an application background task, something like a Notification Service Extension Apple link here (iOS 10+ only)
2) Another method would be to keep an internal "secret" key unique to each push notification you send (across all associated devices). You can then associate any one "task" object (in the Reminders app context as an example, but this can really be any data object held in your app) with a set of push notification "secret" keys (which can expire on a custom timer if you feel these are getting out of hand, especially since pushes will likely be viewed OR irrelevant after 30 days in most use cases). From this, along with a mechanism to make the application update it's data, if the app notices the device has any push notifications it shouldn't (based on the set of "secret" keys which are associated with "active" data), it should clear them for you. This ends up with the same result as method 1, but doesn't require a silent push (a socket can be used, or something else entirely), and could rely on a basic background job
It looks like either way, you need some kind of background task processing to act when something happens (either through a notification service extension as linked or through a simple background task that Apple supports).
I hope this answers your question and points you in the right direction for what you are building!

Swift: Push Notifications not working after implementing Realm Database

I have a small messaging app and user receives a push notification whenever the user gets a message. Recently I have implemented Realm Database for my app. I am storing all the data that comes from the server into the realm directly and displaying the data to the user from realm. So, after shifting to this way the push notifications are not working. But again if I download the current version that is in the AppStore, the notifications are working. Every message has a messageID and we are sending the messageID as one of the parameter in the push notifications. Can someone help me on what I can do to make the push notifications working again.
Well, for getting push notifications to work, you not only need to configure the app correctly, you also need to configure the backend service & APNS linking correctly to get it to work.
You should try a methodical approach wherein you divide the entire feature implementation of push notifications into smaller sub-tasks like app side logic, backend configuration, Certificates & Provisioning Profile setup, etc. Try to examine each of these sub-task implementation & surely you would find the culprit. Since, you know the existing App Store version of the app is working,you have your task reduced

Pushwoosh Show Past Notifications?

I use Push Notifications from Pushwoosh.com. In their tutorials, they have many guides, but nothing that I could find for a view that allows you to view past notifications the device has received. As many people can tend to dismiss or clear notifications quickly, it is usually a good idea for them to go back and view them within the app itself. Does anyone know if this is possible using Pushwoosh?
I think you will have to do some of your own work here. It's not that difficult either.
When a push notification is received, you could save its information to NSUserDefaults or to your own database and then retrieve this when you need it.

Push notification/alternative that can timeout

I am working on an application that must notify the user of a server-initiated event. These notifications are only useful for a short space of time (30-60 seconds). For this reason, I am looking for a method that can both deliver a notification quickly, and, importantly, can somehow invalidate (retract/cancel/timeout) the notification after it has already been delivered.
My understanding is that the APNS is not suitable for this. They 'send and forget', giving no ability to check/modify/delete a notification. This functionality is integral to my app though, so I am open to any suggestions for methods or services that might let me achieve this.
In my mind there are several options:
Server sends notification to user. Server then later sends 'cancel' message to user, which removes the notification.
Server sends notification to user, which has a built in timer. This timer is monitored locally, and once it elapses, the notification is removed.
App periodically polls server and schedules/cancels a local notification according to what the server says.
My preference is option 2, because it is self contained and efficient. One message initiates both the scheduling and cancellation. Option 3 has issues with iOS shutting down the app if it's in the background (not to mention the rate at which it would have to poll the server given the notification would only be useful for ~30 seconds).
Do any services such as Urban Airship offer some functionality that could achieve this? Any other suggestions/complete work around methods? All very appreciated.
Thanks for your time!
Matt
EDIT: In the interests of encouraging out of the box thinking, another idea might be that the server initiates an automated phone call with the app user. If the user answers the call, the required information is given to them. If not, the information is no longer available. Bit wacky, and my instinct is that it would be costly, but I'm open to anything!
Anything that happens asynchronously can be done with push notifications as it already provides a unidirectional, instant communication channel between you and your customers, so no need to do strange phone calls (which can interrupt your users' activities, bothering them).
You can go for a dual solution, in which you notify your users of how many unread notifications they have in their inbox. Then can you implement your own in-app message inbox, which connects to your servers and fetches the relevant data (in case it hasn't expired - if it has, just let the user know -).
This way users would be able to know how many notifications have been made available to them, but they could only check the ones that are still valid. UrbanAirship employs this approach for their Rich Push feature.
Apart from this, you need to bear in mind push notifications can be very intrusive for the user, so use them wisely or you'll see your users unsubscribing from them or even worse, uninstalling your app.
Well my guess you are out of luck, since your only option is APNS.
There is no support for canceling notifications.
Apps can't access the notifications for the app, only the one the user uses to open the app. Also you can't really run apps in the background is they are not used for location, media, VOIP or need to access some kind accessory.
See my point where you can't really run app in backgroud.
Third party services can not add extra functionality to the APNS server as provided by Apple.
As to your suggest that the server will the app, you can't intercept call, sms,... on iOS. I really you only solution is to build a VOIP app that will call the user when ever the notification needs to be displaid.
Apple has no solution that will suite you needs, guess it will have to be an android app then :S

Resources