So, I already read several blogs, posts, and Apple's own Human Interface Guidelines that iOS 14 Widgets are NOT interactive, BUT: It's possible to pass a short link to the app when pressing on a target. Apple on its own says: "Small Widgets got one single tap target, Medium and Large Widgets got multiple tap targets". OK!
Now when you tap on these Targets the app is opening and the Widget is passing that short link to the App.
BUT, now my question, where Google says Idk:
Can I programmatically say "prevent opening app", when tapping on one of these buttons I've created in my Widget? It's just as easy as in Javascript: preventDefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault).
Is this possible? I just want to prevent the opening of the app and access that Tap-Target Callback that is triggered and process my stuff in SwiftUI.
Thanks a lot, guys :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…