ios – Silent push notification not working when phone is locked


I have implement silent push notification.
The silent push notification trigger a function that will be executed.

This all works when app is in background or killed state. But only when iPhone is not locked.

Why can’t the iPhone receive the silent push when the iPhone is locked.

Do I need some permissions or do I need a specific function in the AppDelegate.

Because the DidReceiveRemoteNotification is not called when phone is locked. I can see that by seeing my logs. Or is it possible that logs are not triggered when phone is locked. And that the problem is inside my code.

Can anybody help me further with this

I have tried to add log to every where in the function that needs to be executed.

When phone is not locked is can see the log coming up. And the function did what I expected.

But in locked state I never see 1 single log.
Stupid thing is when I unlocked the phone. And get a new silent push I see the logs some times twice. So it looks like it was holding it and was being trigger by the new one when it was not locked.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img