Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple Push Notification not working with ad-hoc build

In development mode I can send push notification to devices, instead I can't in production, my setup is:

  • .pem file that is the combination of aps_production.cer of provisioning portal and the private key of my ad-hoc certificate
  • apple server apn: 'gateway.push.apple.com' with 2196 port
  • I have a rails server that saves tokens from devices and then sends notification to apple with those device tokens and the previous .file for opening connection
  • ad-hoc build applications have (it's rubymotion): entitlements['aps-environment'] = 'production' entitlements['get-task-allow'] = false
  • application when it starts, sends correctly the token to my application server
  • I just checked that the token is different from development mode

The problem is that my rails application sends notifications and didn't receive any errors, but nothing arrived on devices.

I'm using testflight for distribute ad-hoc version of my application, but I don't known any problem using testlight and APNS.

What can be?


EDIT I resolved: the port was wrong, 2195 instead of 2196...

like image 226
Daniele Bottillo Avatar asked Jun 05 '12 16:06

Daniele Bottillo


People also ask

Can we receive push notifications in AdHoc certified test build?

AdHoc build receives no push notifications.

Why push notification is not working for iOS?

You can fix an iPhone that's not getting notifications by restarting it or making sure notifications are turned on. You should also make sure your iPhone is connected to the internet so apps can receive notifications. If all else fails, you should try resetting the iPhone — just make sure to back it up first.

Why are push notifications not working?

One of the main reasons why your phone's notifications aren't working could be due to broken app updates. If your Android device is not getting notifications from one app in particular, it's possible that the developers have accidentally rolled out a buggy update.


1 Answers

APNs have a separate SSL certificate for production and for development.

You are probably using your development certificate with the production build.

like image 167
Gruntcakes Avatar answered Oct 06 '22 00:10

Gruntcakes