Note that there are some explanatory texts on larger screens.

plurals
  1. POGCM message not pushed to phone
    primarykey
    data
    text
    <p>For the past few days I have been digging around to try and get a POC phonegap app working I am using PushPlugin from phonegap My apk is being built via the build.phonegap.com service</p> <p>The code below connects to GCM and generates a message ID but the device actually never gets the push notification</p> <p>What am I missing?</p> <pre><code> Dim regID As String = "APA91bHQX1wnaRjU_Sq_vIiUOjpHxAr3N3Y0XKwWS3SpowFA6iC73eqNRAsyb_9Z_NorhDpVpBXkLzzq94YWE0tRr9vY8gdEtJvxfVi9sF3xH09UvTvT9Heu_lTzhzEa1IO0i74KijNBaVgYjqrEXZDab9sCTclYxA" Dim request As WebRequest = WebRequest.Create("https://android.googleapis.com/gcm/send") request.Method = "POST" request.ContentType = "application/x-www-form-urlencoded" request.Headers.Add(HttpRequestHeader.Authorization, "key=AIzaSyCU80wS2pUy_6HGM6gJ4JTUdqGH9NhNa2M") request.Headers.Add("Sender: id=924375227132") Dim collapsKey = Guid.NewGuid.ToString("N") Dim postdata As String = "" &amp; _ "delay_while_idle=false" &amp; _ "&amp;time_to_live=108" &amp; _ "&amp;delay_while_idle=1" &amp; _ "&amp;collapse_key=" &amp; collapsKey &amp; "" &amp; _ "&amp;data.payload.msgcnt=3" &amp; _ "&amp;data.payload.message=Welcome to this app" &amp; _ "&amp;registration_id=" &amp; regID Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postdata) request.ContentLength = byteArray.Length Dim dataStream As Stream = request.GetRequestStream dataStream.Write(byteArray, 0, byteArray.Length) dataStream.Close() Dim resposne As WebResponse = request.GetResponse Dim dataresponse As Stream = resposne.GetResponseStream Dim reader As New StreamReader(dataresponse) Dim sResponseFromServer As String = reader.ReadToEnd Console.WriteLine(sResponseFromServer) reader.Close() dataresponse.Close() resposne.Close() </code></pre> <p>Phonegap HTML code</p> <pre><code> var pushNotification; function RegisterDeviceABCD() { try { alert("Here"); pushNotification = window.plugins.pushNotification; if ( device.platform == 'android' || device.platform == 'Android' ) { pushNotification.register( successHandler, errorHandler, { "senderID":"924375227132", "ecb":"onNotificationGCM" }); } else { pushNotification.register( tokenHandler, errorHandler, { "badge":"true", "sound":"true", "alert":"true", "ecb":"onNotificationAPN" }); } } catch(e) { alert(e); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload