Live Activities Push-to-Start flows

Good morning,

We are implementing Live Activities in a push-to-start flow. We wrap the listener for push to start tokens in a high priority task:

if ptsListenerTask == nil || ptsListenerTask?.isCancelled == true {
    ptsListenerTask = Task(priority: .high) { [weak self] in
        for await pushToken in Activity<LiveAuctionAttributes>.pushToStartTokenUpdates {
        //Send token to back-end
     }
}

I've tried a few variations of this and they work well on most devices. I have seen a couple of devices that refuse to issue a push to start token.

The user will have logging for the init flow and starting the PTS listener then the logs just go silent, nothing happens.

One thing that seemed to work was getting the user to start a Live Activity manually (from our debugging tool) then the PTS token gets issued.

This is not very reliable and working a mock live activity into the flow for obtaining a PTS token is a poor solution.

Is anyone else seeing this and is there a known issue with obtaining PTS tokens?

Thanks!

Brad

Thank you for your post.

I appreciate the code provided. I always recommend developers to review this step-by-step process, starting with updating the Live Activity as it processes the starting push notifications token and then updating the push notifications. https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications

Also in all cases the user allows the live activity correct?

You can also provide a focused sample project so that we can observe how you are utilizing the starting token and update token. The code you provided is commendable, but it does not provide a comprehensive understanding of your approach. It would be beneficial if you could also observe the live activity in the code. We eagerly anticipate the completion of your code.

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Albert Pascual
  Worldwide Developer Relations.

Thanks for the quick response!

I will work on that today. We've seen this happen on two devices so far with no correlation on iOS version or device. Considering our test group is only about 10 people the implication is concerning.

I'll post here with a reply when I get the test project set up and sent to QA to see if we can reproduce it.

Looking forward to your sample! Can you tell me the iOS versions of those 2 devices?

Albert Pascual
  Worldwide Developer Relations.

Live Activities Push-to-Start flows
 
 
Q