{"id":242,"date":"2016-06-18T11:39:51","date_gmt":"2016-06-17T23:39:51","guid":{"rendered":"https:\/\/micro.muppetz.com\/blog\/?p=242"},"modified":"2019-04-24T12:26:45","modified_gmt":"2019-04-24T00:26:45","slug":"debugging-issues-with-pushbullet-and-google-play-services","status":"publish","type":"post","link":"https:\/\/micro.muppetz.com\/blog\/2016\/06\/18\/debugging-issues-with-pushbullet-and-google-play-services\/","title":{"rendered":"Debugging Issues with Pushbullet and Google Play Services"},"content":{"rendered":"<h1>Background<\/h1>\n<p>I&#8217;m posting this because every day there&#8217;s a new post on <a href=\"https:\/\/www.reddit.com\/r\/pushbullet\">\/r\/pushbullet<\/a>\u00a0about people\u00a0not getting their <a href=\"https:\/\/pushbullet.com\">Pushbullet <\/a>messages until they open the Pushbullet app. \u00a0There&#8217;s a number of reasons that this issue can arise, some of them are unrelated to Pushbullet itself, but will cause the symptoms, some are\u00a0related to Pushbullet though no definitive answer has been found for this yet. \u00a0This article will help you to diagnose issues unrelated to Pushbullet &#8211; if following the steps and suggestions don&#8217;t help then escalating to Pushbullet&#8217;s support would be a good next step.<\/p>\n<p>To kick off this article, I&#8217;ll explain briefly how push notifications work\u00a0<em>for most applications, but not all<\/em> on Android. \u00a0Almost every Android phone out there has <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.gms\">Google Play Services<\/a>\u00a0installed. \u00a0This &#8220;App&#8221; is pre-installed on your phone and is the support library that all Google Apps\u00a0<strong>and many others<\/strong> rely on. \u00a0One of it&#8217;s many jobs is to provide the &#8220;<a href=\"https:\/\/developers.google.com\/cloud-messaging\/\">Google Cloud Messaging<\/a>&#8221; (GCM) service.<\/p>\n<p><strong>2019 update.\u00a0 GCM is now FCM (Firebase Cloud Messaging) but I&#8217;m not going to update this blog post to change it all, it&#8217;s still the same basic thing.<\/strong><\/p>\n<p>This, very simply, allows a server\/service hosted somewhere to send a message to Google, and Google will then, using GCM, push a message to the user&#8217;s phone.<\/p>\n<p>The reason that GCM is so useful is that apps can register with it when they&#8217;re installed. \u00a0This means that each app doesn&#8217;t have to have it&#8217;s own network\/infrastructure for pushing messages to your phone, but rather there is a single push service on your phone that all apps can use. \u00a0This helps with battery life and means that App developers can focus on writing apps, not having to also host and maintain a network dedicated to pushing messages to phones. It also means your phone only has to have one network connection open to get push messages, instead of each app having to keep a network connection open, which is a drain on resources and battery life.<\/p>\n<h2>The Problem<\/h2>\n<p>Now the problem comes about with Pushbullet when it doesn&#8217;t get messages from GCM. \u00a0These messages should &#8220;Wake it up&#8221; so that you instantly get the push on your phone.<\/p>\n<p>But if Pushbullet doesn&#8217;t get the GCM notification, <span style=\"text-decoration: underline;\">it has no idea<\/span> that anything new has happened. \u00a0It only realises when you open the app and it\u00a0<em>Sets up it&#8217;s own connection to the Pushbullet Servers and gets the latest notifications.<\/em> \u00a0In fact, that&#8217;s all a GCM message is, a message to say &#8220;Hey, wake up and check your server for the\u00a0message waiting for you, Pushbullet&#8221;.<\/p>\n<p>So if this isn&#8217;t working for you, there&#8217;s a few things you can do to debug (and hopefully resolve) the issues so that your Pushbullet app starts working as you expect. \u00a0Depending on the problem, you might find other apps you didn&#8217;t even realise were lagging seem to be a lot faster too!<\/p>\n<h1><strong>Debugging Google Play Services<\/strong><\/h1>\n<p>Thankfully, Google have included a way to find out the status of Google Play Services and whether or not it has an active connection to the GCM services. \u00a0Type the following code into your dialer and you&#8217;ll open up the Google Play Services status page:<\/p>\n<h5>Dialer Debug Code<\/h5>\n<pre>*#*#426#*#*<\/pre>\n<p>You will open up a screen that looks like this:<\/p>\n<div id=\"attachment_249\" style=\"width: 179px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-249\" class=\"wp-image-249 size-medium\" src=\"https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM1-169x300.png\" alt=\"GCM Connected\" width=\"169\" height=\"300\" srcset=\"https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM1-169x300.png 169w, https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM1-768x1365.png 768w, https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM1-576x1024.png 576w, https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM1-624x1109.png 624w, https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM1.png 1440w\" sizes=\"auto, (max-width: 169px) 100vw, 169px\" \/><\/a><p id=\"caption-attachment-249\" class=\"wp-caption-text\">GCM Connected<\/p><\/div>\n<p>Notice the following things about this image:<\/p>\n<p><strong>Device ID<\/strong>: The Device ID that Google has assigned your device.<br \/>\n<strong>Connected<\/strong>: This is the key we&#8217;re looking for! We want to see that it says connected and a lot of information about how it&#8217;s connected.<\/p>\n<p>This is what a bad\/broken\/non-working GCM screen looks like:<\/p>\n<div id=\"attachment_250\" style=\"width: 179px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-250\" class=\"size-medium wp-image-250\" src=\"https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM2-169x300.png\" alt=\"GCM Disconnected\" width=\"169\" height=\"300\" srcset=\"https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM2-169x300.png 169w, https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM2-768x1365.png 768w, https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM2-576x1024.png 576w, https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM2-624x1109.png 624w, https:\/\/micro.muppetz.com\/blog\/wp-content\/uploads\/2016\/06\/GCM2.png 1440w\" sizes=\"auto, (max-width: 169px) 100vw, 169px\" \/><\/a><p id=\"caption-attachment-250\" class=\"wp-caption-text\">GCM Disconnected<\/p><\/div>\n<p>What follows is a list of \u00a0reasons (and some workarounds\/fixes) as to why Google Play Services might not have a connection&#8230;<\/p>\n<h2>Why doesn&#8217;t it work?<\/h2>\n<p><strong>IPv6 is enabled.<\/strong> For me, IPv6 works fine. But for a lot if people, if their router\/WiFi is giving them an IPv6 connection, but it&#8217;s not properly routed, then it won&#8217;t work. But for reasons unknown, Google will keep trying to use the IPv6 connection, even though it&#8217;s broken. Sadly on Android the only way to disable IPv6 is via root methods, there is no simple way for a non-rooted person to do it. The best option if you&#8217;re not rooted is to disable the router\/WiFi you&#8217;re connected to from giving you an IPv6 address. Of course if you&#8217;re at work etc then getting the IT people to do this is probably an impossible task.<\/p>\n<p><strong>The GCM Ports are\u00a0Firewalled.\u00a0<\/strong>This is less likely, but certainly possible if your work environment only allows port 80\/443 out. \u00a0GCM uses TCP Port 5228 (The standard Jabber Port!), but it can also sometimes use TCP Port 5229 and 5230. \u00a0If these ports are blocked, you won&#8217;t get a stable GCM connection.<\/p>\n<p><strong>Your Firewall\u00a0has dumb sessions timeout.\u00a0<\/strong>I&#8217;m not sure how valid this one is with later versions of GCM, but if you have a firewall that times out TCP sessions after 5 minutes, you could well have issues with GCM which only sends keepalives every ~29 minutes (<strong>This is not confirmed yet<\/strong>).<\/p>\n<h1>The Fixes<\/h1>\n<h4>Use Mobile data (disable WiFi).<\/h4>\n<p>Annoying, but great as a quick workaround to see if it fixes the problem.<\/p>\n<h4>Run a VPN.<\/h4>\n<p>This is what I did at a place of employment where IPv6 was broken. The VPN gives your phone a IPv4 only address and Google Play Services will connect via it and work fine.<\/p>\n<h1>Is GCM not the issue?<\/h1>\n<p>If you&#8217;ve looked at the above but you&#8217;re finding that you&#8217;re still missing push messages, one &#8220;fix&#8221; is to uninstall and re-install Pushbullet. \u00a0Why this is required is still under investigated by the PB devs. \u00a0A way to test if only Pushbullet is affected is to get someone to send you a test Google Hangouts message, or to send yourself a Gmail (has to be Gmail, not an IMAP account). \u00a0These both notify your phone of a new message by using GCM. \u00a0If you&#8217;re getting Gmail\/Hangouts notifications instantly with no delay, but getting delays with Pushbullet, then the issue isn&#8217;t GCM and something else is wrong. \u00a0Might be time to contact the PB Devs and see if there&#8217;s any information you can give them to help debug the issue.<\/p>\n<p>Good luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Background I&#8217;m posting this because every day there&#8217;s a new post on \/r\/pushbullet\u00a0about people\u00a0not getting their Pushbullet messages until they open the Pushbullet app. \u00a0There&#8217;s a number of reasons that this issue can arise, some of them are unrelated to Pushbullet itself, but will cause the symptoms, some are\u00a0related to Pushbullet though no definitive answer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":253,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54,33,37,12,10],"tags":[56,107,108,106],"class_list":["post-242","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-computers","category-letters","category-networking","category-technical","tag-android","tag-gcm","tag-google","tag-pushbullet"],"_links":{"self":[{"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/posts\/242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/comments?post=242"}],"version-history":[{"count":15,"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/posts\/242\/revisions"}],"predecessor-version":[{"id":350,"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/posts\/242\/revisions\/350"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/media\/253"}],"wp:attachment":[{"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/media?parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/categories?post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/micro.muppetz.com\/blog\/wp-json\/wp\/v2\/tags?post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}