0

I have a question regarding iOS notifications. I have been using the alert quite successfully, however when using silent I run into issues. The message is sent, meaning I receive success result, but when debugging the app I receive no action. However when using application PUSH Hero just for test doing the silent notification works and I receive the action expected.

I assume I have mistake in the json format but I have just copied and paste the one from their doc, I have tried several different versions

{
    "aps": {
      "content-available": "1"
    },
    "acme1": "bar",
    "acme2": 42
}

I have added the push type as that's what I selected in the push hero application, but still no help

{
  "ApnsHeaders": {
    "apns-push-type": "background",
    "aps": {
      "content-available": "1"
    }
  }

Does anyone have any idea? BTW I have

<key>UIBackgroundModes</key>
    <array>
        <string>remote-notification</string>
    </array>
  • Are you saying that your ReceivedRemoteNotification override method is never called? – ToolmakerSteve Jul 08 '21 at 09:30
  • yes, however when used the push hero application the method is called – KuramaUzumaki Jul 08 '21 at 09:33
  • Anything useful in [this answer](https://stackoverflow.com/a/52992034/199364)? – ToolmakerSteve Jul 08 '21 at 09:37
  • Or try [the newer UNUserNotification](https://stackoverflow.com/q/40406339/199364). – ToolmakerSteve Jul 08 '21 at 09:41
  • Thank you, but I don't think that will work, as I said, it works with the application https://apps.apple.com/us/app/push-hero-test-notifications/id1499227284?mt=12 there is no issue in receiving the notification from there, so I doubt change in the app will help this issue – KuramaUzumaki Jul 08 '21 at 09:44
  • My assessment is that it isn't a problem in the json. If it was, how would Hero app work? Instead its something having to do with certificates, permissions, info.plist, running in a test environment rather than a released store app - something about your setup isn't quite right yet. Also, have you tested both when app is in foreground, and when it isn't? – ToolmakerSteve Jul 08 '21 at 09:50
  • the difference between the app is that zou set the puch type and priority sepratly and send only in json { "aps" : { "content-available" : 1 } } I understand where you are coming from and it is reasonable but I just don't see any other difference than the json, normal notification works. yes, I have tested foreground – KuramaUzumaki Jul 08 '21 at 09:55
  • 1
    SOLVED, it was in need json plus the fact that apple doesn't allow headers in the json. But I had to specify in the provider I use. Found out by few issues on azure-notificationhubs-dotnet – KuramaUzumaki Jul 08 '21 at 10:34
  • That's great. If you post an answer below, showing the details that solved it, that might help others. – ToolmakerSteve Jul 08 '21 at 16:34

0 Answers0