I'm working for an airline with their app. We have released the app on Apple Watch, but have a big problem: the scanners for the QR-code used to go through security and to board the plane, are scanning from the bottom and up...
This means that you cannot use the watch app, because when you turn your wrist, the watch goes in black sleep mode.
Is there any way of turning this temporarily off for a view? I have heard rumours that it can be disabled in WatchOS 4, but can't find out how.
Thanks for the help! :)
This is very interesting question. There seems no way to present this without the PassKit(Or even with passkit the screen will still go off...) I think PassKit Controller has some functions when you focus the QR code it doesn't go to sleep...
reading the watchkit reference in here , you need to implement presentation of the passkitController.
Because right now you cannot tell apple watch to resign sleep, it is agains human guidelines + it would really be energy-consuming solution. Instead, apple handles for you with PassKitController instance. So on watchkit, you do this:
let pass = PKPass(data: /*There goes your data*/, error: nil)
presentAddPassesController(withPasses: [pass]) {
// Do smth on completion
}
You definitely should try to inform user and give him access to export the pkpass to wallet...
Resources used:
https://github.com/TwoRingSoft/pkpassgenerator
For generating custom passkit object
This could help you as well:
https://www.natashatherobot.com/url-apple-wallet-passkit-pass/?utm_campaign=This%2BWeek%2Bin%2BSwift&utm_medium=email&utm_source=This_Week_in_Swift_138
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With