Skip to content

Commit

Permalink
Merge pull request #802 from ignacionar/#801
Browse files Browse the repository at this point in the history
#801 Reset to portrait mode before pressing home button in iOS
  • Loading branch information
vdelendik authored Oct 25, 2023
2 parents 0d9a1dd + 88401b1 commit 6f8d907
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/units/ios-device/plugins/wda.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ module.exports = syrup.serial()
Wda.connect = () => {
sub.on('message', wirerouter()
.on(wire.KeyPressMessage, (channel, message) => {
if (wdaClient.orientation === 'LANDSCAPE' && message.key === 'home') {
wdaClient.rotation({orientation: 'PORTRAIT'}).then(() => {
iosutil.pressButton.call(wdaClient, message.key)
})
}
iosutil.pressButton.call(wdaClient, message.key)
})
.on(wire.StoreOpenMessage, (channel, message) => {
Expand Down

0 comments on commit 6f8d907

Please sign in to comment.