I know it is an edge case. But it might be helpful for some. In my case, I realized I added Push Notifications capability only under Release. So I wasn't getting any APNS token in debug mode.
This is how it was looking (select all and see if there is Release postfix):
Now you should add the capability when All is selected.
Make sure it looks like this: