immobiliare / ApnsPHP

ApnsPHP: Apple Push Notification & Feedback Provider
BSD 3-Clause "New" or "Revised" License
1.44k stars 452 forks source link

Cant construct message object #105

Closed thehiwe closed 8 years ago

thehiwe commented 8 years ago

Currently I try to get to work the _sample_push.php_ script. Both certificates are in place, my output is this:

Sun, 04 Oct 2015 10:44:47 +0200 ApnsPHP[12049]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... 
Sun, 04 Oct 2015 10:44:47 +0200 ApnsPHP[12049]: INFO: Connected to ssl://gateway.sandbox.push.apple.com:2195. 

No further output appears, no errors occur.

The line that seems to break my script is this:

// Instantiate a new Message with a single recipient (Device token is real)
$message = new ApnsPHP_Message('irIBcUzdvUzIO3hLmIv9BGJoRcpjMUB76fV+s1+dg3o=');

When I try to _var_dump($message);_ no output appears. When I try to echo anything after this line, no output nor errors appear.

marsgpl commented 8 years ago

Are you sure about the format of your device token? all tokens in my apps are like [a-f0-9]{64}

thehiwe commented 8 years ago

Thank you for pointing that out, it was the initial issue which led to solving the whole thing.

I did in fact use different form of device tokens.