<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 26, 2015 at 11:24 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>
<p dir="auto">Hi,</p>

<p dir="auto">We’ve got iOS notifications working well and so we thought we’d push our luck and get Android notifications up and running. We’ve had them working before with another plugin so it can’t be that difficult….</p>

<p dir="auto">We’ve followed the guide from here</p>

<p dir="auto"><a href="https://aerogear.org/docs/unifiedpush/aerogear-push-android/guides/#troubleshooting" target="_blank">https://aerogear.org/docs/unifiedpush/aerogear-push-android/guides/#troubleshooting</a></p>

<p dir="auto">The Google web interface has changed but its still pretty much the same.</p></div></blockquote><div><br></div><div>A member of our docs team is already on it:</div><div><a href="https://issues.jboss.org/browse/AGPUSH-1536">https://issues.jboss.org/browse/AGPUSH-1536</a><br></div><div><br></div><div>-M</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>

<ol>
<li value="1"><p dir="auto">We’ve got and logged the Project Number (which is the Sender Id).</p></li>
<li value="2"><p dir="auto">We’ve created a new server API key (is this the same as the GCM Messaging key?)</p></li>
</ol>

<p dir="auto">This appears to be all thats needed. We have an very old version of our app sitting in development in the Google Play Store but its never been released as we focussed on the iOS version. That used to linked to the GCM information but we have unlinked that now.</p>

<ol>
<li value="3"><p dir="auto">We have created a new variant on the UPS for Android. We create a name, description and where it asks for the Google Cloud Messaging Key we enter the Server API key we created in point 2. This is a bit we are unclear about, is the google Cloud Messaging Key the same as the Server API key we generated in Google Play services console? One of the things we noticed is that the example Google Cloud Messaging Key in the UPS dialogue box starts with a different few header bytes e.g. 5a44 whereas all the Server ApI keys start Alza. We are not experts on cryptography but we thought that <em>might</em> indicate a different type of key. It also might be nothing at all and Google has simply updated something.</p></li>
<li value="4"><p dir="auto">We add in the Project number.</p></li>
<li value="5"><p dir="auto">This creates the Android variant in the UPS dashboard. If we click on the variant we can see the expanded information showing the Server URL, the Variant ID and the Variant Secret.</p></li>
<li value="6"><p dir="auto">This seems to work much the same as the iOS variant.</p></li>
<li value="7"><p dir="auto">We then update our Cordova app and update the pushConfig field.</p></li>
</ol>

<pre><code>                var aeroGearPushConfig = {
                    pushServerURL: &quot;<a href="https://push-jambuster.rhcloud.com/ag-push/" target="_blank">https://push-jambuster.rhcloud.com/ag-push/</a>&quot;, // Checked that this matches the Android variant.
                    ios: {
                        variantID: “XXXXX-TTTc-OOOO-RRRR-BBBHBHBH”, // Obscured
                        variantSecret: “JKJKJ-HHHH-PPOPIO-sdsds-1231232” // Obscured
                    } ,
                    android: {
                        senderID: “XXXXXX” , // Changed to protect the innocent but checked that the senderID is the same as the Google Project Id
                        variantID: “345345-345345-45345-xxxx-zzzzz” , // Changed but checked to make sure this is the Android VariantId
                        variantSecret: &quot;9b762d92-a7f0-4e8b-b6e4-adde4950c7e6&quot; // Changed but checked to make sure this is the Android VariantSecret
                    } ,
                    sendMetricInfo: true,
                    alias: UUID // This is a unique string
                };
</code></pre>

<p dir="auto">We compile and run it on a real device, a Nexus 5. We create a unique alias to be sent to be sent as the alias. This is the UUID field</p>

<ol>
<li value="8"><p dir="auto">When we run the code and inspect the output in Chrome, the aeroGear Success Handler is called which we hope means success.</p></li>
<li value="9"><p dir="auto">When we inspect the variant in the UPS dashboard, we can see that the a device with the right alias is created. The alias matches the alias we sent.</p></li>
<li value="10"><p dir="auto">This all looks good. We have three real (i.e. non simulator) test devices in our UPS dashboard, two iOS devices and one Android device.</p></li>
<li value="11"><p dir="auto">We click on the Send Push icon in the UPS dashboard to create some sample notifications. We send a simple test message to all variants. The two iPhones each get the test message and the Android phone doesn’t.</p></li>
<li value="12"><p dir="auto">We click on the Dashboard icon in the UPS console, and then recent activity. We can see that the UPS server thinks it has sent the test message to the iOS and the Android variants. with no issues. We get alerts for the iOS pop up but nothing for the Android version.</p></li>
</ol>

<pre><code>Notification    Receivers    Status    Timestamp
 {&quot;ipAddress”:”XX.YY.ZZ.216&quot;,&quot;clientIdentifier&quot;:&quot;A...    3 installations    Succeeded    26 Nov, 10:09:04, 2015
Request IP:    XX.YY.ZZ.216    Details
Message:    test11
Variants:    
Android Jambuster    Succeeded    1 installations
Jambuster Development    Succeeded    2 installations
</code></pre>

<ol>
<li value="13"><p dir="auto">The main UPS console doesn’t report any errors and it states that 3 installations are registered. We’ve sent 657 notifications since yesterday trying to see what the problem is. We though that using the UPS console removed any issues with us creating the test message. Since we can see the iOS devices getting the test message, we are struggling to understand why the Android wouldn’t.</p></li>
<li value="14"><p dir="auto">We’ve tried with the Android app running in the foreground, background and not running at all to see if that makes any difference and still nothing comes through. </p></li>
<li value="15"><p dir="auto">If we look at the log files using roc tail, we can see that the messages get passed on. No error messages are reported.</p></li>
</ol>

<pre><code>2015/11/26 05:20:38,528 INFO  [PushNotificationSenderEndpoint] (EJB default - 7) Processing send request with &amp;apos;[alert=Test12, criteria=[aliases=null, deviceTypes=null, categories=null, variants=null], time-to-live=-1]&amp;apos; payload
2015/11/26 05:20:38,530 INFO  [PushNotificationSenderEndpoint] (http-/127.3.204.1:8080-5) Message submitted to PushNetworks for further processing
2015/11/26 05:20:38,533 INFO  [GCMPushNotificationSender] (EJB default - 7) Sending payload for [1] devices to GCM
2015/11/26 05:20:38,590 INFO  [GCMPushNotificationSender] (EJB default - 7) Message to GCM has been submitted
2015/11/26 05:20:38,726 INFO  [APNsPushNotificationSender] (EJB default - 7) Message to APNs has been submitted
</code></pre>

<p dir="auto">Whilst it is impossible for people to debug our code and we don’t want people to, we’re struggling to understand what we could have done wrong. The fact we are getting iOS messages through whilst Android messages are failing (but with no error) is perplexing. We have rebuild the Server API kets in Google, deleted and rebuilt the Android variant but we’ve now hit a brick wall. We have a nagging feeling it is something to do with the GCM Server API key but everything reports OK. </p>

<p dir="auto">Any and all suggestions gratefully received. </p>

<p dir="auto">Thanks</p><span class=""><font color="#888888">

<p dir="auto">Rob</p>

</font></span></div><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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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></div>
</div></div>