Search Unity

OnApplicationPause + iPad Smart Cover = Suspend / resume events got called twice each

Discussion in 'iOS and tvOS' started by chenghaokan, Feb 19, 2019.

  1. chenghaokan

    chenghaokan

    Joined:
    May 16, 2018
    Posts:
    4
    Hi,

    I have noticed weird behavior OnApplicationPause when using a smart cover on an iPad.

    When putting the device into sleep mode by closing the cover, OnApplicationPause() will be called three times, like OnApplicationPause(true) -> OnApplicationPause(false) -> OnApplicationPause(true).
    and then when open the cover and resume the application, the last OnApplicationPause(false) will be called.

    Is this behavior intentional or is it a bug? Is there any way to avoid the duplicated event callback?