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:
- Open the `apns_devices` table
- Locate the Device you want to switch over to sandbox mode
- 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 comment below
There are two different files that can be used for creating the MySQL tables you will need for Easy APNS to function. However, you will only need to use ONE of them. The primary file is named 'apns.sql' and can be located here:
You will want to use this file if you can, but you will need a MySQL user with full admin access. The reason for this is because the `apns_devices` table has a trigger that when a device registers that already exists in the table, the current values are archived in `apns_device_history` and then overwritten. This will allow you to keep track and monitor changes in device activity.
If you do not have this level of access to your MySQL database, there is an alternative file named 'apns_alt.sql' and it can be located here:
This will install the main tables you need for the Easy APNS application to run, but will not archive all registrations. It will only store NEW registrations, and update existing registrations.