iosswiftxcodepush-notificationapple-push-notifications

iOS Push notification service extension (didReceive) is not called


{
      "gcm.message_id" : "XXXXX",
      "type" : "XXXXX",
      "url" : "XXXXX",
      "body" : "XXXX",
      "title" : "XXX",
      "google.c.a.e" : "XX",
      "aps" : {
        "mutable-content" : 1,
        "alert" : {
          "title" : "Test",
          "body" : "Test"
        },
        "category" : "XXXX",
        "content-available" : 1
      },
      "channel_id" : "XXXX"
}

I also tried excluding mutable-content but service extension still didn't get called.
I also tried with simpler payload like this:

{
"aps" : {
        "mutable-content" : 1,
        "alert" : {
          "title" : "Test",
          "body" : "Test"
        },
        "category" : "XXXX",
        "content-available" : 1
      }
}

No luck here either, both with and without mutable-content

I can always see a push notification as a result of testing but the breakpoint in extension `didReceive` method is not triggered. Also the payload is not modified in any way.

Methods like restating device, restarting macbook and deleting derived data didn't work as well


Solution

  • I managed to solve this buy deselecting Copy only when installing in app target -> Build Phases -> Embed App Extensions

    enter image description here