Search Unity

Bug Profiler loses connection to device on OnApplicationPause

Discussion in 'iOS and tvOS' started by juan_homa, Nov 17, 2023.

  1. juan_homa

    juan_homa

    Joined:
    Aug 18, 2023
    Posts:
    25
    We are profiling on an iOS device, whenever we scroll down the control center, seems the application triggers OnApplicationPause and connection to the device is lost on the profiler.

    We are trying to profile something it happens just when the app comes from background but with this behavior of the profiler it's impossible.

    Is this a bug? any workaround?

    Thanks in advance
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    Does that happen right away or after some time?
    When app is sent to background, OS closes network connections after some grace period (~half a minute).
     
  3. juan_homa

    juan_homa

    Joined:
    Aug 18, 2023
    Posts:
    25
    It happens right away, instantly.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    This is intentional. When player pauses, player connection does pause as well.
     
  5. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    44
    As @Aurimas-Cernius wrote this is intentional. Whenever we get from the iOS info to pause application we also disconnect player connection to avoid zombi connections (we do not know if this pause will last few seconds, days or even weeks). Good info for you is that you can disable pausing of player connection by modifying the boot.config in the application. Just add there:

    Code (CSharp):
    1. player-connection-allow-pause=0
     
    juan_homa and MartinTilo like this.
  6. juan_homa

    juan_homa

    Joined:
    Aug 18, 2023
    Posts:
    25
    WONDERFUL!