question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to send push notifications (error 8)

See original GitHub issue

I implemented push notification using node-apn some time ago and it worked just fine. Today my server restarted and I tried the push notification again just to notice it does not work anymore. I turned on the debugs and got this:

Sending push notification - deviceToken: 1bd029f7d7bf7bae97d63ab81736e9aac9e3a072982e0de253546b4b622ececc - text: 'test'
  apn Initialising connection +0ms
  apn Initialising module +1ms
  apn 1 left to send +1ms
  apn Connection established +517ms
  apn Transmitting notification from buffer +0ms
  apn Socket drained +1ms 0
  apn 0 left to send +0ms
  apn 0 left to send +1ms
  apn Notification 0 caused an error: 8 +113ms
  apn Raising error: +0ms 8 { encoding: 'utf8',
  payload:
   { messageFrom: 'Huimio',
     aps:
      { badge: 2,
        sound: 'ping.aiff',
        alert: 'You have a new support chat message!' } },
  expiry: 1418894959,
  identifier: 0,
  priority: 10,
  retryLimit: -1,
  device: undefined,
  alert: 'You have a new support chat message!',
  badge: 2,
  sound: 'ping.aiff',
  newsstandAvailable: undefined,
  contentAvailable: undefined,
  mdm: undefined,
  compiled: true,
  truncateAtWordEnd: false,
  urlArgs: undefined,
  compiledPayload: '{"messageFrom":"Huimio","aps":{"badge":2,"sound":"ping.aiff","alert":"You have a new support chat message!"}}' } { token: <Buffer 1b d0 29 f7 d7 bf 7b ae 97 d6 3a b8 17 36 e9 aa c9 e3 a0 72 98 2e 0d e2 53 54 6b 4b 62 2e ce cc> }
  apn Buffering 0 notifications for resending +1ms
  apn Socket closed +1ms 0  
  apn 0 left to send +0ms

I tried to google what the error 8 is but did not find anything useful.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
argoncommented, Dec 11, 2014

Are you sure your environments are matched? A device generated for a sandbox environment will cause an error “8” in the production environment and vice versa.

If you are running the app from Xcode then it will be the development/sandbox environment.

If the app is running from a distribution build, either AdHoc or App Store then it will be for the production environment.

If the

—A

On 11 Dec 2014, at 15:15, Veli Kaksonen notifications@github.com wrote:

That device id is the one I just got from the iOS application upon starting. Here is my code for getting the id:

-(void) application:(UIApplication_)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData_)deviceToken { NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@“<>”]]; pushNoticificationDeviceToken = [token stringByReplacingOccurrencesOfString:@" " withString:@“”];

DDLogInfo(@"pushNoticificationDeviceToken: '%@'", pushNoticificationDeviceToken);

....

} I double checked and the device id is correct.

— Reply to this email directly or view it on GitHub.

0reactions
veli-kaksonencommented, Dec 11, 2014

Oh my god! I have the sandbox certificates! Thank you very much! You have saved my day!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Push Notification Issues: Common Errors & Fixes
We know push notifications are a crucial feature for your apps, and sometimes things go wrong. If you receive an error message when...
Read more >
Handling Notification Responses from APNs - Apple Developer
Apple Push Notification service (APNs) provides a response to each POST request your server transmits. Each response contains a header with fields ...
Read more >
Error Messages for Push Notifications - Salesforce Help
If you get an error message while sending a push notification from the Send Test Notification page, check the following table for suggestions...
Read more >
Flutter : Unable to send Firebase push notifications
The error was a simple mistake, I figured it out. In the notification receiving application, I was registering my self with FCM at...
Read more >
MobilePush fails to send push notification
There might be a misconfiguration in how your device is registering with SFMC. Check the app id, access token and gcm sender id...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found