Live activity pushTokenUpdates not emitting any token

We are using the below getPushToken() function to retrieve live activity token. However there are cases in production such that await activity.getPushToken() never finish. i.e. have logs of start event and no return or end event, the code path stuck at the guard statement.

Do anyone face same issue and if can advise what can go wrong and how best to handle such cases?

  // log start event
  guard let pushToken = await activity.getPushToken(),
        !pushToken.isEmpty else {
    // log return event
    return
  }
  // log end event


extension Activity {
  public func getPushToken() async -> String? {
    for await data in pushTokenUpdates {
      return data.map { String(format: "%02x", $0) }.joined()
    }
    return nil
  }
}

We're faced this issue. Conversion is around 50% (it means that we can get only 50% update tokens for 100% of started live activities). This is a problem, we're looking for some workaround, but still don't reach better conversion. This is disgusting 😭

Live activity pushTokenUpdates not emitting any token
 
 
Q