Getting "DeviceTokenNotForTopic" error - Chapter 10


I am running “sendEncrypted.php” in the terminal and getting following warning and error

Warning: Use of undefined constant TOPIC - assumed ‘TOPIC’ (this will throw an Error in a future version of PHP) in /Volumes/…/sendEncrypted.php on line 39
object(stdClass)#1 (1) {
** [“reason”]=>**
** string(22) “DeviceTokenNotForTopic”**

I have done all the changes in “sendEncrypted.php” file also cross checked it.
I am able to get push notification through “Push Notification” Mac app.

No sure what’s wrong here.



In sendEncrypted.php file, on Line 39
'apns-topic: ’ . TOPIC,

Replace TOPIC with the Bundle ID of your application.


@vaannd, Glad you were able to resolve the issue. Thank you for updating us!