HOWTO removes device tokens received by Apple APNS feedback

I am successfully getting Apple APNS feedback data through PHP. The structure I get (after some processing) looks something like this:

time stamp

device token

My question is how to find out which device tokens should be removed from my database and stop sending them notifications.

Regardz,

Mladjo

+5
source share
6 answers

. , Apple, , โ€‹โ€‹ , . , .

, , , . , Apple . , Apple , , , , ( ) . Apple , , , Apple .

+11

, , " " . , . Apple:

Apple APN

+10

@argon, .

, push-, . , , didRegisterForRemoteNotificationsWithDeviceToken deviceToken, . , APNS , , ( ), , APNS, โ†’ โ†’ .

, APNS UTC, , , UTC ISO. , , .

0

@fyasar,

, - ( ). , , ? , , , , , . , , , , push-.

, , apple doc , , , . , .

0

( _t), , APN . , , 12:00 1 1970 . UTC.

, db. mysql php

$sql="SELECT insert_time from device_tokens ORDER BY insert_time DESC LIMIT 1";

db,

$sql1="SELECT UNIX_TIMESTAMP(' $timestamp')";

, , apns,

if($inactive_Timestamp>$dbTime_stamp)
  {
foreach ($apnsfeedback_tokens as $key => $value) {
  # code...

  $inactive_Token=$value['devtoken'];

 $sql= "DELETE FROM device_tokens WHERE device_token='$inactive_Token'";


if ($conn->query($sql) === TRUE) {
    echo "Record deleted successfully";
} else {
    echo "Error deleting record: " . $conn->error;
}
0

, . . db.

-1

All Articles