Installation: Push Notification & Device Registration (Production vs. Sandbox)

1,838 views
Skip to first unread message

Peter Schmalfeldt

unread,
Dec 31, 2009, 9:43:00 PM12/31/09
to Easy APNS
Once you are successfully receiving registrations in your
`apns_devices` MySQL table, you will need to make a manual change for
devices that you wish to use your development certificate. By default
all registered devices will have their 'development' column set to
'production'. This tells Easy APNS to use Apples production SSL and
to load your production certificate.

So if you are using your development certificate here is what you will
need to do:

1. Open the `apns_devices` table
2. Locate the Device you want to switch over to sandbox mode
3. Change the `development` column from 'production' to 'sandbox'

That will allow your push notifications to be sent using the correct
certificate if your device was provisioned using the development
certificate.

I wish there was an easier way to make this automatic, but I can't
think of any. I am currently looking for a way that during the device
registration process, I can detect which build style you are using so
the database will automatically know which certificate to use. But
unless I also require you to manually add a bunch of compiling flags
to each build style, then there is no easy way to do it that I know
of... no automatic way... anyway.

If any of you know of one, please post it in this thread.

Nicolas Massart

unread,
Oct 30, 2013, 9:35:39 AM10/30/13
to easy...@googlegroups.com
Hi,

I know this message is three years old, but the problem about automatically switching to sandbox or to production is still up to date.
For now the only way to switch seems to be a manual database update for devices that you want to switch to sandbox.
I think that the main problem is that most users only use the same server for dev and prod.
In our case, we have at least two servers, one for developement and one for production. Saying so, it's easy to know if a device registered for a sandbox or production purpose. On registration, the database insert should be able to set either sandbox or production depending on the server it runs on.
Today this value is hardcodded and set to production :
private $DEVELOPMENT = 'production'; // or 'sandbox'
I suggest changing the registration method to accept a new parameter telling weather to use sandox or production.
This is a small change, and using a default value it will remain fully compatible with old calls and I'll propose a pull request as soon as possible.

Shears,
Nicolas.
Reply all
Reply to author
Forward
0 new messages