Configure SDK
1. Enable test mode
Test mode allows you to show our test ads with 100% filtrate.
Appodeal.setTesting(true);
2. Enable logging
To enable debug logging use the code below:
Appodeal.setLogLevel(Appodeal.LogLevel.Debug);
Appodeal
".Available parameters:
Appodeal.LogLevel.None
- logs off;Appodeal.LogLevel.Debug
- debug messages;Appodeal.LogLevel.Verbose
- all SDK and ad network messages.
3. Disable networks
To disable the networks you don’t want to get ads from, use the following method before the SDK initialization:
Appodeal.disableNetwork((string)network);
4. Disable networks for specific ad types
To disable networks for the specific ad formats use the following method before the SDK initialization:
Appodeal.disableNetwork((string)network, adTypes);
5. Disable location permission check
To disable toast message "ACCESS_COARSE_LOCATION permission is missing", use the following method before the SDK initialization:
Appodeal.disableLocationPermissionCheck();
6. Disable write external storage permission check
To disable toast-messages "WRITE_EXTERNAL_STORAGE permission is missing", use the following method before the SDK initialization:
Appodeal.disableWriteExternalStoragePermissionCheck();
7. Test the third-party networks adapters integration
To check integration of the third-party networks, you need to start a test screen by calling the following method. It is currently supported only for the Android:
Appodeal.showTestScreen();
8. Disable data collection for kids apps
Appodeal.setChildDirectedTreatment(true)
9. Request runtime permissions in Android Marshmallow (API 6.0+)
1. Extend your class with IPermissionGrantedListener
:
YourClassName : IPermissionGrantedListener;
Awake()
method of the class that loads first:Appodeal.requestAndroidMPermissions(this);
WRITE_EXTERNAL_STORAGE
and ACCESS_COARSE_LOCATION
permissions in Android Marshmallow and higher:public void writeExternalStorageResponse(int result) { if(result == 0) { Debug.Log("WRITE_EXTERNAL_STORAGE permission granted"); } else { Debug.Log("WRITE_EXTERNAL_STORAGE permission grant refused"); } } public void accessCoarseLocationResponse(int result) { if(result == 0) { Debug.Log("ACCESS_COARSE_LOCATION permission granted"); } else { Debug.Log("ACCESS_COARSE_LOCATION permission grant refused"); } }
10. Mute video ads (Android only)
If calls are muted on a user’s device, you can also mute sound of video ads for them, using the following method:
Appodeal.muteVideosIfCallsMuted(true)
11. Send extra data
You can send key-value data to Appodel. There is the predefined key ExtraData.APPSFLYER_ID
.
Appodeal.setExtraData(string key, bool value) ; Appodeal.setExtraData(string key, int value) ; Appodeal.setExtraData(string key, double value); Appodeal.setExtraData(string key, string value) ;
12. Get predicted eCPM by ad type
For all ad types:
Appodeal.getPredictedEcpm(int adType);
double
.13. Change Data Protection Regulation (GDPR, CCPA) consent status
1. Starting from version 2.10.0 you can use the Stack Consent Manager SDK to process and pass the user's consent:
Read our implementation Stack Consent Manager guide here.
Publishers need to pass the Consent result object from Stack Consent Manager SDK to the Appodeal.initialize()
method of our SDK.
// NOTE: getConsent() - should be called after requesting user consent Consent consent = consentManager.getConsent(); Appodeal.updateConsent(consent);
2. If you don't want to use the Stack Content Manager SDK, you can use the old version to update the user's consent:
Appodeal.updateConsent(consent);
You can use this method to provide the GDPR/CCPA user consent for ad networks in Appodeal SDK anywhere of your application. Appodeal SDK don't keep the GDPR/CCPA user consent between session, that means you should provide consent every time, otherwise, Appodeal SDK uses default or server value. By default consent value is true
.
You can read more info about GDPR/CCPA here.