Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Push Development

Reply
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Blackberry Push SERVICE_NOT_AVAILABLE error

I just re-read your original post, are you using the full App ID in your registration URL? You should only be using the 3-4 character CPID in this URL, ex:

http://cp1234.pushapi.na.blackberry.com

Garett
@garettBeuk
--
Goodbye everybody!
New Developer
Posts: 12
Registered: ‎08-12-2013
My Device: Dev Alpha B
My Carrier: Fido

Re: Blackberry Push SERVICE_NOT_AVAILABLE error

Thanks for your reply Garret. I (personally) find it a bit misleading because in the email with the push id, it says

 

Application Credentials (for use in your client application):

 

Application ID:

4070-whatever_the_app_id_is

 

PPG Base URL**

http://cp(your App ID ).pushapi.eval.blackberry.com

 

Push Port:

33837

 

While on the Push documentation page it says:

 

When you registered for the Push Service, you received a PPG Base URL and an application ID. In the converted .bar file, create a file named android.cfg and add the URL and app ID. Here is a sample android.cfg file:

 

<?xml version="1.0" encoding="utf-8"?> 
<android> 
   <push>
      <appid>some_appID</appid> 
      <ppgurl>http://cpXXX.pushapi.eval.blackberry.com</ppgurl> 
      <tokenprefix>bb-</tokenprefix>
   </push>
</android>

 

So maybe the value in the email should be changed.

 

I changed my ppgurl to http://cp4070.pushapi.eval.blackberry.com (since its eval environment). 

I'm still getting the same error :/ I dont even know what the problem might be in.. I'm using the same email address when I got the app id as the one I used for the signing keys. I have the proper permissions in both, Blackberry's MANIFEST.MF and android's Android.Manifest.xml files..

 

 

 

New Developer
Posts: 12
Registered: ‎08-12-2013
My Device: Dev Alpha B
My Carrier: Fido

Re: Blackberry Push SERVICE_NOT_AVAILABLE error

Since the ioexception is being thrown at appId = gcm.register(SENDER_ID); should SENDER_ID have the value I got from Google's API Console or am I supposed to change it to the one I got from the email from BlackBerry?
New Developer
Posts: 12
Registered: ‎08-12-2013
My Device: Dev Alpha B
My Carrier: Fido

Re: Blackberry Push SERVICE_NOT_AVAILABLE error

[ Edited ]

Another question.. when registering for push notifications, for Service Type should it be Plus or Essentials?

 

Reading this page makes me think that either should work..

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Blackberry Push SERVICE_NOT_AVAILABLE error


gorjuspixels wrote:

Thanks for your reply Garret. I (personally) find it a bit misleading because in the email with the push id, it says

 

Application Credentials (for use in your client application):

 

Application ID:

4070-whatever_the_app_id_is

 

PPG Base URL**

http://cp(your App ID ).pushapi.eval.blackberry.com

 

Push Port:

33837

 

While on the Push documentation page it says:

 

When you registered for the Push Service, you received a PPG Base URL and an application ID. In the converted .bar file, create a file named android.cfg and add the URL and app ID. Here is a sample android.cfg file:

 

<?xml version="1.0" encoding="utf-8"?> 
<android> 
   <push>
      <appid>some_appID</appid> 
      <ppgurl>http://cpXXX.pushapi.eval.blackberry.com</ppgurl> 
      <tokenprefix>bb-</tokenprefix>
   </push>
</android>

 

So maybe the value in the email should be changed.

 

I changed my ppgurl to http://cp4070.pushapi.eval.blackberry.com (since its eval environment). 

I'm still getting the same error :/ I dont even know what the problem might be in.. I'm using the same email address when I got the app id as the one I used for the signing keys. I have the proper permissions in both, Blackberry's MANIFEST.MF and android's Android.Manifest.xml files..

 

 

 


I agree with you entirely. It looks like this email was changed recently from stating the CPID to saying App ID. I'll send this up to the right teams to be changed.

 

We're working on a huge overhaul to the entire Push registration process to make it much more user friendly, and should alleviate these kinds of issues.

Garett
@garettBeuk
--
Goodbye everybody!
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Blackberry Push SERVICE_NOT_AVAILABLE error


gorjuspixels wrote:

Another question.. when registering for push notifications, for Service Type should it be Plus or Essentials?

 

Reading this page makes me think that either should work..


Either will work.

Garett
@garettBeuk
--
Goodbye everybody!
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Blackberry Push SERVICE_NOT_AVAILABLE error

 

gorjuspixels wrote:
Since the ioexception is being thrown at appId = gcm.register(SENDER_ID); should SENDER_ID have the value I got from Google's API Console or am I supposed to change it to the one I got from the email from BlackBerry?

The only change required should be to add the config file, which you have. I'm working with another dev on what appears to be the same issue. Let me see what I can find with them and I will post back once I have an answer.

 

 

Is this line part of the stack trace when this issue occurs?

W/ActivityManager(7868582): Unable to start service Intent {
act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms
(has extras) }: not found

 

Garett
@garettBeuk
--
Goodbye everybody!
New Developer
Posts: 12
Registered: ‎08-12-2013
My Device: Dev Alpha B
My Carrier: Fido

Re: Blackberry Push SERVICE_NOT_AVAILABLE error

[ Edited ]

Here's my stacktrace:

 

08-23 19:52:23.142: E/GCM ERROR(8802512): Got an error
08-23 19:52:23.142: E/GCM ERROR(8802512): java.io.IOException: SERVICE_NOT_AVAILABLE
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source)
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at com.utsc.Main$7.doInBackground(Main.java:454)
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at com.utsc.Main$7.doInBackground(Main.java:1)
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at android.os.AsyncTask$2.call(AsyncTask.java:287)
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at java.util.concurrent.FutureTask.run(FutureTask.java:234)
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
08-23 19:52:23.142: E/GCM ERROR(8802512): 	at java.lang.Thread.run(Thread.java:856)

 I checked my projects properties. Where it says Blackberry, for Custom BAR Manifest option I had "Ignore custom Manifest". Changing this value does not seem to fix things either.

 

Based on the stack trace I cab see that it simply can't find the method. So my guess is that the gcm package is missing.. However it works on an android phone and I have the proper jars imported.

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Blackberry Push SERVICE_NOT_AVAILABLE error

Which package does your app attempt to register against? Is it the same package as in the newly compiled .BAR file?

Garett
@garettBeuk
--
Goodbye everybody!
Contributor
Posts: 16
Registered: ‎09-17-2012
My Device: Blackberry Q10
My Carrier: Telus

Re: Blackberry Push SERVICE_NOT_AVAILABLE error


gbeukeboom wrote:

 

gorjuspixels wrote:
Since the ioexception is being thrown at appId = gcm.register(SENDER_ID); should SENDER_ID have the value I got from Google's API Console or am I supposed to change it to the one I got from the email from BlackBerry?

The only change required should be to add the config file, which you have. I'm working with another dev on what appears to be the same issue. Let me see what I can find with them and I will post back once I have an answer.

 

 

Is this line part of the stack trace when this issue occurs?

W/ActivityManager(7868582): Unable to start service Intent {
act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms
(has extras) }: not found

 


I have this exact error and it's driving me nuts! I had everything working with c2dm, but when I switched to GCM it stopped working. It still works on Android without errors though. I've checked my manifest and .cfg files multiple times and everything seems to  be fine. Are there any leads?