I have implemented iBeacon into an app so that it will wake the app briefly from a suspended or killed state. A push notification is sent which would prompt the user to open the app if they wish to.
The problem is, when a user exits then enters a region again another notification is sent. In a shopping mall for example a user could walk past many beacons (enter and exit regions). What they probably will not want is lots of notifications annoying them.
Is there a way that you can control or restrict the number of notifications a user gets? For example time restrictions? Once a notification has been received then a user would not get another one for 15 mins or 30 mins etc?
There must be a solution as i am sure Apple would not want users to get lots of notifications that users dont want.
There are no built-in tools to iOS SDKs to prevent multiple notifications from being sent in a specific time period. But you are correct that this is a very common problem. The solution is to just add a little bit of programming logic.
Here is a typical approach:
Each time you send a notification, record a timestamp of when you sent it. Store this in the phone's persistent storage, so even if a user restarts the app or reboots the phone you will have a record of when the last notification was sent.
Before you send a notification, check to see when the last time you sent one was. If it was too recent, suppress sending a new notification.