plokko / firebase-php

Php integration of Firebase API (FCM Http v1, RealTime database)
16 stars 9 forks source link

Apns config does not work #9

Closed Juanperezc closed 5 years ago

Juanperezc commented 5 years ago

Hi, I'm trying the apn settings to set the thread-id, since I need notifications to be repeated, or replaced with an existing one

https://stackoverflow.com/questions/49758268/can-you-set-thread-id-with-fcm-nottoos-for-ios

But I can not set this configuration, I'm doing it in the following way

$message->apns->payload->aps->thread_id = "example";

and I do not get an error but it does not work either

plokko commented 5 years ago

Could you please post a sample generated json payload with this code and expected value?

Thanks.

PS: as you see here thread-id should be correctly set on ApnPayload ApnData struct.

Juanperezc commented 5 years ago

I am doing it in the following way

$message->apns->payload->aps->alert = "Hello World!";
        $message->apns->payload->aps->sound = "default";
        $message->apns->payload->aps->category = "example-category";
        $message->apns->payload->aps->thread_id = $this->type;

The weird thing is that the alert works for me and I think the others but the thread-id does not

iphone

Does not replace the previous notification with the same thread-id

Thanks for reply

plokko commented 5 years ago

I do not know APNS funcionality and i don't even have apple products to test with it, please post a full JSON dump of the message payload (before submission) like in the example below so i can confront it with the documentation:

exit(json_encode($message,JSON_PRETTY_PRINT));