Android 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.
import games.my.mrgs.MRGSExternalSDKParams;
import games.my.mrgs.MRGSPlatform;
import games.my.mrgs.MRGService;
import games.my.mrgs.MRGServiceParams;
public class YourApplicationClass extends Application {
@Override
public void onCreate() {
super.onCreate();
// Setting MRGService
// Available MRGSPlatform: AMAZON, ANDROID, HUAWEI, SAMSUNG and FACEBOOK_CLOUD
final MRGServiceParams serviceParams
= MRGServiceParams.init(<MRGS_APP_ID>, <CLIENT_SECRET>, MRGSPlatform.ANDROID)
serviceParams.setDebuggable(true);
// Setting External SDKS
final MRGSExternalSDKParams externalSDKParams = MRGSExternalSDKParams.newInstance();
// ...
externalSDKParams.myTrackerParams = myTrackerParams;
MRGService.service(context, serviceParams, externalSDKParams);
}
}
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 MainActivity extends AppCompatActivity {
@Override
protected void onStop() {
super.onStop();
// Call checkIntegration
MRGService.getInstance().checkIntegration();
}
}
Getting check results as string
If the output to the log is inconvenient for you, then you can get integration check results as a string, for this, use the method:
import androidx.annotation.NonNull;
import games.my.mrgs.MRGSIntegrationCheckResult;
import games.my.mrgs.MRGService;
import games.my.mrgs.utils.optional.Consumer;
MRGService.getInstance().checkIntegration(new Consumer<MRGSIntegrationCheckResult>() {
@Override
public void accept(@NonNull MRGSIntegrationCheckResult result) {
switch (result.getStatus()) {
case PASSED:
// Integration check passed successfully.
// Get result as String
result.getCheckResult();
break;
case FAILED:
// There are some problems.
// Get result as String
result.getCheckResult();
break;
case DISABLED:
// Looks like you forgot enable debug for MRGService.
break;
}
}
});
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.
Step 3. Start application🔗
Launch the application, wait for the MRGS to initialize, initialize MRGS, make a test payment, and then minimize the application.
Step 4. View the result of the integration check🔗
To view the logs, use the adb logcat command. You can filter logs by the "MRGService" key.
A string "All checks has passed correctly" in log output means integration was done right. Here is an example of the integration status display:
---------------------------------------------------------------------------
---------------------- [MRGS INTEGRATION CHECK] ---------------------------
---------------------------------------------------------------------------
MRGS integration check results:
MRGSFrameworkVersion:
MRGSVersion: 4.0.7
MRGSBuild: 11190
BaseSettings:
appID: XXX
appSecret: XXXXXXXXXXXXX
isTestDevice: false
InitialisationProcess:
allExternalSDKStarted: true
mrgsInitWasCalled: true
onStartCalled: true
onStopCalled: true
advertising identifier collected: true
install referrer received: true
install referrer forwarded to MyTracker: true
install referrer forwarded to AppsFlyer: true
mrgsInitialized: true
Network:
networkRequestCompletedSuccessfully: true
atLeastOneNetworkRequestCompleted: true
MyTrackerSettings:
MyTrackerEnabled: true
MyTrackerMetricsForwardingEnabled: true
Bank:
AllBankMethodsWasCalled: true
PaymentsAreHeldByMRGS: true
Users:
userAuthorizationSuccessful: true
Advertising:
loadAdvertisingWasCalled: false
loadAdvertisingWasCalledWithLoadedAdvertising: false
showAdvertisingWasCalled: false
---------------------------------------------------------------------------
MRGS integration recommendations:
All checks has passed correctly
---------------------------------------------------------------------------
MRGS settings:
Bundle[{localPushNotifications=true, locations=false, billing=google, pushNotifications=879937202927, debug=true, crashReports=false, testDevice=false, pushIcon=push_icon}]
MRGS external SDK settings:
Bundle[{GoogleAnalytics=Bundle[{enable=true, exceptionHandler=true, trackingId=UA-45510902-33, logLevel=0}], MyTracker=Bundle[{enable=true, appId=XXXXXXXXX, debug=true}], Adman=Bundle[{enable=true, slotId=10093, interstitialSlotId=169263, debug=false, fullscreenSlotId=10095}], AppsFlyer=Bundle[{enable=true, app_key=XXXXXXXXX, debug=false}], MyComSupport=Bundle[{enable=true, secret=dfdflls, projectId=40}], SamsungBilling=Bundle[{enable=false, mode=test}], Flurry=Bundle[{enable=false, applicationKey=XXXXXXXXX}]}]
---------------------------------------------------------------------------
------------------ [MRGS INTEGRATION CHECK FINISHED] ----------------------
---------------------------------------------------------------------------
- MRGSVersion - MRGS library version number.
- MRGSBuild - MRGS library build number.
- appID - ID of the application used during the MRGS initialization.
- appSecret - Client key. Pay attention to the appID and appSecret parameters. Sometimes developers use parameters from a test application while creating a build.
- isTestDevice - In the release build, this parameter must be set to "false".
- allExternalSDKStarted - Indicates whether all SDKs specified during MRGS initialization have been started. If the parameter equals "false", it is worth reviewing the logs, maybe there will be an exception or an error information.
- mrgsInitWasCalled - MRGS initialization method was called.
- onStartCalled - Application start tracking was called.
- onStopCalled - Application minimizing tracking was called.
- advertising identifier collected - Advertising ID received. (GAID on Android and IDFA on iOS). Without this identifier, statistics in MRGS/MyTracker/1link cannot be calculated correctly.
- mrgsInitialized - MRGS initialization process was completed correctly
- Installation tracking:
- install referrer received - INSTALL_REFERRER was passed before start and received by MRGS.
- install referrer forwarded to MyTracker - INSTALL_REFERRER was correctly redirected to MyTracker.
- install referrer forwarded to AppsFlyer - INSTALL_REFERRER was correctly redirected to AppsFlyer.
- Network:
- networkRequestCompletedSuccessfully - If this parameter equals "false", it is highly likely that the MRGS server could not decrypt the request. Check the appId and secret for your application.
- atLeastOneNetworkRequestCompleted - If this parameter equals "false", then no request has completed correctly. There may be network issues.
- MyTracker:
- MyTrackerEnabled - If this parameter equals false, this means that MyTracker was not enabled during MRGS initialization. Check MyTracker initialization settings.
- MyTrackerMetricsForwardingEnabled - If this parameter equals "false", MRGS will not send metrics to MyTracker. Check MyTracker initialization settings.
- Payments:
- AllBankMethodsWasCalled - If this parameter equals false, not all the methods required for processing banking were called. These will be listed in the MRGS integration recommendations section.
- PaymentsAreHeldByMRGS - If this parameter equals "false", the application uses its own system for processing payments (banking) and only informs MRGS about the payment.
- Tracking game account login.
- userAuthorizationSuccessful - If this parameter equals "false", the method for user authorization was not called.
- Cross-promotion (Piligrim):
- loadAdvertisingWasCalled - If this parameter equals "false", the loadContent method for the Piligrim system was not called (optionally, only if the project is connected to the Piligrim system).
- loadAdvertisingWasCalledWithLoadedAdvertising - If this parameter equals "true", the loadContent method was called again after the Piligrim content had already been loaded.
- showAdvertisingWasCalled - If this parameter equals "false", the showContent method for the Piligrim system was not called (optionally, only if the project is connected to the Piligrim system).
Created: 2020-01-16