Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Delayed initialization on Android if no internet connection available.

Discussion in 'Unity Everyplay' started by Frima_FXVezina, Oct 26, 2015.

  1. Frima_FXVezina


    Apr 23, 2015
    I started by writing the following message in the "propose a feature" feedback section as I couldn't find any way in the documentation nor on the forums that would help me handling the use-case I am trying to handle right now. Still thought I should ask you guys first, just in case.

    Here's the full feature request:
    "The Android device family being so vast and constantly evolving, I understand the technical requirement for this check to be mandatorily performed before confirming if the device is supported or not.

    However, I do not understand why the native api tries to init itself when it's native library is loaded and simply stops after a defined number of tries when I am able to know if an internet connection is available or not. Worst thing is, I don't even have any means to tell the api when it is a right time to retry and give me a tangible answer. There is also no way for me to know if the compatibility check could be performed or not. The only option I am left with to communicate my users is to tell them the device isn't supported, even though that might not really be the case. I can't even tell them to try again on their next session as I might have received a totally legit negative response.

    So after my rant, what I would like to see added to Everyplay:
    1- A way to initialize manually Everyplay on Android when I decide it is the proper time to do so. (Might wanna make it an option in the everyplay settings to auto-init or not).
    2- Any way to differentiate an negative response for a device that is unsupported from a negativeresponse because of compatibility check failure.

    Otherwise, awesome api guys!

    So, basically, my problem is that I cannot identify the true device support status programatically to communicate to the user, or that I am unable to recover from a fail compatibility check (which would also solve my current problem). Is there any way this can currently be done? Or this should go directly into the feature request box?

    Technical infos:
    Unity : 5.2.1f1
    Everyplay SDK : Unity 2010-1510 - Oct 9th 2015

    Thanks in advance for your time!

    François-Xavier Vézina
    Game Programmer at Frima Studio
  2. ullatussimo


    Unity Technologies

    Jun 16, 2015
    Hello @Frima_FXVezina ,

    Thanks for reaching out!

    Our Unity plugin contains a feature called Early Initialization. This feature automatically handles the Initialization of Everyplay. The feature was put in place to make it easier to get started with using Everyplay.

    However, it is possible to disable the Early Initialization system and handle the initialization of Everyplay manually.
    You just need to open up Assets/Plugins/Everyplay/Scripts/EveryplayEarlyInitializer.cs -script and disable the Everyplay.Initialize() -call there.

    After you have disabled the call there you have total control on when to initialize Everyplay by calling Everyplay.Initialize() at the time of your choosing.

    Thanks for your suggestions, they will be taken into account.

    Hope this helps!

  3. Frima_FXVezina


    Apr 23, 2015
    Hello again!

    Thanks for the quick reply!

    I made the change in our project and am happy to report that this does indeed work wonderfully and allows me to handle the android initialization flow at my own leisure and address the test case that was problematic for us.

    I would still strongly advise having something like a boolean in the Everyplay settings that active the Early Initialization or not as this could prove problematic for us to re-apply this "patch" every time we want to update the SDK.

    Or you may even want to look into doing the internet connectivity handling natively in the java classes to keep the ease of integration in future version? I understand this would probably mean some changes in the initialization flow, which would maybe even required developers to change their implementation to conform to these modifications and might be kept until a major version needs to be rolled out.

    My mere two cents on it, I can easily have faith you guys will address this in the way that makes the most common sense. I understand for now this is only a workaround, and am really grateful for it!

    Thanks again! Will keep an eye out for further developments on your plugin :)

    Best regards,
    François-Xavier Vézina
  4. skdev3


    Jul 15, 2015
    How to use Delayed initialization option in Unity 2017.2?