Closed xiaoyintoken closed 2 years ago
@xiaoyintoken You can get pushtoken in func update(activity: Activity<GroceryDeliveryAppAttributes>)
method
I get pushtoken is nil all the time, how do you get it
Hi xiaoyintoken,
Every activity has push token data to update its content via Remote Push Notification. You can access token data like the below code.
Eligibility Conditions
Push Notifications Capability Background Modes - Remote Notifications Push Notification Request Authorization Physical Device OR "To test remote push notifications for Live Activities in Simulator, use a Mac model with the Apple T2 Security Chip or a Mac with Apple silicon that runs macOS 13 or later."
var activities = Activity<GroceryDeliveryAppAttributes>.activities
let pushTokenData = activities.first?.pushToken
I'm going to close the issue. If you get any errors reopen it.
I get pushtoken is nil all the time, how do you get it