FAQ¶
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.
-
Pre-download Data:
- Prioritize downloading data before building your app.
-
Initialization with PreInit:
- During initialization of Balancy, use the parameter
PreInit = PreInitType.LoadStaticDataAndLocalProfile
. This approach ensures the app launches using locally available data.
- During initialization of Balancy, use the parameter
-
Handling OnInitProgress Callback:
- Monitor for two additional cases in the
OnInitProgress
callback:BalancyInitStatus.PreInitFromResourcesOrCache
andBalancyInitStatus.PreInitLocalProfile
. Full usage of Balancy functionalities is advisable after the latter status.
- Monitor for two additional cases in the
-
Background Initialization:
- Balancy continues to initialize in the background. Upon completion of online data and profile synchronization, the
OnReadyCallback
will notify you.
- Balancy continues to initialize in the background. Upon completion of online data and profile synchronization, the
-
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);
.
- Make sure you are resolving conflicts using the method
-
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 parameterPreInitLaunch
totrue
. 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.
- Most features, except A/B Tests, become operational immediately after
-
Final Initialization:
- Once all new updates form Balancy are downloaded and the cloud profile is loaded and synchronized with the local progress,
AppConfig.OnReadyCallback
andvoid OnSmartObjectsInitialized();
are invoked.
- Once all new updates form Balancy are downloaded and the cloud profile is loaded and synchronized with the local progress,
By following these steps, you can ensure a swift launch of your app with Balancy, offering a seamless initial user experience.
Additional advice:
- Don't do
Auth.SignOut()
beforeBalancy.Main.Init
, when usingPreInitType.LoadStaticDataAndLocalProfile
, because local progress won't be found and the new account will be created. - 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 atAppConfig.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:
-
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.
-
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
-
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.