Notification service extension only invoked if push alert is a string, not a dictionary

I have notification service extension and I can get it to execute if the payload is like this (in php)


$payload = json_encode([
                       'aps' => [
                           'alert' => "Hello",
                           'sound' => 'default',
                           'mutable-content' => $isContentMutatable,
                        ]
]);

But not if it is something like this:


$payload = json_encode([
                       'aps' => [
                           'alert' => ['title' => 'Game Request'],
                           'sound' => 'default',
                           'mutable-content' => $isContentMutatable,
                        ]
]);



Anybody been able to get it to be called when the alert is anything other than just a string?

My testing shows that if you just specify a title (as in your example), phone buzzes but no notification shows up.


If I added a body to it, then the notification comes through:


$payload = json_encode([
                       'aps' => [
                           'alert' => ['title' => 'title', 'body' => 'body'] ,
                           'sound' => 'default',
                           'mutable-content' => $isContentMutatable,
                        ]
]);

If you remove the title from the dictionary (leaving the body in the dictionary), then the service extension again isn't invoked. It seems the title is necessary in order for the extension to be called (either by design or accident).

Notification service extension only invoked if push alert is a string, not a dictionary
 
 
Q