Skip to content

Unity integration check🔗

We recommend you to check the MRGS integration during the initial setup and the subsequent updates. It can be done by calling just one method.

Step 1. Enable debug mode🔗

During the integration check, you will need to view the logs from the device. To enable logging, enable debug mode during the MRGS initialization.

using MRGS;

public class MasterController : MonoBehaviour
{
    void Awake()
    {
        // Configure MRGS Settings
        var serviceParams = new MRGServiceParams(MRGS_APP_ID, CLIENT_SECRET);
        // ... configuration
        // Set debug mode flag to true
        serviceParams.Debug = true;

        // Configure external SDKs and MRGS initialization
        // ...

        // Call the initialization function
        MRGService.Instance.Initialize(serviceParams, sdkParams)
    }
}

Step 2. Call the integration check method🔗

For a correct integration check, it is necessary to perform a set of actions, which are described in the Installation section:

  • Call library initialization,
  • Call the game launch tracking method,
  • Set user id (if any),
  • Make a test payment.

Therefore, we recommend calling the integration check method when minimizing the application. Thus, you can complete all of the above actions, then minimize the application and see the check result.

public class MasterController : MonoBehaviour
{
    void OnApplicationPause(bool pauseStatus)
    {
        if(pauseStatus == true){
            //Call the integration check method
            MRGService.Instance.CheckIntegration();
        }
    }
}

Getting check results as object

If the output to the log is inconvenient for you, then you can get integration check results as a object(string+result), for this, use the method:

MRGService.Instance.CheckIntegration(result => { 
    Debug.Log("Received check result - " + result);
});

// Or async variant
var res = await MRGService.Instance.CheckIntegrationAsync();
Debug.Log("Received async IntegrationCheck result - " + res);

Further steps vary depending on the platform. Learn how you can view integration reports in the Android integration check and iOS integration check sections.

Important

Make sure that this code does not get into the release of your application, e.g. you can call this method only in the test environment.


Last update: 2023-09-27
Created: 2020-01-16