Network check

Network check #

When there is a problem with user’s network, you can know the exact information at that time to better locate the problem.

We provide you with two ways to detect user’s network, which is ping and traceroute.

Note:

This function has switch and label configuration in the dashboard of AIHelp.

Please make sure that the relevant configuration in the dashboard is ready before your integrating.

API #

After the story line configuration is completed in the aihelp dashborad, call this method to start network check when a storyline is triggered.

Your can also get the network check results through the callback, so as to carry out the next step of processing.

This API requires the following parameters:

  • hostAddress

    Required.

    Specify the domain name of network detection, preferably the domain name or IP address where the user server is located, so as to detect the quality of network connection of users to the application;

    If you don’t want to expose your IP, you can consider setting a trusted public service address, such as Google / AWS.

  • OnNetworkCheckResultCallback

    Optional.

    Callback of network detection results, AIHelp will return the network check results to the caller through the interface.

Code example #

Then, the code example is as follows:

AIHelpSupport.setNetworkCheckHostAddress("aihelp.net", new OnNetworkCheckResultCallback() {
    @Override
    public void onNetworkCheckResult(String netLog) {
        // 
    }
});
void AIHelp_onNetworkCheckResult(const NSString * netLog) {
    // do something you want
}

// set host and callback
[AIHelpSupportSDK setNetworkCheckHostAddress:@"aihelp.net" callback:AIHelp_onNetworkCheckResult];
void AIHelp_onNetworkCheckResult(const char * netLog) {
    // do something you want
}

// set host and callback
AIHelpSupport::setNetworkCheckHostAddress("aihelp.net", AIHelp_onNetworkCheckResult);
void AIHelp_onNetworkCheckResult(const char * netLog) {
    // do something you want
}

// set host and callback
AIHelpSupport.setNetworkCheckHostAddress("aihelp.net", AIHelp_onNetworkCheckResult);

Remark #