Search code examples
androidandroid-c2dmurbanairship.com

Registering C2DM with Urban Airship


For the last couple of days, I have been struggling with integrating Urban Airship with my Android application. I have signed up to C2DM and received the invitation e-mail. I have added the Urban Airship library to my application and configured the airshipconfig.properties file with the correct app keys, app secrets and the auth token I have set the platform to c2dm. I have also added the necessary permissions and receivers to the manifest.

Still, I am getting the below error.

The APID printed in the console is not being registered with the application on Urban Airship and when trying to send a push notification to the APID from URban Airship, I will get an error saying that they do not know of the APID.

Can anybody lead me in the right direction as I am really left clueless right now?

01-10 19:49:27.195: D/Nibe Festival - UALib(1124): Airship Take Off! Lib Version: 1.1.3 / App key = **hidden** / secret = **hidden**
01-10 19:49:27.195: D/Nibe Festival - UALib(1124): In Production? false
01-10 19:49:27.295: D/Nibe Festival - UALib(1124): Initializing Push.
01-10 19:49:27.304: D/Nibe Festival - UALib(1124): Initializing Analytics.
01-10 19:49:27.324: I/Nibe Festival - UALib(1124): My Application onCreate - App APID: **hidden**-**hidden**-**hidden**-**hidden**-**hidden**
01-10 19:49:27.794: D/Nibe Festival - UALib(1124): Push Service started with intent=Intent { act=com.urbanairship.push.START cmp=com.codeinacup.NibeFestival/com.urbanairship.push.PushService }
01-10 19:49:27.814: D/Nibe Festival - UALib(1124): Starting C2DM
01-10 19:49:27.814: I/Nibe Festival - UALib(1124): Initializing C2DM Push...
01-10 19:49:27.834: I/Nibe Festival - UALib(1124): Performing BoxOffice firstRun.
01-10 19:49:28.194: D/Nibe Festival - UALib(1124): Error when executing request: Not trusted server certificate
01-10 19:49:28.194: E/Nibe Festival - UALib(1124): Firstrun failed, will retry. Error: Failed to post to /firstrun; request failed
01-10 19:49:38.204: I/Nibe Festival - UALib(1124): Performing BoxOffice firstRun.
01-10 19:49:38.394: D/Nibe Festival - UALib(1124): Error when executing request: Not trusted server certificate
01-10 19:49:38.394: E/Nibe Festival - UALib(1124): Firstrun failed, will retry. Error: Failed to post to /firstrun; request failed
01-10 19:49:57.794: I/Nibe Festival - UALib(1124): Sending 15 events.
01-10 19:49:57.854: D/Nibe Festival - UALib(1124): Sending Analytics to: https://combine.urbanairship.com/warp9/
01-10 19:49:58.054: D/Nibe Festival - UALib(1124): Error when executing request: Not trusted server certificate
01-10 19:49:58.404: I/Nibe Festival - UALib(1124): Performing BoxOffice firstRun.
01-10 19:49:58.594: D/Nibe Festival - UALib(1124): Error when executing request: Not trusted server certificate
01-10 19:49:58.594: E/Nibe Festival - UALib(1124): Firstrun failed, will retry. Error: Failed to post to /firstrun; request failed
01-10 19:50:38.594: I/Nibe Festival - UALib(1124): Performing BoxOffice firstRun.
01-10 19:50:38.774: D/Nibe Festival - UALib(1124): Error when executing request: Not trusted server certificate
01-10 19:50:38.774: E/Nibe Festival - UALib(1124): Firstrun failed, will retry. Error: Failed to post to /firstrun; request failed
01-10 19:50:57.814: I/Nibe Festival - UALib(1124): Sending 15 events.
01-10 19:50:57.854: D/Nibe Festival - UALib(1124): Sending Analytics to: https://combine.urbanairship.com/warp9/
01-10 19:50:58.014: D/Nibe Festival - UALib(1124): Error when executing request: Not trusted server certificate

There are more output in the console but it does not seem to have relevance to Urban Airship.


Solution

  • It wouldn't register because I did not have a connection to Google Play. When opening the Google Play app I got the error: No connection

    I got this error because the date and time on my phone was not set correctly. Setting the date and time meant that I could establish connection to Google Play and thereby receive push notifications.