Can anyone advise me if push notification can be activated by location? That is to say, Location A will get a push notification different from Location B, without having to run the App in the foreground
no, you can't do it, because if the app is not background you can't have location....and so you can't do a push notification....
Thanks Danny, understand that. My question is more on if the App is running on the background, but not the foreground, can there be push notification based on locations?
Not wanting to fuel a fire with Dany, as he's a demon coder, but I do know someone who has done this as a proof of concept. They set it up so that if you were within 500 metres of the location specified within the app, it would fire the APNS.
God only knows how they did it. They wanted £10k for the source
Not wanting to fuel a fire with Dany, as he's a demon coder, but I do know someone who has done this as a proof of concept. They set it up so that if you were within 500 metres of the location specified within the app, it would fire the APNS.
God only knows how they did it. They wanted £10k for the source
lol....
The possibility are:
-It remain ALWAYS in background looking lat\lon, apple allow that (see link posted under), since that is for location purpose. (but if you restart iphone, will not work until you open the app again). And when lat\lon is near a particolaur point, just fire a local push or a http request to your server that automatically send a push notification.
-Will work only for 30 minutes (then os kill the process) and Apple will reject it. (this can be done using beginBackgroundTaskWithExpirationHandler that is thinked for finite-length tasks)
-Work only on jailbreaked device (so can run in background w\o problems)
Quote:
Originally Posted by deus0416
Thanks Danny, understand that. My question is more on if the App is running on the background, but not the foreground, can there be push notification based on locations?
Cheers,
J
If your app run in background and use API for that, can be done.
Applications can register for significant location changes. (Recommended) The significant-change location service offers a low-power way to receive location data and is highly recommended for applications that do not need high-precision location data. With this service, location updates are generated only when the user’s location changes significantly; thus, it is ideal for social applications or applications that provide the user with noncritical, location-relevant information. If the application is suspended when an update occurs, the system wakes it up in the background to handle the update. If the application starts this service and is then terminated, the system relaunches the application automatically when a new location becomes available. This service is available in iOS 4 and later, only on devices that contain a cellular radio.