<div dir="ltr">Hi Rob,<div><br></div><div>First of all let&#39;s be clear that the &#39;content-<span style="font-size:12.8px">available</span>&#39; flag is a iOS implementation (part of the background fetch) and that it should start your app [1], but this is handled by the OS and there are some heuristics involved that is why you have to set the NewData [2]. So you can&#39;t be certain that it will 100% of the time, will start your app.</div><div><br></div><div>For android we don&#39;t have any mechanism atm to enable background notifications, although I think we could add it.</div><div><br></div><div>[1] <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/index.html#jumpTo_12">https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/index.html#jumpTo_12</a></div><div>[2] <a href="https://aerogear.org/docs/guides/aerogear-cordova/AerogearCordovaPush/#_ios_background_notification">https://aerogear.org/docs/guides/aerogear-cordova/AerogearCordovaPush/#_ios_background_notification</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 14, 2015 at 9:36 AM, Rob Willett <span dir="ltr">&lt;<a href="mailto:rob.aerogear@robertwillett.com" target="_blank">rob.aerogear@robertwillett.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Erik,<br>
<br>
Our focus has been on iOS and I realise that I should have stated this<br>
in my mail message. Apologies.<br>
<br>
Currently IOS does not start our app when the iPhone receives an<br>
AeroGear notification with content-available = 1 in it AND (the app has<br>
not been started OR is in the background). Basically we start the iOS<br>
app, send a notification to check it works in the foreground. We then<br>
swipe up to stop the app, send a new notification down, the new<br>
notification is displayed BUT the AeroGear call back to handle the<br>
notification is not called. If there is a a magic combination of alert<br>
and content-available flags to make this happen we’d be happy to put<br>
them in our code but we cannot see anything happening at all. We have<br>
not checked Android for this behaviour, as for technical reasons we<br>
&lt;cough&gt; I &lt;cough&gt; broke our last Nexus 5 phone on Friday and have not<br>
replaced it yet. We’ll have a new one tomorrow.<br>
<br>
What we have to do at the moment is check to see if the app has received<br>
the silent notification as it will then make a callback to our server,<br>
if there has been no callback wishing 60 secs, our server sends a full<br>
notification with an alert in that is displayed by the device. The<br>
downside to this method is that we lose the ability to clean out old<br>
notifications using the silent notification AND a local cordova plugin,<br>
local-notifications.<br>
<br>
Our thinking is that both iOS and Android should start up in the<br>
background when they receive a notification with an empty alert AND a<br>
content-available = 1 flag AND the app is not running. We could use<br>
Apple background-fetch to get 30 secs of processing and then shutdown<br>
again. Unclear as to the system on Android.<br>
<br>
We have also now seen that Apple very aggressively moves Apps from a<br>
background state to a suspended state after not very long, which also<br>
means that the app doesn’t respond to content-available = 1 flags. We<br>
haven’t worked out how long this interval is, but its not hours. This<br>
actually underscores the importance of handling the content-available =<br>
1 flag working when apps are suspended or not started.<br>
<br>
We are really starting to dislike Apples notification implementation.<br>
<br>
Rob<br>
<br>
The email address is list specific, we have our own mail servers so its<br>
easy to simply use specific emails which we can then track. Its easy to<br>
block as well if they get spammed.<br>
<span class=""><br>
On 14 Dec 2015, at 8:15, Erik Jan de Wit wrote:<br>
<br>
&gt; Hi Rob,<br>
&gt;<br>
&gt; Currently this is how background notifications (content-available)<br>
&gt; should<br>
&gt; work on iOS, but on Android the notification doesn&#39;t start up the app<br>
&gt; only<br>
&gt; when the user &#39;touches&#39; the notification is the app started. I think<br>
&gt; we<br>
&gt; could change this behaviour, for instance when you send a notification<br>
&gt; that<br>
&gt; doesn&#39;t contain any alert message. I think recently some more users<br>
&gt; have<br>
&gt; experimented with how to &#39;enable&#39; background notifications on android.<br>
&gt; What<br>
&gt; do you think?<br>
&gt;<br>
&gt; p.s. I like your email address<br>
&gt;<br>
&gt; On Fri, Dec 11, 2015 at 6:59 PM, Rob Willett<br>
&gt; &lt;<a href="mailto:rob.aerogear@robertwillett.com">rob.aerogear@robertwillett.com</a><br>
&gt;&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; We’re trying to work out if the Aerogear Cordova push notification<br>
</span>&gt;&gt; *should* start the app if the app is not started. If the app is in<br>
<span class="">&gt;&gt; the<br>
&gt;&gt; background than we get the notification but if the app is not started<br>
&gt;&gt; up we<br>
</span>&gt;&gt; don’t *seem* to get anything happening.<br>
<div class="HOEnZb"><div class="h5">&gt;&gt;<br>
&gt;&gt; It seems to work OK when the app is in the foreground or background,<br>
&gt;&gt; just<br>
&gt;&gt; not when its not started up?<br>
&gt;&gt;<br>
&gt;&gt; Should it work when the app is not started on both iOS and Android?<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt; Rob<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Aerogear-users mailing list<br>
&gt;&gt; <a href="mailto:Aerogear-users@lists.jboss.org">Aerogear-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Cheers,<br>
&gt;     Erik Jan<br>
&gt; _______________________________________________<br>
&gt; Aerogear-users mailing list<br>
&gt; <a href="mailto:Aerogear-users@lists.jboss.org">Aerogear-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a><br>
_______________________________________________<br>
Aerogear-users mailing list<br>
<a href="mailto:Aerogear-users@lists.jboss.org">Aerogear-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-users" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Cheers,<div>       Erik Jan</div></div></div>
</div>