istornz/flutter_live_activities

Need to access the activity push token

jolamar opened this issue · 1 comments

In order to send remote push updates we need to get the live activity push token.. looks something like this:

let activity = try Activity.request(attributes: attributes, contentState: contentState, pushType: .token)

    if let data = activity.pushToken {
        let token = data.toHexString()
        // TODO: send to the backend.
    }

This push token can be used in the backend to push updates to the live activity. I believe this needs to be updated here https://github.com/istornz/flutter_live_activities/blob/main/ios/Classes/SwiftLiveActivitiesPlugin.swift#L141

then ideally there would be a flutter method like .getPushToken(activityId)

Closed, now out on pub dev as 1.5.0.
Thanks @jolamar