Skip to content


How to Accelerate Balancy Launch Time?

Quick app launches are essential for a positive user experience, as delays can be off-putting. Balancy offers a solution for apps that can be launched offline, minimizing the impact of web requests on the initial user experience.

  1. Pre-download Data:

  2. Initialization with PreInit:

    • During initialization of Balancy, use the parameter PreInit = PreInitType.LoadStaticDataAndLocalProfile. This approach ensures the app launches using locally available data.
  3. Handling OnInitProgress Callback:

    • Monitor for two additional cases in the OnInitProgress callback: BalancyInitStatus.PreInitFromResourcesOrCache and BalancyInitStatus.PreInitLocalProfile. Full usage of Balancy functionalities is advisable after the latter status.
  4. Background Initialization:

    • Balancy continues to initialize in the background. Upon completion of online data and profile synchronization, the OnReadyCallback will notify you.
  5. Conflicts Resolving:

    • Make sure you are resolving conflicts using the method OnSystemProfileConflictAppeared(), most likely you need to choose the Cloud version: Balancy.LiveOps.Profile.SolveConflict(ConflictsManager.VersionType.Cloud);.
  6. Immediate Functionality Post-PreInit:

    • Most features, except A/B Tests, become operational immediately after BalancyInitStatus.PreInitLocalProfile. To enable A/B Tests without awaiting full Balancy initialization, set the A/B Test parameter PreInitLaunch to true. Bear in mind, you won't be able to change any A/B Test parameters on the fly with this flag. You can only stop such a test or update it with the next app release.
  7. Final Initialization:

    • Once all new updates form Balancy are downloaded and the cloud profile is loaded and synchronized with the local progress, AppConfig.OnReadyCallback and void OnSmartObjectsInitialized(); are invoked.

By following these steps, you can ensure a swift launch of your app with Balancy, offering a seamless initial user experience.

Additional advice:

  1. Don't do Auth.SignOut() before Balancy.Main.Init, when using PreInitType.LoadStaticDataAndLocalProfile, because local progress won't be found and the new account will be created.
  2. If a user deletes the game, the local progress will be lost, it means that in OnInitProgress you are getting an empty profile. Don't worry, once the cloud version is loaded, you'll get the latest progress at AppConfig.OnReadyCallback. Make sure your code can work with changing profiles.

How to Integrate Existing User Purchase Data into Balancy?

When integrating Balancy into a product that's been in production for some time, aligning user segmentation by total spend can be a challenge, especially if users already belong to defined spending groups. Balancy does not inherently know these groupings without additional data.

Question: Is there a way to import existing total spend data upon first synchronization with Balancy, rather than re-processing each historical purchase?

Answer: You can streamline the integration of existing user data into Balancy by directly setting initial spending values rather than re-submitting each past transaction. This approach prevents unnecessary load on your server and avoids spikes in purchase statistics.

Here's how to implement this:

  1. Check for First Balancy Launch: Determine if it's the user's first session with Balancy integration. This can typically be done by checking session data or a custom boolean flag in the user-property.

  2. Set Initial Purchase Data: At the first launch, initialize the starting values for total purchases:

    var payments = Balancy.LiveOps.Profile.GetPaymentsInfo();
    payments.PaymentsCount = 10; // Total number of past purchases
    payments.TotalSpend = 999; // Total spent amount in USD
    payments.TotalSpendBalancy = 999; // Equivalent amount in Balancy's currency

  3. Ensure Single Execution: Make sure to execute these initializations only once, ideally before any new purchases are processed. This ensures that subsequent transactions are added correctly without overwriting the initialized data.

By adopting this method, you can effectively integrate historical spending data into Balancy, allowing for accurate user segmentation and analytics without the need for re-processing individual transactions.