Начало работы с GDPR (Ваша отрисовка интерфейса)🔗
Если Вы не хотите использовать HTML для отрисовки соглашения, и хотите контролировать процесс сами, то Вы можете воспользоваться нашими методами, позволяющими работать со своими интерфейсами, и только сообщать нам, принял ли пользователь соглашение. Интеграция GDPR, на основе Ваших нативных форм в приложение, состоит всего в нескольких шагах:
Reminder
Примеры того, как выглядит соглашение в данном формате вы можете найти на странице с описанием GDPR
Также напоминаем, что существует второй способ показа GDPR - Показ и отрисовка интерфейса нашими средствами, используя HTML-верстку.
Шаг 1. Сделать свой интерфейс🔗
Условный, но очень важный шаг. Необходимо построить интерфейс соглашения средствами платформы, на которой вы работаете.
Шаг 2. Проверить необходимость показа соглашения🔗
Сначала необходимо понять, необходимо ли показывать соглашение пользователю. Для этого воспользуйтесь методом, который вернет 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.
}
});
Версии 6.0.0-6.8.1
Старый функционал возвращает true, если полученная с сервера MRGS версия больше текущей принятой, и пользователь подходит под GDPR (учитывается, если стоит флаг onlyEU). Старый функционал не позволяет выяснить причину показа, такие как новая версия или смена издателя, потому он вернет true для обоих случаев. Если вам нужная данная информация то советуем перейти на новый функционал.
Шаг 3. После принятия соглашения🔗
Когда пользователь примет соглашение, Вам необходимо сообщить об этом нам и мы отправим всю информацию на сервер. Для этого воспользуйтесь методом:
Версии 6.0.0-6.8.1
- context - applicationContext
- advertising - Согласился ли пользователь на отправку ему рекламы,
- status - Было ли принято соглашение пользователем из кастомного диалога, или оно было принято автоматически, т.к. пользователь не из EU и не попадает под GDPR,
- appId - Идентификатор приложения в системе MRGS
Автоматическое принятие
Параметр status не был перенесен в новый функционал, так как запрещено принимать автоматически соглашения за пользователей без показа им соглашения и получения результата от них.
Для старого функционала: если status: false при вызове setUserHasAcceptedAgreement, MRGS SDK проигнорирует этот вызов.
Для нового функционала: параметр status отсутствует и любой вызова onAgreementAccepted будет расцениваться как принятие соглашения лично самим пользователем.
Пример🔗
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();
}
}
});
Дата создания: 2020-02-05