Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-13-2011, 02:39 AM   #1 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 4
deus0416 is on a distinguished road
Default Possibility of Push notification by location

Hi,

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

Cheers,
Junkai
deus0416 is offline   Reply With Quote
Old 05-13-2011, 02:43 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

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....
__________________
dany_dev is offline   Reply With Quote
Old 05-13-2011, 04:11 AM   #3 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 4
deus0416 is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
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?

Cheers,
J
deus0416 is offline   Reply With Quote
Old 05-13-2011, 04:53 AM   #4 (permalink)
Daddy Cool
iPhone Dev SDK Supporter
 
MarkC's Avatar
 
Join Date: Mar 2009
Location: Yorkshire, England
Age: 100
Posts: 1,616
MarkC is on a distinguished road
Default

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
MarkC is offline   Reply With Quote
Old 05-13-2011, 07:25 AM   #5 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Quote:
Originally Posted by MarkC View Post
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 View Post
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.

Implementing Long-Running Background Tasks - Location

Making Your Application Location-Aware


Quote:
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.
ps: dany non danny
__________________

Last edited by dany_dev; 05-13-2011 at 07:42 AM.
dany_dev is offline   Reply With Quote
Old 05-13-2011, 08:08 AM   #6 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 4
deus0416 is on a distinguished road
Default

Thanks guys for the answer. Just one last question.
Is what you described used by google latitude? Or do they use a different approach?

Cheers,
J
deus0416 is offline   Reply With Quote
Old 05-13-2011, 08:15 AM   #7 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Quote:
Originally Posted by deus0416 View Post
Thanks guys for the answer. Just one last question.
Is what you described used by google latitude? Or do they use a different approach?

Cheers,
J
Yes, most probably Google Latitude use that approach.
__________________
dany_dev is offline   Reply With Quote
Old 05-13-2011, 06:20 PM   #8 (permalink)
Registered Member
 
Join Date: May 2011
Posts: 4
deus0416 is on a distinguished road
Default

Thanks!
deus0416 is offline   Reply With Quote
Reply

Bookmarks

Tags
location based service, notification, push

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 367
6 members and 361 guests
doffing81, dre, iOS.Lover, Kirkout, MikaelBartlett, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:03 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0