I've similar issues in one of my POC.
The problem occurs because of the recursive app opening behavior. This way we can fix it, while returning IntentResult type instead of OpaqueType.
struct NotifyFriendsScreen: AppIntent {
static var title: LocalizedStringResource = "Connect With Friends"
static var description = IntentDescription("This will activate tell-them to notify your friends. Then you can proceed to app.")
@Parameter(title: "❗️Choose App❗️", optionsProvider: SupportedApps())
var selectedApp: String
@MainActor
func perform() async throws -> IntentResult {
if UserDefaults.standard.bool(forKey: "openTellThem") {
showTargetViewController()
UserDefaults.standard.set(false, forKey: "openTellThem")
return .result()
} else {
return .result()
}
}
}
I hope this will fix your issue.