Getting started with GDPR (Your interface rendering)🔗
If you don't want to use HTML to render the agreement, and you'd like to control the process yourself, then you can use our methods that enable work with your interfaces and just inform us if the user has accepted the agreement. GDPR integration based on your native forms into the application consists of just a few steps:
Reminder
You can find examples of how the agreement looks in this format on the page with the GDPR description.
We also remind you that there is a second option to display the GDPR - Display and rendering of the interface with our tools by using HTML layout.
Step 1. Make your interface🔗
Conditional, but very important step. It is necessary to build the agreement interface using the platform you're working with.
Step 2. Check reasons to show the agreement🔗
First you need to understand whether it is necessary to show the custom GDPR window to the user. To do this use the following method which provides MRGSGDPRShowReason:
MRGSGDPR.Instance.ShouldShowAgreement((reason, agreement) => {
if (reason == MRGSGDPRShowReason.None)
{
// There're no any reasons to show agreement to the user.
// Agreement param will be null here
}
if (reason == MRGSGDPRShowReason.Initial)
{
// User is under GDPR and he hasn't accepted any agreements yet.
// Agreement param provides extra data.
}
if (reason == MRGSGDPRShowReason.VersionUpdate)
{
// User has an accepted agreement and there's a new agreement version on MRGS server.
// Agreement param provides extra data.
}
if (reason == MRGSGDPRShowReason.PublisherUpdate)
{
// User has an accepted agreement and publisher was changed.
// Agreement param provides extra data.
}
});
// Or using await:
var res = MRGSGDPR.Instance.ShouldShowAgreementAsync();
[[MRGSGDPR sharedInstance] shouldShowAgreementWithCompletion:^(enum MRGSGDPRShowReason reason, MRGSGDPRAgreement * _Nullable agreement) {
if(reason == MRGSGDPRShowReasonNone){
// There're no any reasons to show agreement to the user.
// Agreement param will be nil here
}
if(reason == MRGSGDPRShowReasonInitial){
// User is under GDPR and he hasn't accepted any agreements yet.
// Agreement param provides extra data.
}
if(reason == MRGSGDPRShowReasonVersionUpdate){
// User has an accepted agreement and there's a new agreement version on MRGS server.
// Agreement param provides extra data.
}
if(reason == MRGSGDPRShowReasonPublisherUpdate){
// User has an accepted agreement and publisher was changed.
// Agreement param provides extra data.
}
}];
import android.app.Activity;
import games.my.mrgs.gdpr.MRGSGDPR;
import games.my.mrgs.gdpr.MRGSGDPRShowReason;
MRGSGDPR.getInstance().shouldShowAgreement(Activity, (reason, agreement) -> {
if (reason == MRGSGDPRShowReason.NONE) {
// There're no any reasons to show agreement to the user.
// Agreement param will be null here
}
if (reason == MRGSGDPRShowReason.INITIAL) {
// User is under GDPR and he hasn't accepted any agreements yet.
// Agreement param provides extra data.
}
if (reason == MRGSGDPRShowReason.VERSION_UPDATE) {
// User has an accepted agreement and there's a new agreement version on MRGS server.
// Agreement param provides extra data.
}
if (reason == MRGSGDPRShowReason.PUBLISHER_UPDATE) {
// User has an accepted agreement and publisher was changed.
// Agreement param provides extra data.
}
});
Versions 6.0.0-6.8.1
Deprecated functionality can return 'true' if the version received from MRGS server is higher than the currently accepted one, and the user is under GDPR (only counts if the 'onlyEU' flag is set). Deprecated functionality can't provide reason of showing agreement such updated agreement version or changed publisher. If you want to get more information, consider to use new functionality.
Step 3. After the agreement is accepted🔗
When the user accepted the agreement, you need to inform us and we'll send this information to MRGS server. To do this, use this method:
Versions 6.0.0-6.8.1
- context - applicationContext,
- advertising - Did the user agree to receive ads,
- status - Whether the agreement was accepted by the user in a custom dialogue or was it accepted automatically since the user is not from the EU and does not fall under the GDPR,
- appId - Application ID in MRGS system.
Auto-acceptance agreement
status parameter wasn't moved to new functionality because you MUSTN'T accept agreement for user. You MUST show the agreement to user and handle result of his choice.
Old functionality: if status: false and setUserHasAcceptedAgreement was called, MRGS SDK will ignore that call.
New functionality: status wasn't moved any call of onAgreementAccepted will be regarded as acceptance of the agreement personally by the user.
Example🔗
MRGSGDPR.Instance.ShouldShowAgreement((reason, agreement) => {
if (reason == MRGSGDPRShowReason.None)
{
// There're no any reasons to show agreement to the user.
// Agreement param will be null here
return;
}
// Show your agreement which depends on reasons to the user
// Then check user's result
if (<USER_AGREED>)
{
// Whether user has agreed to receive news and advertising or not
MRGSGDPR.Instance.OnAgreementAccepted(withAdvertising);
// Initialize MRGService
// Initialize other SDK's
}
else
{
// DO NOT call OnAgreementAccepted here.
}
});
MRGSGDPR.getInstance().shouldShowGDPR(appId: MRGS_APP_ID, onlyEU: false, completion: (bool shouldShow) => {
if (shouldShow)
{
//Show controller
//After controller finishes do:
MRGSGDPR.getInstance().setUserHasAcceptedAgreement(advertising: false, status: true, appId: MRGS_APP_ID);
initMRGS();
} else {
MRGSGDPR.getInstance().setUserHasAcceptedAgreement(advertising: false, status: false, appId: MRGS_APP_ID);
initMRGS();
}
});
[[MRGSGDPR sharedInstance] shouldShowAgreementWithCompletion:^(enum MRGSGDPRShowReason reason, MRGSGDPRAgreement * _Nullable agreement) {
if(reason == MRGSGDPRShowReasonNone){
// There're no any reasons to show agreement to the user.
// Agreement param will be nil here
return;
}
// Show your agreement which depends on reasons to the user
// Then check user's result
if (<USER_AGREED>)
{
// Whether user has agreed to receive news and advertising or not
[[MRGSGDPR sharedInstance] onAgreementAcceptedWithAdvertising:withAdvertising];
// Initialize MRGService
// Initialize other SDK's
}
else
{
// DO NOT call onAgreementAccepted here.
}
}];
[[MRGSGDPR sharedInstance] shouldShowGDPRForAppID:MRGS_APP_ID onlyEU:false withCompletion:^(bool shouldShowGDPR) {
if(shouldShowGDPR){
//Show controller
//After controller finishes do:
[[MRGSGDPR sharedInstance] setUserHasAcceptedAgreementWithAdvertising:false fromDialog:true forApplication:MRGS_APP_ID];
[self initMRGS];
}else{
[[MRGSGDPR sharedInstance] setUserHasAcceptedAgreementWithAdvertising:false fromDialog:false forApplication:MRGS_APP_ID];
[self initMRGS];
}
}];
import android.app.Activity;
import games.my.mrgs.gdpr.MRGSGDPR;
import games.my.mrgs.gdpr.MRGSGDPRShowReason;
MRGSGDPR.getInstance().shouldShowAgreement(Activity, (reason, agreement) -> {
if (reason == MRGSGDPRShowReason.NONE) {
// There're no any reasons to show agreement to the user.
// Agreement param will be null here
return;
}
// Show your agreement which depends on reasons to the user
// Then check user's result
if (<USER_AGREED>) {
// Whether user has agreed to receive news and advertising or not
// Whether user has agreed to receive news and advertising or not
MRGSGDPR.getInstance().onAgreementAccepted(Context, withAdvertising);
// Initialize MRGService
// Initialize other SDK's
} else {
// DO NOT call OnAgreementAccepted here.
}
});
import games.my.mrgs.gdpr.MRGSGDPR;
final MRGSGDPR gdpr = MRGSGDPR.getInstance();
gdpr.shouldShowGDPR(this, MRGS_APP_ID, false, new MRGSGDPR.MRGSGDPRAsyncStatus() {
@Override
public void onAsyncStatus(boolean status) {
if (status) {
//Show GDPR Fragment/Activity
//After controller finishes do:
gdpr.setUserHasAcceptedAgreement(MainActivity.this, false, true, MRGS_APP_ID);
initMRGS();
}
else {
gdpr.setUserHasAcceptedAgreement(MainActivity.this, false, false, MRGS_APP_ID);
initMRGS();
}
}
});
Created: 2020-02-17