HowAreYou
I hate code!
Profile
Posts: 54
Reg: Jan 09, 2013
Orlando
6,490
01/27/13 07:38 AM (12 years ago)

Setting Up Android Push Notifications For the First Time

I upgraded my account and am trying to use the new push notification from the control panel. I have built an android app. I re-downloaded the app and compiled it. Then I installed it on my device. But I'm still not getting promted to sign-up for push notifications. I see there are a few ios tutorials on this. If you have started using the push notifications on the bt control panel, and believe you can help me, will you help me? I think I'm over-thinking it.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 07:53 AM (12 years ago)
Hi, I did this yesterday, my steps to set up Push on Android are as follows:- 1) Log into my Google Account on the internet 2) Create a Project ID (e.g. buzztestcp). All lower case. 3) Go to API Access - create an Android API Key. See the Project Summary for values created. 4) Set up Buzztouch Control Panel core properties with the Google Android API key and the Project Number. Note - Do not use Project ID, it is the Project Number that is needed. 6) Go to the Android project in Eclipse and enter the Project Number in bt_gcmConfig.java Note - Do not use Project ID, it is the Project Number that is needed. That should do it. Alan
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 08:20 AM (12 years ago)
Hey AlanMac, Do you use the GCM for browsers Apps with refers or the GCM server Apps with IP locking? Also, you use the ID that's in the browser, correct? LA
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 08:34 AM (12 years ago)
Hi LA, I used the key for Android Apps (not browser apps). I don't remember seeing (or writing down) anything to do with IP locking and the google console default of any app is allowed. The first time I'd ever looked at this was yesterday, so its all new to me, but I made some notes along the way of what I did - I hope it helps. Cheers, Alan
 
HowAreYou
I hate code!
Profile
Posts: 54
Reg: Jan 09, 2013
Orlando
6,490
like
01/27/13 08:42 AM (12 years ago)
I just noticed something, push notifications aren't available in self hosted control panels yet? Is this right?
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 08:47 AM (12 years ago)
@AlanMac, Ok, I did everything and still receiving this error on my device: There was a problem communicating with the Google Cloud Messaging services. Is the device online? Is the device logged into a Google Account? LA
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 09:01 AM (12 years ago)
@HowAreYou, yes, not available on selfhosted yet, but I thought I'd learn in advance.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 09:03 AM (12 years ago)
LA, it took me ages too! For me, that error went away after I stopped using the project id and used the project number instead.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 09:10 AM (12 years ago)
I guess it wouldn't hurt to delete the key and start another one? What are you doing under the core settings? LA
 
hasher13
Android Fan
Profile
Posts: 376
Reg: Jul 21, 2012
Wethersfield
8,060
like
01/27/13 09:15 AM (12 years ago)
What about all the configurations and permissions it states on the GCM-Getting started website which the "about" on the push notification settings page links to? Is that still needed? I have been hesitant to tackle this, and waiting to see more forum conversations and how-to's for the Android. Thanks in advance, Howard
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 09:21 AM (12 years ago)
LA, under Core Settings I've enabled “Push Notifications” and Reset to the default control panel URL”. Oh, and in eclipse you need to check the library is in place, as per Davids png file http://www.buzztouch.com/images/android-avd.png under forum entry http://www.buzztouch.com/forum/thread.php?tid=9EC2C076852F505AD42DF72 Alan.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 09:32 AM (12 years ago)
Ok, I already did all of them so I am def. missing something. LA
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 09:37 AM (12 years ago)
I'm sure you'll get there LA. For me, the problem was frustrating because I went round and round in circles. It was using the project id and used the project number instead that made it work, which I found on stackoverflow. Alan
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 09:44 AM (12 years ago)
Well if you go to "Overview" it shows the project number, which mine is all numbers so no mistaking that one. You didn't use the oAuth did you? LA
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 09:53 AM (12 years ago)
Did you have to enter your certificate SHA1 fingerprints? LA
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
01/27/13 10:24 AM (12 years ago)
@LA make sure your device either emulator or physical device is signed into a google account, then your app will register it as a device to use.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 10:26 AM (12 years ago)
@Arubaman, I'm signed into my google account both e-mail and developer. LA
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 11:06 AM (12 years ago)
Am I missing an account some where...what account? LA
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 11:18 AM (12 years ago)
Hi LA, no, I did not have to enter my certificate SHA1 fingerprints nor did I use OAuth (and don't know how!). If you get the prompt to enable push, then the error, then the device isn't registering. Registering uses the Project Number and the Android API key, so my thinking is it has to be in that area. @Arubaman, I don't recall doing anything like that, only the few steps I outlined at the beginning of this post, what exactly do you mean by being signed into a google account please?
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 11:26 AM (12 years ago)
AlanMac, Can you do a video on this real quick? LA
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 11:51 AM (12 years ago)
Never made a video, but if you like, I can have a go at a pdf tomorrow.
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
01/27/13 12:19 PM (12 years ago)
Emulator would have to signed into a account to work for push. @LA make sure the source code your using was downloaded after wed. night as David had to make changes-some code was missing.
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
01/27/13 12:21 PM (12 years ago)
Also if your on a physical device your already linked to your google play account, I was referring to emulator accepting push needs to be logged in. Was in the webinar wed night.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 01:18 PM (12 years ago)
@Arubaman, Yes I missed the webinar and I believe only the second webinar for Android is the only one available and the first one is what I need. I redownloaded everything and still same problem. Not sure what I'm doing wrong. LA
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/27/13 02:10 PM (12 years ago)
For what its worth, I have only tested this on an actual device, running Android 2.2 - never tried the simulator for the push.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/27/13 02:26 PM (12 years ago)
I have been trying on both and nothing.. LA
 
hasher13
Android Fan
Profile
Posts: 376
Reg: Jul 21, 2012
Wethersfield
8,060
like
01/27/13 03:01 PM (12 years ago)
Hi, so I have been following this thread all morning and now I guess into the evening. I decided to take a shot and see if I can get the push notification configured. I used AlanMac steps above and pretty much got though all 6 steps, but am now receiving an error or red "x" on my package. In the BT_gcmConfig.java, I have an error on the line where it states my package name. It seems correct so not sure why it is being flagged. Any suggestions? Also, when I created the keys I never saw where it stated Project ID, I used the Project # that was in the url. Does all that sound correct? Thanks, Howard
 
hasher13
Android Fan
Profile
Posts: 376
Reg: Jul 21, 2012
Wethersfield
8,060
like
01/27/13 03:18 PM (12 years ago)
Sorry, I jumped the gun with that error and found the mistake. But still wondering where would I find or see the project ID? Thanks again, Howard
 
hasher13
Android Fan
Profile
Posts: 376
Reg: Jul 21, 2012
Wethersfield
8,060
like
01/27/13 03:40 PM (12 years ago)
So, I hope I am not jumping the gun on this one, but I got as far and testing the app on my emulator. I did get the notification that asked if I would allow push notification. But I did get the message that there was a problem and to check if the device was online and logged into a google account. I believe I am logged into my Google account, at least when I go to Google.com it shows that I am logged in but I still get the error and no devices registered in the control panel. Did I log-in correctly? Is that what is asking for me to do? Thanks, Howard
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/28/13 06:29 AM (12 years ago)
OK everyone, detailed guide, hot of the word processer - let me know if this helps! http://dl.dropbox.com/u/44302941/HowTo%20Android%20Push%20with%20GCM%20for%20BuzzTouch%20Push.pdf
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/28/13 06:34 AM (12 years ago)
Hey @AlanMac, I did get it to work on my device finally! LA
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
01/28/13 08:35 AM (12 years ago)
What was the problem in the end?
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
01/28/13 09:04 AM (12 years ago)
 
HowAreYou
I hate code!
Profile
Posts: 54
Reg: Jan 09, 2013
Orlando
6,490
like
01/29/13 05:02 PM (12 years ago)
@AlanMac Do you need to pay $25 for a developers license to google to get gcm? My screen only offers oAuth 2.0 client ID. It doesn't give me any other options. NM... think I got it @AlanMac Thank you
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.