Push Notifications to Desktop Apps

Hmmm. Well, I’m already doing syncing that uploads/receives data to a server. So presumably if the push notifications are locked down, my sync will be as well.

How do corporate environments handle all the stuff like Evernote and To Do apps that sync to a cloud service?

Everything is blocked except the solution that is blessed by the IT department.

[quote=482821:@Stephen Dodd]Hmmm. Well, I’m already doing syncing that uploads/receives data to a server. So presumably if the push notifications are locked down, my sync will be as well.
[/quote]

Since I don’t know how you are doing it right now and the security setup I can’t really say… if you are going over say port 80 or other well know port, it most likely is already open… or perhaps your users made a specific request to have it opened up. The only way you will really know is to have a talk with their ops people. Otherwise you are just guessing.

It really depends on the company, who owns the device etc… what had kind of a cloud service you are talking about and so on. If the cloud service is owned by the company, then everything may be on their own network, if you are syncing company data to a private cloud such as say ICloud or OneDrive etc… it probably is not allowed at all and if it is just your private stuff on your private device, they may have a separate “gust network” where you can connect and do this.

@Stephen Dodd

You started out with a very generic question and we’ve all made assumptions about what you are trying to do… perhaps if you could be a bit more specific, we could give you some better ideas… You are not the first person to do this and I’m sure there are people on here who have experienced all kinds of situations…

A few questions to start:

  • If I understand it correctly, your issue right now is that your server is being swamped with ping requests to check if anything has changed, is that right?
  • Are you writing the software for a particular customer or is it targeted at the general public?
  • Where is the sync server located? On a public cloud or within a corporate environment?

Hey James,

Yes, sorry. I didn’t want to bog people down in the details.

It’s a time tracking app used by both the general public and some corporate environments though more small to mid sized than large.

I’m using Zumero (Zumero.com) to sync local SQL databases with a MS Azure Server. The actual sync process is done with a helper app that talks to Xojo. It’s currently syncing every 10 seconds and 98% of those syncs are null syncs. That is, asking if there’s anything new and getting nothing in return. With over 1,000 clients, that’s over 2 million syncs a day and I’m worried the server costs will be about the size of a small car per month.

So I’m trying to determine if I should/could make use of a 3rd party event notification service that talks to some kind of Xojo desktop Websockets class. The Xojo app would tell it when a change has been made an other Xojo clients would receive the notification.

Alternatively I could setup some kind of simple key-value database on AWS or something and constantly poll it asking if there’s anything new for this client. The client would update it’s corresponding value and date when it uploads something. This would presumably use Xojo’s HTTPSocket/URLConnection for communication. I have no experience with AWS or noSQL and am open to suggestions.

The third option is have Xojo do some kind of long polling per Douglas’ suggestion. (Asking the server for info and having the server wait indefinitely before responding that something has changed.) Not sure what kind of web service would be used with that.

The question is would either of these options be more likely to make it through company firewalls. And which will be easiest to setup?

I really appreciate all the advice I’ve received so far! :slight_smile:

Could you not have your XOJO app use HTTP Post to a simple PHP page that requests whether a sync is necessary? This would be just tiny bits of information and very fast, not server intensive at all, just web traffic.

On the app side every time you write to the database you would create/edit a new value in the table (auto increment etc.). Store that value in the LOCAL DB. To see if a sync is necessary send the local value to the PHP page, which accesses the DB (securely) and send back whether a full sync is necessary (they don’t match). You probably already have a way to determine if the local DB and remote DB need to be synced.

I did something very similar with an AZURE SQL DB. The Azure websites are free, can be securely connected to the Azure DB. The PHP is about 20 -30 lines of code to access the DB. I don;t remember if there were costs associated with reading the DB, but the data to determine if a sync is necessary was so small it was negligible.

Maybe I am simplifying it too much or not fully understanding. Anyway, just some ideas.