Reputation: 31
User has an iOS app in his device and he walks into a physical store. I would like to identify that user programmatically within the app and throw him push notifications like Welcome message and based on his usage history or his level, send him coupons etc., on entering the store. He has to receive these messages automatically. In what all ways this is possible? And most important thing is that this needs to work in all states of the app (foreground, background, not running, suspended). Appreciate any quick inputs here.
Upvotes: 1
Views: 488
Reputation: 64961
Since you tagged your question with iBeacon, here's a summary of what's possible with that technology. In general, you can do what you want, but there are some caveats.
If you install an iBeacon in the store and make the app look for that iBeacon using [locationManager startMonitoringForRegion: iBeaconRegion]
, your app will get a callback whenever that beacon is first seen. In this callback, you can make it send a local notification to the user (or by making a web service call, you can make it send a push notification to the user). This can happen in all of the app states you mention, using this definition of these app states.
The situations where this will not work is if:
The callback to your app will happen as soon as the iBeacon is detected by the phone. This may be as far as 150 feet from the iBeacon if it is detected quickly. It is also possible that detection will be delayed by a few minutes until iOS enters its next Bluetooth LE scan cycle. Once the callback takes place, local notifications can take place immediately. Push notifications will probably have a delay of several minutes more.
The message you send to the user will show up on the lock screen, and if the user gestures to it, you can launch a specific part of the app.
Upvotes: 3