andrei-m-code / net-core-push-notifications

Lightweight .NET Core Push Notifications for Android, iOS and Web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

both alert and silent notifications ios13

asaadmirza opened this issue · comments

hi dear ,
with your code only i can send alert notification without background fetch content , kindly help me to solve this issue , even i set apns-push-type = background but i still not receive it , only receive alert when i change apns-push-type to alert but no silent push notification. my payload is
{
"aps" : {
"alert" :
{
"title" :"test",
"body" : "hellooooo",

                        },
                        "badge" : 1,
                        "sound" : "default",
                        "content_available" : 1,
                    },
                    "person"
                    {
                        "userIdTo": 12,
                         "ListID" : 0,
                     
                    }

}

Try changing priority from 10 to 5. See more details here.

Apple's documentation has some ambiguity on this field. Some Apple documentation pages indicate that apns-priority must be set to 5 for all push payloads that have content-available set to 1 (true). Other documentation pages indicate that content-available can be set to 1 and apns-priority can still be set to 10, as long as the push message has content to be shown to the user (via the alert field of the APNS payload).

Our findings are that the latter is true: At this time, apns-priorty only needs to be set to 5 for notifications without any alert data. OneSignal automatically sets this header to the right value for our customers.

I tried it but still not update in background , I set apps-push-type to alert , just I receive the notification without update content in background , only when I open background app refresh from setting it work , but in iOS 12 no need to open this option from settings.

Hi.

How can I send an Header to FcmSender? I don't know how to send apns-push-type or apns-priority

@Sthefanny please read the README. There are some notification model examples that might be helpful. For properties with dashes you can use attribute [JsonProperty("apns-push-type")] and it will be serialized accordingly.