My app with GCM works for some but not for others - google-cloud-messaging

I've written an Android chat progam that makes use of Google Cloud Messaging.
It works. People are able to chat.
However, some people are not because the app does not register with GCM from their device.
This could be due to:
The user not having a Google account on their device.
A firewall is preventing them from accessing ports: 5228, 5229, and 5230
It seems impossible to diagnose from my end since it works for some people but not others and all my devices work.
I'm looking for other ways to diagnose this problem. Any ideas will be appreciated.
I have added prompts to give the user a clue as to the problem, based on what GCMIntentService onError returns.

Related

GDK retrieving account information

I am a Google Glass application developer. During developing one application, I encountered some problems.
My application have landed on MyGlass and it's on review process, so it's not publicly visible. It only can be seen by me.
The problem is:
When I turn on my Glassware in MyGlass, my glass device never receive my application. Should I receive it or not? And why didn't I receive it?
I have launched the method mirror.accounts.insert.execute() from https://developers.google.com/glass/develop/gdk/authentication, and it didn't raise an exception, but I didn't receive the account information and the authToken on my glass device. This is because I haven't received my application on my glass device, am I right?
This is indeed correct: the token will only be sync'ed and available once the APK from MyGlass has been downloaded to your device and installed. After this first installation, you can safely replace the APK with a development one using adb install -r as long as it's using the same certificate.
Make sure to check that your device is connected to the internet, especially through WIFI. If that doesn't work, ask the Glass review team to help you out and check if there are any internal issues that would prevent your APK from being downloaded.

chrome.socket UDP API useless on Chromebook?

I am working on a Chrome packaged app that requires multicast communication over the local network and is specifically targeting Chromebook users. The 'Network Communication' documentation on the packaged app site is outdated and the chrome.socket API documentation is lacking. I was able to get some idea of how to get multicast working by looking through Chrome's 'multicast' sample app (https://github.com/GoogleChrome/chrome-app-samples/tree/master/multicast).
I tested my app by loading it into the Chrome browser on my Mac and everything worked great. I loaded it onto my Chromebook and multicast did not work. I then tried the 'multicast' sample app on my Mac and Chromebook with the same result. The 'multicast' sample app is a chat app. When loaded on both computers on the same network, everything works as expected on the Mac - I can send chat messages out and receive chat messages. On the Chromebook I can send chat messages but not receive them - including the ones that the Chromebook sent.
According to this post - Chrome Sockets API Behaves Differently on Chrome OS (vs. Ubuntu, Windows)? - it looks like Chromebook has a restricted firewall that is blocking UDP packets. I followed the instructions on the post to turn on developer mode and allow UDP packets and that allowed my app to run as expected, but that is not a solution for me. I can't expect Chromebook users to run in developer mode to run my app.
Anyone know if it is possible to allow UDP packets on the Chromebook without going into developer mode? Is there an undocumented permission I can add to my manifest to override the Chromebook UDP restrictions (this seems possible since the 'udp-multicast-membership' permission included in the 'multicast' sample app is undocumented)? This seems like a long shot but chrome.socket.create can be given optional socket options which don't appear to be documented anywhere. Maybe there is something I can add there? And why have Chrome sample apps that don't run on a Chromebook???
---UPDATE---
In case someone is having a similar problem, it looks like this has already been filed as a bug and been looked at just within the past couple of weeks.
https://code.google.com/p/chromium/issues/detail?id=275737
I have no idea when it will actually make its way to a Chromebook update.
Regarding:
I have no idea when it will actually make its way to a Chromebook
update.
usually ChromeOS follows the same release schedule as desktop chrome, with new stable versions coming out about every 6 weeks. But because of the holidays in December when lots of people are on vacation, there is sometimes a hiccup. You can give the dev channel a try and see if the fix showed up there yet: https://support.google.com/chromebook/answer/1086915?hl=en

How to transfer disabled app

lately my facebook account got disabled as a 'bad app developer' without any warning. The thing is all of the apps, where I was listed as an admin got disabled, even though they didn't have any negative feedback. Some applications, where my collegues were listed as admins can be restored from their accounts (and they got enabled as they are working correctly). But there is one, where only I was listed as admin, and I can't find a way to send an appeal. There is a notice about a transfer process in the mail I received saying
For more information on recovering or transferring these applications, please visit our FAQ page: http://www.facebook.com/help?faq=17556
But the FAQ page says it can't be found.
Please can somebody point to a tutorial or step-by-step guide how to transfer the app to another account, so I can get enabled again.
Thanks many times.
As far as I am aware there is no way to recover/transfer the app to another account. All you can really do is set up a new app and point it to the same web address. That being said your account was disabled for a reason, so I would read up on the terms and conditions to find out exactly what you did wrong.

Push notifications not being received on distribute

I had successfully implemented push notifications for the developer certificate but cannot seem to get it work for an ad hoc test with a friend. I did the same process for creating the push notification keys/certificates except now I chose "Production Push SSL Certificate" instead of "Development Push SSL Certificate". I believe that this is correct since I could not find any tutorials around that showed how to do it for production... all of them were for development.
This quick process can be found from ray wenderlich blog here: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
This is my guess where things might have gone wrong because maybe there is a different way to do Production Push. I left my php code the same on my server as I had it before for Development Push (copied over the new ck.pem). Is this alright or do I need to make changes? I can post the code if someone thinks it is the code but as I said.. the php server code worked before.
Can someone please help me out? Thanks in advance!
I CANNOT ANSWER MY QUESTION BECAUSE I DO NOT HAVE ENOUGH REP. THE CORRECT ANSWER IS HERE
for my development I had:
gateway.push.apple.com:2195
but for production it needs to be:
gateway.apple.com:2195
Hope this helps someone in the future.
[Edited]
You can also try to check your token are correctly set, your devices are allowed to receive notifications.
If you have made many tests, you may also have been temporarily banned from APNS server, you mustn't make too many calls to the APNS server in a small time range.
Please also note that there may be some delays from the time you send the notification to the APNS server, and the time the APNS server sends it to your device.
LAst bu not least, make sure your devices have a correct Internet / SSL free access some proxies or firewalls may block notifications
Are you getting the devices token dynamically? Because when the app is in ad-hoc distribution it is generating a different device token for push notifications form when it is in debug (a.k.a developer) mode

Wireless Authentication Page iOS app

I'm not really sure how to word this exactly, so hopefully someone can make sense of it. I've been working on an iPad app that syncs files from a server to your iPad and lets you build presentations with the various files. The corporation I'm working with on this app has a wireless network that requires you to re-authenticate every hour. So every hour instead of getting the expected JSON api response, any HTTP request pulls down the page needed to reauth with the wireless network. I was wondering is there is a specific HTTP response code related to getting sent that page or a "best-practice" way of testing for that page as opposed to JSON.
Granted I could just test to see if the response is HTML, but that doesn't account for other redirect responses that I haven't found yet. I could just test part of the HTML to see if it matches a predetermined portion of the html, but I'm an outside contractor. I can't guarantee they won't change the markup or verbiage of the page after I've made my deliverable.
So does anyone out in the ether know a "best practices" methodology for testing if the app needs to reauth before syncing?
I noticed that on Mac OS X and maybe even iOS, when you connect to a new Wi-Fi network, it will try to contact www.apple.com. This is being done to check if the internet connectivity is available. If it's not available, the Captive Network Assistant will pop-up, showing you the authentication page, or sometimes when I'm in Starbucks, an advertisement.
Following your question, since Apple themselves is doing it this way, I think you could check for HTTP response code, look for something in the HTML markup (slightly discouraged though) or trying to connect to a known server (Reachability).
For a corporation practicing well-documented projects, I am quite sure they won't be changing things without making sure that your app, once deployed will continue to work.