GPS based push notifications
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
GPS based push notifications
Hello, first post here. I'm about to start a project for deployment on iOS and Android, most likely with LiveCode, which will involve push notifications being sent to users (via PHP/web) and only displayed to users if they are in a certain area (doesn't have to be too exact). Is it possible to do this via LiveCode - where the notifications are pushed from the web server, then the application can use GPS to detect where the notification should be displayed or not? Many thanks for any pointers!
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: GPS based push notifications
Hi,
Welcome to the forums.
There are mobile functions for the use of GPS and they usually bring back basically numbers for latitude and longitude (mobileCurrentLocation, etc). These values can easily be checked if they fall within a rectangle of other Lat/Long values - or, with very little extra work, within a radius of a single lat/long.
The harder part is the background task aspect of an app that should receive the push notifications (assuming they arrive at unknown times). I'm sure there has been a few discussions about this on these forums somewhere.
Depending on your needs though, it might be easier to have the App request any items based on a pull from the server - where the App sends the request and the server sends back only those results that are relevant - then it might result in less bandwidth as the server is not sending data when the App isn't running.
Of course, the actual requirements of your App will define which is the better route.
Cheers,
Dave
Welcome to the forums.
There are mobile functions for the use of GPS and they usually bring back basically numbers for latitude and longitude (mobileCurrentLocation, etc). These values can easily be checked if they fall within a rectangle of other Lat/Long values - or, with very little extra work, within a radius of a single lat/long.
The harder part is the background task aspect of an app that should receive the push notifications (assuming they arrive at unknown times). I'm sure there has been a few discussions about this on these forums somewhere.
Depending on your needs though, it might be easier to have the App request any items based on a pull from the server - where the App sends the request and the server sends back only those results that are relevant - then it might result in less bandwidth as the server is not sending data when the App isn't running.
Of course, the actual requirements of your App will define which is the better route.
Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: GPS based push notifications
Hi Dave, cheers for the reply!
I think your suggestion of making a call to the server for notifications could fit my use case. Essentially, when people are in a location, the idea is to send notifications to them about special offers etc. Am I right in thinking the app could determine through GPS when to make the call to the server, then retrieve the notification content (may be several, which might need some form of queuing) and use local notifications to display to the user?
I think your suggestion of making a call to the server for notifications could fit my use case. Essentially, when people are in a location, the idea is to send notifications to them about special offers etc. Am I right in thinking the app could determine through GPS when to make the call to the server, then retrieve the notification content (may be several, which might need some form of queuing) and use local notifications to display to the user?
Re: GPS based push notifications
I believe this has to be a user task.Am I right in thinking the app could determine through GPS when to make the call to the server
They should click a button (or run your app) "Any sales near me?" Which would start the server communication.
Running the GPS full time is very power consuming and you wouldn't want it to run all day. I guess you could do a bunch of math based on current location vs distance to next sale and traveling speed to turn the GPS on and off.
But lets say this app is shopping mall specific. They get to a mall and only stores within that mall are part of your target sales. That could work.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: GPS based push notifications
I think, the user would be prompted to run the app upon admission to the area - at which point the GPS detection would run, check if meets location conditions, then make request to server for available notifications. Ideally the notifications could be queued and sent individually as local notifications at intervals? They would probably collated too and made available to the user on a page in the app.Simon wrote:I believe this has to be a user task.Am I right in thinking the app could determine through GPS when to make the call to the server
They should click a button (or run your app) "Any sales near me?" Which would start the server communication.
Running the GPS full time is very power consuming and you wouldn't want it to run all day. I guess you could do a bunch of math based on current location vs distance to next sale and traveling speed to turn the GPS on and off.
But lets say this app is shopping mall specific. They get to a mall and only stores within that mall are part of your target sales. That could work.
Simon
Re: GPS based push notifications
Just alluding to what Dave mentioned, the ability to receive push notifications when the app is running the background (for iOS and Android this would be) - is this possible? If the user launches the app, the GPS detection is run and the user is in the relevant location, can the GPS check and push notifications both run while the app is running in the background?
Re: GPS based push notifications
Here are the links for push notification:
http://lessons.runrev.com/s/lessons/m/4 ... s-with-ios
http://lessons.runrev.com/s/lessons/m/4 ... th-android
Simon
http://lessons.runrev.com/s/lessons/m/4 ... s-with-ios
http://lessons.runrev.com/s/lessons/m/4 ... th-android
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: GPS based push notifications
Just making sure you guys have seen one of my new externals that does this on iOS. More info at http://mergExt/home/mergCL
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/