In a music streaming app, when using Activity.request to activate the Dynamic Island, the system’s Now Playing interface appears correctly. However, the app's live activities, lock screen, and other related features fail to display properly.
During debugging, the following code is used:
activity = try Activity.request(attributes: attributes, contentState: contentState, pushType: .token)
if !NMABTestManager.default().is(inTest: "FH-NewLiveActivityPush") {
// Listen to push token updates
if activity != nil {
tokenUpdatesTask?.cancel()
tokenUpdatesTask = Task.detached {
for await tokenData in self.activity!.pushTokenUpdates {
let mytoken = tokenData.map { String(format: "%02x", $0) }.joined().uppercased()
// pushToken is Data, needs to be converted to String using the above method before being passed to the server
self.pushToken = mytoken
}
}
}
}
} catch (let error) {
print("Error Starting Live Activity: \(error.localizedDescription)")
}
In this scenario, the push token is returned correctly, and no errors are triggered.
This issue did not occur in iOS 17 but appears sporadically in iOS 18. Once it occurs, it cannot be resolved through restarting or other means.
feedbackid:FB14763873, i upload my sysdisagnose