Reputation: 3
I am using Ray Wenderlich APNS php script to push APS messages. The script works fine when I call it from the command line on my server. However, when I call it from the app, it does nothing. I am using development apps with the apple sandbox address. Again, when I call the same script from the command line, it sends the message instantly, however calling the php file from the app results in nothing.
Does the command line allow php to open a connection to the APNS server and the php route block the connection?
Using Command Line: C:\php\php.exe -f "D:\dir\site\php\commentPush.php" Connected to APNS Message successfully delivered
Using my app: NSString *strPush = [NSString stringWithFormat:@"http://www.mysite.com/php/commentPush.php"];
*note - I use this same technique and string for all my server side php execution sucessfully.
Upvotes: 0
Views: 728
Reputation: 1743
You should check your php configuration files for differences between your command line config and server module config.
http://www.php.net/manual/en/configuration.file.php
Without seeing your PHP code, I would start by looking at the fopen_url config parameter first. Also, are you getting any errors or warnings in the server logs?
Upvotes: 5