Pushing near real time position updates to a number of clients - windows-8

I'm currently in the early stages of designing a cross-platform mobile app (iOS, Android, WP8). At its core, the application will allow proximity based interaction between an unknown number of client devices.
Could someone recommend a framework or technology that would allow me to push server generated location based proximity alerts to the clients that even scales well? Could push notifications (cross platform using PushSharp) be a viable option for this, or will Push notifications always go hand in hand with some kind of toast notification on the device?
Update: 30 seconds or even a minute delay should do.

Push Notifications have way to much latency to give you anything near real-time. Also Push Notifications are not guaranteed to reach a device.
You really need to think about how much time constrained the location updates should be. You should also make some tests with how fast the GPS on various devices updates. I have tested on a Nexus 4 and it is not near real-time either. So throughout your entire application whether it is server side or client side you will have things blowing your real-time wishes.
However IF you can live with a delay of a couple of seconds to maybe 30 seconds or more, Push Notifications my work well for you, they also scales quite nicely.
EDIT:
Push notifications always go hand in hand with some kind of toast
notification on the device?
There is a concept called RAW notifications, which allow you to send arbitrary information with the Notifications. However personally I would just notify the client about updates ready on a server, where it then can get all the information the application needs. This is because as I said Push Notifications are not guaranteed to ever reach the device, but also because you are limited to how much information you can embed in the Notifications.
So my suggestion for a flow would be:
Client A updates its location and sends it to a web service
Web Service receives info from Client A and prepares notifications for all the other Clients, which need information about Client A and pushes information about they need to update their info.
Client B receives a Push Notification telling it to refresh data from the Web Service and does that.
That would work well if the application is in a background state. When showing in the foreground I would simply poll a server every second or so; Still receiving Notifications just forcing the client to update.

For the "scales well" part, you might also want to take a look at Windows Azure Service Bus Notification Hubs. It's currently in preview and supports only Windows 8 Store apps and iOS but support for Android and Windows Phone is on the way.

Related

Use Firebase cloud messaging or let the app asks for event and fire notification with an API?

We are developing an app for Android and IOS for students. student can receive notification for upcoming events like exams or interviews.
We are between two decisions: Using FCM with the development of a backed which manages the sending of notifications and the registration of tokens or using the schedulers that exist in IOS and Android then download a list of events from an API regularly and trigger a local notification which will require less development on the backend side but a little more on the frontend side.
What would be best in your opinion and can we trigger a notification even if the app is closed for the 2nd solution?
I would deffinitely recommend to use FCM. It is much easier than it looks like and the performance of your notifications would be much better regarding stability, timing, battery persistance and other. You can use on of the Firebase databases to store the notification tokens and the Firebase Cloud Functions to send them from there. I have made a very similar App for Kindergarden children and it works great. I'm not sure if it would even work at all when you do it on your own. At least not as you expect it. For me that sounds like much more work.

Daily scheduled notifications

I need a bit of guidance, so for my application i'm looking at using local notifications to send a notification every morning at 7 o'clock.
The issue i'm having is how can i make the content for the local notification dynamic mainly the body and the attached image? As it will vary for the user on a daily basis.
What would be the best way to go about this since you can't edit future notifications.
Here's a little lesson about notifications. First, what is a notification? It's basically an alert presented on your behalf by the system. Second, there are two kinds of notification: local and remote.
Let's imagine, then, an app that aims to present a notification to the user every morning at 7 AM saying what the current temperature is outside. (Assume for purposes of the example that we have a way of learning this information.)
A moment's thought will reveal that this cannot be done with local notifications. We cannot know the current temperature at 7 AM until 7 AM (or close to it) and we cannot schedule the notification unless the app is running. Therefore we would need the great good luck to have the app running at 6:59 AM in order for this app to work. But an app only runs when the user summons it, so that is extremely unlikely.
Therefore a task of this kind is possible only with remote notifications. A remote server is always running; therefore it can get the temperature and "ping" the user's device at 7 AM, and the system will present the notification on your behalf. You would therefore need to possess such a server in order to write the imagined app.
(An alternative using local notifications would be this: You schedule, say, a week's worth of local notification in advance. Then if you have the great good luck to find the app running before a notification is presented, you tear down all the scheduled notifications and do it again with a more up-to-date forecast. But of course this cannot possibly work as well as using remote notifications, and it will stop working entirely after a week if the user doesn't launch the app. That, to put it bluntly, sounds pretty lame.)

How to create background location service in Appcelerator Titanium working after restarting device

I want to make an application which will send information to a server about user's location every 30min. It is needed to provide location specific push notifications.
I need such functionality for Android/iOS, which would work in background (also if device is restarted). I found some articles covering background services and I created background service doing that, but after phone is restarted it won't work.
Is it possible with Android and iOS? How can I achieve that?
With iOS, no. With Android, yes.
Apple has gone to great lengths to limit what apps can do. You can do some things in the background for an extended period of time (GPS, play audio, Voip, etc), but after a reboot your app will not be restarted until the user opens it again. There are exceptions to this. Voip apps are allowed to restart after a reboot, but apple will not approve your app for the App Store unless you actually have a place for a user in your app to use the Voip feature. Geofences are a possibility, but I haven't had experience with that feature yet. In my experience, Apple does whatever they can to make sure your app doesn't run forever.
With android, there is more flexibility and what you propose is totally possible. I've listed some important links below, since most of those solutions are far better documented than what I can do here.
Essentially you need to register as a boot receiver and then send an intent to start a titanium android service when the boot event is received. I don't have experience with starting a titanium service, but I'm sure its a simple intent you need to fire. Either way you'll need a module for this native code. I attached a link to a bencoding titanium module that may help you, although there may be some others out there. You may even need to code one yourself.
Samsung is notorious for stopping your app with their SPCM feature. You may want to familiarize yourself with it. I've added a stackoverflow discussion link below.
I don't know all of your system requirements but honestly, for any app I would try my best to not run forever. It will hurt the battery life for your users and will add a lot of complexity. Maybe you could simply have the app check the GPS coordinates when it receives a push notification and decide right there and then whether to present a notification to the user? Just something to consider.
Either way good luck!
How to start an Application on startup?
http://docs.appcelerator.com/platform/latest/#!/guide/Android_Services
https://github.com/benbahrenburg/benCoding.Android.Tools
Dealing with Samsung SPCM killer

Passbook push notification on Android?

Is there a way to send push notification with passbook on android ?
I found this https://www.pass2u.net, but i'm not quite convinced...
pass2u have an open API and offer free access to pass issuers with less than 1000 updates per month. One advantage over PassWallet is that their revenue model is not dependent upon advertising.
Both pass2u and PassWallet have reliable APIs that closely mirror the Passbook webservice and can be easily implemented with minimal overhead.
One further advantage of Pass2u over PassWallet is their support for Baidu push. If you have users in China then PassWallet updates will not work because they are dependent on the Google cloud messaging APIs which are not available.
The PassWallet app supports push notifications. It uses the same mechanism and API as Passbook/Wallet on iOS, the only difference being where you send the push notifications.
When a pass is installed, it registered with your service as normal, but in addition to the serial number etc. a URL is provided too. You then send a message to that URL.
You'll find more info here http://attidomobile.com/portfolio/passwallet/

WinRT live tile on system startup

I have a live tile working which updates how many users are online and how many lobbies are open within the app. This begins updating when my app loses its visibility (no point it updating the live tile whilst the app is running), but I want it to update when I first turn the computer on.
I have had a look around and mentions of making the app a lock screen app have popped up but that is all, no explanation how to do it.
Does anyone know how to do this and provide a nice little explanation or link of how to do so?
Many thanks,
Kevin
You should use push notifications for this kind of behaviour. This msdn link has more info:-
Using tile notifications
Choosing the right notification method to update your tile
There are several mechanisms which can be used to update a live tile:
Local API calls
One-time scheduled notifications, using local content
Push notifications, sent from a cloud server
Periodic notifications, which pull information from a cloud server at a fixed time interval
The choice of which mechanism to use largely depends on the content you want to show and how frequently that content should be updated. The majority of apps will probably use a local API call to update the tile when the app is launched or the state changes within the app. This makes sure that the tile is up-to-date when it launches and exits. The choice of using local, push, scheduled, or polling notifications, alone or in some combination, completely depends upon the app. For example, a game can use local API calls to update the tile when a new high score is reached by the player. At the same time, that same game app could use push notifications to send that same user new high scores achieved by their friends.
You're right with the assumption that you require a lock screen capability to be able to run background tasks without your app being started once. The main process would be to extract the part of your application that gets the data into a background task that is probably triggered by a timer and write some code to be on the lock screen.
When I first encountered that restriction I was kind of surprised, but in terms of battery performance this design decision makes sense: Only consume battery power if the data is absolutely worth it. If it's worth, it is also of interest having it on the lock screen.
On MSDN is a good overview about lock screen along with further reading links. It's much better than what I could type in here. Come back with problems related the implementation (which actually even better fits the purpose of SO). This blog might be useful, too.