Usando a notificação de dados no Rich Push no iOS com FCM

Minha pergunta pode estar ruim, mas não consigo encontrar resposta em lugar algum, estou perdida ...


Então, eu quero exibir uma notificação rica com uma boa imagem no iOS 10+.

Para isso, estou usando o FCM e um UNNotificationServiceExtension que, se entendi corretamente, deve obter a carga útil dos dados, encontrar o URL da imagem e carregá-lo antes de modificar o UNNotificationContent.

O problema que tenho é que não consigo acessar esses "dados".

O que estou enviando para o FCM é o seguinte:

{
"to": "device_token",
"content_available": true,
"mutable_content": true,
"badge" : 9,
"notification": {
    "title": "You still need the iPhone ?",
    "body": "Give it back if you finished you tests !"
},
"data": {
    "message": "test !",
    "mediaUrl": "http://usr.audioasylum.com/images/2/20352/Cat_and_rose.jpg"
},
"priority": "high"
}

O que recebo no telefone é:

{
aps =     {
    alert =         {
        body = "Give it back if you finished you tests !";
        title = "You still need the iPhone ?";
    };
    "content-available" = 1;
    "mutable-content" = 1;
};
"gcm.message_id" = "0:1489054783357873%1ee659bb1ee659bb";
mediaUrl = "http://usr.audioasylum.com/images/2/20352/Cat_and_rose.jpg";
message = "Offer!";
}

Pelo que entendi, o mediaURL e a mensagem devem terminar em "aps" e não fora, e é por isso que não consigo encontrá-los na extensão.

E dentro da extensão eu recebo: (divido em coma para mais legibilidade)

<UNNotificationRequest: 0x117d3c170;
identifier: FDC13B60-FE5A-40C6-896D-06D422043CCE
content: <UNNotificationContent: 0x117d3a650; title: You still need the iPhone ?
subtitle: (null)
body: Give it back if you finished you tests !
categoryIdentifier: 
launchImageName: 
peopleIdentifiers: ()
threadIdentifier: 
attachments: ()
badge: (null)
sound: (null)
hasDefaultAction: YES
shouldAddToNotificationsList: YES
shouldAlwaysAlertWhileAppIsForeground: NO
shouldLockDevice: NO
shouldPauseMedia: NO
isSnoozeable: NO
fromSnooze: NO
darwinNotificationName: (null)
darwinSnoozedNotificationName: (null)
trigger: <UNPushNotificationTrigger: 0x117d3fe90; contentAvailable: YES
 mutableContent: YES>>

O problema é como envio informações com o FCM ou como as recupero? Talvez seja a maneira como eu os trato?

Como sempre, obrigado pela ajuda!

Editar: Adicionado código para o receptor (que é apenas uma impressão na extensão)

@interface NotificationService ()

@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;

@end

@implementation NotificationService

- (void) didReceiveNotificationRequest: (UNNotificationRequest *) request
                    withContentHandler: (void (^)(UNNotificationContent *_Nonnull))contentHandler
{
    self.contentHandler = contentHandler;
    self.bestAttemptContent = [request.content mutableCopy];

    NSLog(@"------------------- %@ -------------------", request);

    // Modify the notification content here...
    self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title];
    self.bestAttemptContent.body = [NSString stringWithFormat:@"%@", request.content];
    self.contentHandler(self.bestAttemptContent);
}

questionAnswers(2)

yourAnswerToTheQuestion