I'm wondering if Easy APNs can handle more than one app ID.
As I understand from the Apple documentation, a new certificate must
be generated for each unique appID.
I can't find where I can put more than one certificate set (prod and
sandbox) in Easy APNs configuration.
Thanks for your help.
I have updated the class_APNS.php file to you can pass the new
certificates as part of the constructor.
So if you are like me and only have one app, you do not need to pass
anything new and your old code will still work, but if you need to use
alt certificates, now you can with ease ;)
New code looks something like this...
<code>
<?php
$db = new DbConnect();
$db->show_errors();
$apns = new APNS($db, NULL, '/usr/local/apns/alt_apns.pem',
'/usr/local/apns/alt_apns-dev.pem');
?>
</code>
Source code is here...
http://code.google.com/p/easyapns/source/browse/trunk/src/php/classes/class_APNS.php
Raw File is here...
http://easyapns.googlecode.com/svn/trunk/src/php/classes/class_APNS.php
Will also make a new download once you guys tell me that it works as expected.
Thanks,
- Peter
> --
> You received this message because you are subscribed to the Google
> Groups "Easy APNS" group.
> To post to this group, send email to easy...@googlegroups.com
> To unsubscribe from this group, send email to
> easyapns+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/easyapns?hl=en
>
> To unsubscribe from this group, send email to easyapns+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
>
The existing application already records each user and which app they
are tied to.
So to send a message to a user they would need to fetch them by
application anyway, so to me, at least, it seems that this is where
the developer could put in a switch statement or some other logic to
pass over the correct certificate paths to the APNs object.
I would love to hear some more opinions on this.
- Peter Schmalfeldt
Ken
On Mar 30, 3:13 pm, Manifest Interactive
<manifestinteract...@gmail.com> wrote:
> That's what I get for only having one app running using this code...
>
> I have updated the class_APNS.php file to you can pass the new
> certificates as part of the constructor.
>
> So if you are like me and only have one app, you do not need to pass
> anything new and your old code will still work, but if you need to use
> alt certificates, now you can with ease ;)
>
> New code looks something like this...
>
> <code>
> <?php
> $db = new DbConnect();
> $db->show_errors();
> $apns = new APNS($db, NULL, '/usr/local/apns/alt_apns.pem',
> '/usr/local/apns/alt_apns-dev.pem');
> ?>
> </code>
>
> Source code is here...
>
> http://code.google.com/p/easyapns/source/browse/trunk/src/php/classes...
This is not pretty but it works great.
By using the app name and only pointing the the directory where the
cert live as a value I then append the name of the cert to the path.
I also set it up to be a sandbox application or production.
$appname = $this->db->prepare($appname);
$appversion = $this->db->prepare($appversion);
$deviceuid = $this->db->prepare($deviceuid);
$devicetoken = $this->db->prepare($devicetoken);
$devicename = $this->db->prepare($devicename);
$devicemodel = $this->db->prepare($devicemodel);
$deviceversion = $this->db->prepare($deviceversion);
$pushbadge = $this->db->prepare($pushbadge);
$pushalert = $this->db->prepare($pushalert);
$pushsound = $this->db->prepare($pushsound);
// set up case for cert name for each app and current production
status.
switch ($appname){
case "iLaunderette":
//$certname ='iLaunderetteProdKey.pem';
$certname = 'iLaunderettDev.pem';
$development = 'production';
break;
case "feedthemeter":
$certname = 'feedthemeterDev.pem';
$development = 'production';
$break;
default:
echo "Bring lots of underwear!"; // found this on the web looking
for switch examples.. Love it!
break;