Eithaam ๐Ÿ‚
Eithaam ๐Ÿ‚
TSDThe Swift Den
Created by Eithaam ๐Ÿ‚ on 7/28/2024 in #swift-development
Live activities doesnโ€™t get notifications token
Hi everyone, Iโ€™m currently learning Swift and Swift UI by myself for my master degree. Since yesterday Iโ€™m building a little app to implement Live Activities and Dynamic Island notifications, because theyโ€™re to cool to be ignored, but something goes wrong. Iโ€™m following this tutorial : https://techholding.co/blog/Live-Activities-in-iOS-16.1-and-later-in-SwiftUI/ But when it comes to the startDeliveryPizza function to lunch live activity, Iโ€™m stuck in an infinite loop inside the task
Task {
for await pushToken in deliveryActivity.pushTokenUpdates {
let pushTokenString = pushToken.reduce("") { $0 + String(format: "%02x", $1)}

print("Push token str = \(pushTokenString)")
}
}
}
Task {
for await pushToken in deliveryActivity.pushTokenUpdates {
let pushTokenString = pushToken.reduce("") { $0 + String(format: "%02x", $1)}

print("Push token str = \(pushTokenString)")
}
}
}
After setting a time out, it appears that I never receive any push token. I donโ€™t need to send real push tokens from a server, itโ€™s juste a little project made to be built on my phone. Can anyone help me to fix this please ? Iโ€™d really like to understand the problem and learn to fix this. And itโ€™s really hard to find good documentation about live activities and Dynamic Island on the web
2 replies