I have this function in php that will send 2 notifications to App A and App B when there is an action to the function. However, I will only receive 1 notifications in one APP. I am using apnsphp to do the pushing of notifications.
Below are my situation: I have a 2 app: app A and app B Both app are using different apns cert.
is there a possibility of apns cert cache?
Scenario 1) When logged in to IPAD with APP A & logged in to IPAD with APP B at the same time, Push notification is received for APP A and not for APP B.
Scenario 2) when logged in to IPAD with APP A and logged in to iPhone (separate device) with APP B, Push notification is received for APP A and not for APP B.
Scenario 3) when logged OUT from iPad with APP A, and logged in to iPad (same device) or iPhone (separate device) with APP B, Push notification is received App B.
Im getting this error from apnsphp:
["ERRORS"]=> array(2) {
[0]=>
array(3) {
["identifier"]=> int(1)
["statusCode"]=> int(999)
["statusMessage"]=> string(53) "Internal error (0 bytes written instead of 223 bytes)"
}
[1]=>
array(5) {
["command"]=> int(8)
["statusCode"]=> int(8)
["identifier"]=> int(1)
["time"]=> int(1415012295)
["statusMessage"]=> string(13) "Invalid token"
}
}
Below are the logs:
Tue, 04 Nov 2014 10:02:25 +0800 ApnsPHP[4136]: INFO: Trying tls://gateway.push.apple.com:2195...
Tue, 04 Nov 2014 10:02:26 +0800 ApnsPHP[4136]: INFO: Connected to
tls://gateway.push.apple.com:2195. Tue, 04 Nov 2014 10:02:26 +0800 ApnsPHP[4136]: INFO: Sending
messages queue, run #1: 1 message(s) left in queue. Tue, 04 Nov 2014 10:02:26 +0800
ApnsPHP[4136]: STATUS: Sending message ID 1 [custom identifier: CakeApns] (1/3): 166 bytes. Tue,
04 Nov 2014 10:02:27 +0800 ApnsPHP[4136]: INFO: Disconnected.
Tue, 04 Nov 2014 10:02:27 +0800 ApnsPHP[4136]: INFO: Sending messages queue, run #1: 1 message(s)
left in queue. Tue, 04 Nov 2014
10:02:27 +0800 ApnsPHP[4136]: STATUS: Sending message ID 1 [custom identifier: CakeApns] (1/3):
221 bytes. Tue, 04 Nov 2014 10:02:27 +0800 ApnsPHP[4136]: ERROR: Unable to send message ID 1:
Internal error (0 bytes written instead of 221 bytes) (999). Tue, 04 Nov 2014 10:02:27 +0800
ApnsPHP[4136]: INFO: Trying tls://gateway.push.apple.com:2195... Tue, 04 Nov 2014 10:02:28 +0800
ApnsPHP[4136]: INFO: Connected to tls://gateway.push.apple.com:2195. Tue, 04 Nov 2014 10:02:28
+0800 ApnsPHP[4136]: INFO: Sending messages queue, run #2: 1 message(s) left in queue. Tue, 04
Nov 2014 10:02:28 +0800 ApnsPHP[4136]: STATUS: Sending message ID 1 [custom identifier: CakeApns]
(2/3): 221 bytes. Tue, 04 Nov 2014 10:02:28 +0800 ApnsPHP[4136]: ERROR: Unable to send message ID
1: Invalid token (8). Tue, 04 Nov 2014 10:02:28 +0800 ApnsPHP[4136]: INFO: Disconnected. Tue, 04
Nov 2014 10:02:28 +0800 ApnsPHP[4136]: INFO: Trying tls://gateway.push.apple.com:2195... Tue, 04
Nov 2014 10:02:29 +0800 ApnsPHP[4136]: INFO: Connected to tls://gateway.push.apple.com:2195. Tue,
04 Nov 2014 10:02:29 +0800 ApnsPHP[4136]: INFO: Sending messages queue, run #3: 1 message(s) left
in queue. Tue, 04 Nov 2014 10:02:29 +0800 ApnsPHP[4136]: WARNING: Message ID 1 [custom
identifier: CakeApns] has an unrecoverable error (8), removing from queue without retrying...
Tue, 04 Nov 2014 10:02:30 +0800 ApnsPHP[4136]: INFO: Disconnected.