[Aerogear-users] Unclear when to use setContentAvailable()
matzew at apache.org
Thu Dec 3 13:23:06 EST 2015
it's an iOS feature, that you can use for having the app download something
(or check state on your backend), before the alert is being made visible to
Also (more interesting, I think) you can use it to send a slient message to
the device. E.g. when the app runs (fore/background) the callback is
invoked. You can use that to check state on your own backend (a 30 second
time window, you have for this), and if needed you could use that to, for
instance, issue something local e.g. local notifications (those are better
and more handy for several reasons e.g. better control of the badge icon):
On Thu, Dec 3, 2015 at 7:01 PM, Rob Willett <rob.aerogear at robertwillett.com>
> We now seem to have something approaching a stable and working UPS
> configuration. (Famous last words!) Thanks to the Aerogear team for helping
> resolve the background notifications on Android.
> As we are tidying up, we noticed (ahem) that we had commented out a few
> lines in our code.
> if (event['content-available'])
> // Still not clear what to do with this.
> // push.setContentAvailable(1);
> We went back to the Aerogear docs and tried to work out what
> setContentAvailable really does and what should we do with it. The docs for
> the function call are a little sparse, so we looked at the source code and
> we’re still no wiser.
> Is there a better explanation of when we should call setContentAvailable
> and with which parameter?
> Just to set the ball rolling we *think* it could mean that when you
> receive the content-available = 1 flag on iOS, we do a call to get some
> data from the server ourselves, if the the results of *our* server call
> indicate that we have received new data, we set the value to
> setContentAvailable to 1, if our function call to the server has no data,
> then we set it to zero and if something failed we set it to 2.
> So what happens if the value is 0, 1 or 2? if its 2, is a new new call
> made to something, if its 0 or 1 what happens?
> Apologies if we’ve missed the point of it, but we’re struggling to
> understand this.
> Aerogear-users mailing list
> Aerogear-users at lists.jboss.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Aerogear-users