batikansosun / iOS-16-Live-Activities-Dynamic-Island

Displaying live data on the Lock Screen and in the Dynamic Island with Live Activities & ActivityKit & WidgetKit
73 stars 7 forks source link

How Activity widget receive apns data? #3

Open erduoniba opened 1 year ago

erduoniba commented 1 year ago

I'm not understand how activity widget receive apns data and to refresh ui can you update demo tutorial? tks

maybe we can use this to simulate apns:

 {
    "aps":{
        "timestamp":1168364460,
        "event":"update",
        "content-state":{
            "courierName": "harry"
        },
        "alert":{
            "productId": "2022101101",
            "title":"title",
            "body":"body",
            "sound":"example.aiff"
        }
    },
    "Simulator Target Bundle": "com.batikan.LiveActivityKit",
}

or

{
    "aps":{
        "timestamp":1168364460,
        "event":"update",
        "content-state":{
            "courierName": "harry"
        },
        "alert":{
            "productId": "2022101101",
            "title":"title",
            "body":"body",
            "sound":"example.aiff"
        }
    },
    "Simulator Target Bundle": "com.batikan.LiveActivityKit.Widget",
}
batikansosun commented 1 year ago

Hi @erduoniba an important note from Apple developer documentation is below.

That To test remote push notifications for Live Activities in Simulator, use a Mac with the Apple T2 Security Chip or a Mac with Apple silicon that runs macOS 13 or later.

I haven't a Mac that uses Apple T2 Security Chip. I use a Mac with Apple silicon and, I wait for macOS 13(Ventura) to be a public release. When that happened, I will try to test it by simulator notification and update the tutorial for that.

Thank you for your kind feedback.

erduoniba commented 1 year ago

Looking forward to