In iOS 9.3, the didReceiveRemoteNotification
method gets called on both of the following occasions.
1) When the push notification is received 2) When
Swift 4 and IOS 12.
While there might be multiple reasons (Already mentioned on other answers) why this issue could happen, in my personal case the solution was related to the payload when sending the push notification:
You need to set the "content-available" key on the json payload to 1.
e.g:
{"aps":{"alert":"Test","content-available":1, "badge":1,"sound":"default"}}