yeah, I meant the flag. Glad it works for you.<div><br></div><div>I am actually over <span></span>asked on the client setContentAvailable(). </div><div><br></div><div><br></div><div>We have the same in our java sender, but that triggers the flag ;)<br><div><br>On Thursday, 3 December 2015, Rob Willett <<a href="mailto:rob.aerogear@robertwillett.com">rob.aerogear@robertwillett.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Matthia,<br>
<br>
Thanks for this. Are you referring to content-available flag or the<br>
setContentAvailable function?<br>
<br>
We already send silent notifications out to our Android and Apple<br>
devices and the devices handle these correctly.<br>
<br>
Our logic goes that we send a silent notification to the device via UPS,<br>
the device then connects to the server and pulls some data from the<br>
server. If our app is in the foreground, we set a tiny alert in the top<br>
left of the screen telling the user that something is ready for them, if<br>
our app is in the background we set a notification up in the drawer<br>
using a local-notification plugin, if the app is not started then the<br>
fact the app has not pulled data from the server acts as a flag and we<br>
then send down full notifications to the device. The local-notifications<br>
and the ‘full fat’ notifications all work the same way when the user<br>
clicks on them.<br>
<br>
We have all of this is working now without setContentAvailable. Its much<br>
as you outlined below. I have two phones on my desk as we speak, an<br>
Apple and an Android and we are comparing how the notifications look as<br>
we ping different data down to them in different situations. We’re<br>
down to design looks now rather than programming :)<br>
<br>
We’re just trying to work out how setContentAvailable fits into all of<br>
this, because we aren’t using it at all! Should we be?<br>
<br>
Rob<br>
<br>
On 3 Dec 2015, at 18:23, Matthias Wessendorf wrote:<br>
<br>
> Hi,<br>
><br>
> it's an iOS feature, that you can use for having the app download<br>
> something<br>
> (or check state on your backend), before the alert is being made<br>
> visible to<br>
> the end-user:<br>
> <a href="https://developer.xamarin.com/guides/ios/application_fundamentals/backgrounding/part_3_ios_backgrounding_techniques/updating_an_application_in_the_background/#Remote_Notifications_iOS_7_and_Greater" target="_blank">https://developer.xamarin.com/guides/ios/application_fundamentals/backgrounding/part_3_ios_backgrounding_techniques/updating_an_application_in_the_background/#Remote_Notifications_iOS_7_and_Greater</a><br>
><br>
><br>
> Also (more interesting, I think) you can use it to send a slient<br>
> message to<br>
> the device. E.g. when the app runs (fore/background) the callback is<br>
> invoked. You can use that to check state on your own backend (a 30<br>
> second<br>
> time window, you have for this), and if needed you could use that to,<br>
> for<br>
> instance, issue something local e.g. local notifications (those are<br>
> better<br>
> and more handy for several reasons e.g. better control of the badge<br>
> icon):<br>
> <a href="https://developer.xamarin.com/guides/ios/application_fundamentals/backgrounding/part_3_ios_backgrounding_techniques/updating_an_application_in_the_background/#Silent_Remote_Notifications" target="_blank">https://developer.xamarin.com/guides/ios/application_fundamentals/backgrounding/part_3_ios_backgrounding_techniques/updating_an_application_in_the_background/#Silent_Remote_Notifications</a><br>
><br>
> HTH,<br>
> Matthias<br>
><br>
><br>
> On Thu, Dec 3, 2015 at 7:01 PM, Rob Willett<br>
> <<a href="javascript:;" onclick="_e(event, 'cvml', 'rob.aerogear@robertwillett.com')">rob.aerogear@robertwillett.com</a>><br>
> wrote:<br>
><br>
>> Hi,<br>
>><br>
>> We now seem to have something approaching a stable and working UPS<br>
>> configuration. (Famous last words!) Thanks to the Aerogear team for<br>
>> helping<br>
>> resolve the background notifications on Android.<br>
>><br>
>> As we are tidying up, we noticed (ahem) that we had commented out a<br>
>> few<br>
>> lines in our code.<br>
>><br>
>> if (event['content-available'])<br>
>> {<br>
>> // Still not clear what to do with this.<br>
>> // push.setContentAvailable(1);<br>
>> }<br>
>><br>
>> We went back to the Aerogear docs and tried to work out what<br>
>> setContentAvailable really does and what should we do with it. The<br>
>> docs for<br>
>> the function call are a little sparse, so we looked at the source<br>
>> code and<br>
>> we’re still no wiser.<br>
>><br>
>> Is there a better explanation of when we should call<br>
>> setContentAvailable<br>
>> and with which parameter?<br>
>><br>
>> Just to set the ball rolling we *think* it could mean that when you<br>
>> receive the content-available = 1 flag on iOS, we do a call to get<br>
>> some<br>
>> data from the server ourselves, if the the results of *our* server<br>
>> call<br>
>> indicate that we have received new data, we set the value to<br>
>> setContentAvailable to 1, if our function call to the server has no<br>
>> data,<br>
>> then we set it to zero and if something failed we set it to 2.<br>
>><br>
>> So what happens if the value is 0, 1 or 2? if its 2, is a new new<br>
>> call<br>
>> made to something, if its 0 or 1 what happens?<br>
>><br>
>> Apologies if we’ve missed the point of it, but we’re struggling<br>
>> to<br>
>> understand this.<br>
>><br>
>> Thanks,<br>
>><br>
>> Rob.<br>
>><br>
>> _______________________________________________<br>
>> Aerogear-users mailing list<br>
>> <a href="javascript:;" onclick="_e(event, 'cvml', 'Aerogear-users@lists.jboss.org')">Aerogear-users@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a><br>
>><br>
>><br>
><br>
><br>
> --<br>
> Matthias Wessendorf<br>
><br>
> blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
> sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
> twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
> _______________________________________________<br>
> Aerogear-users mailing list<br>
> <a href="javascript:;" onclick="_e(event, 'cvml', 'Aerogear-users@lists.jboss.org')">Aerogear-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a><br>
<br>
_______________________________________________<br>
Aerogear-users mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Aerogear-users@lists.jboss.org')">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a><br>
</blockquote></div></div><br><br>-- <br>Sent from Gmail Mobile<br>