Migration guide🔗
This document contains instructions for updating the MRGS SDK, in case any changes need to be made to the code or project settings.
5.x.x → 6.0.0🔗
Version 6.0.0 contains backward incompatible changes due to partially redesigned API: removed @Deprecated functionality, changed function names, fixed typos, the public API changed package, and the private API moved to internal.
Java packages🔗
All class packages of MRGS SDK was changed from ru.mail.mrgservice to games.my.mrgs.
MRGSMyTracker🔗
MRGSMyTracker was moved to his own module and no more provides by MRGService module. A new way to add MRGSMyTracker to your project:
Add a dependency in build.gradle file:
Update SDK🔗
Main changes:
- Class
MRGSMyTrackermoved fromru.mail.mrgservicetogames.my.mrgs.my.tracker. - Class
MRGSExternalSDKParams.MyTrackerParamsrenamed and moved togames.my.mrgs.my.tracker.MRGSMyTrackerParams.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGSExternalSDKParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.MyTrackerParams;
import ru.mail.mrgservice.MRGSPlatform;
import ru.mail.mrgservice.MRGService;
import ru.mail.mrgservice.MRGServiceParams;
final MRGServiceParams serviceParams
= MRGServiceParams.init(<MRGS_APP_ID>, <CLIENT_SECRET>, MRGSPlatform.ANDROID);
serviceParams.setDebuggable(false);
// Setting External SDKS
final MRGSExternalSDKParams externalSDKParams = MRGSExternalSDKParams.newInstance();
// Setting MyTracker
final MyTrackerParams myTrackerParams = MyTrackerParams.init("MY_TRACKER_SDK_KEY");
myTrackerParams.setDebuggable(false);
externalSDKParams.myTrackerParams = myTrackerParams;
MRGService.service(context, serviceParams, externalSDKParams);
After
import java.util.ArrayList;
import java.util.List;
import games.my.mrgs.MRGSModuleParams;
import games.my.mrgs.MRGSPlatform;
import games.my.mrgs.MRGService;
import games.my.mrgs.MRGServiceParams;
import games.my.mrgs.my.tracker.MRGSMyTrackerParams;
final MRGServiceParams serviceParams
= MRGServiceParams.init(<MRGS_APP_ID>, <CLIENT_SECRET>, MRGSPlatform.ANDROID);
serviceParams.setDebuggable(false);
// Settings for MRGSModules
final List<MRGSModuleParams> moduleParams = new ArrayList<>();
// Setting MyTracker
final MRGSMyTrackerParams myTrackerParams = MRGSMyTrackerParams.init("MY_TRACKER_SDK_KEY");
myTrackerParams.setDebuggable(false);
moduleParams.add(myTrackerParams);
MRGService.service(context, serviceParams, moduleParams);
MRGService🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.x.x"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:core:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
ru.mail.mrgservice.MRGSExternalSDKParamsremoved. - Class
ru.mail.mrgservice.MRGSExternalSDKParams.AmazonAuthParamsrenamed and moved into module MRGSAuthenticationgames.my.mrgs.authentication.MRGSAmazonAuthParams. - Class
ru.mail.mrgservice.MRGSExternalSDKParams.AppsFlyerParamsrenamed and moved into module MRGSAnalyticsgames.my.mrgs.analytics.MRGSAppsFlyerParams. - Class
ru.mail.mrgservice.MRGSExternalSDKParams.FacebookParamsrenamed and moved into module MRGSAuthenticationgames.my.mrgs.authentication.MRGSFacebookParams. - Class
ru.mail.mrgservice.MRGSExternalSDKParams.GooglePlayGamesParamsrenamed and moved into module MRGSAuthenticationGoogleSignIngames.my.mrgs.authentication.google.signin.MRGSGooglePlayGamesParams. - Class
ru.mail.mrgservice.authentication.googlegames.MRGSGoogleGamesremoved Google authorization moved to separate modules MRGSAuthenticationGoogleSignIn and MRGSAuthenticationGoogleSignIn - Class
ru.mail.mrgservice.MRGSExternalSDKParams.GameCenterParamsrenamed and moved into module MRGSAuthenticationgames.my.mrgs.authentication.MRGSGameCenterParams. - Class
ru.mail.mrgservice.MRGSExternalSDKParams.MyGamesAuthParamsrenamed and moved into module MRGSAuthenticationgames.my.mrgs.authentication.MRGSMyGamesAuthParams. - Class
ru.mail.mrgservice.MRGSExternalSDKParams.MyTrackerParamsrenamed and moved into module MRGSMyTrackergames.my.mrgs.my.tracker.MRGSMyTrackerParams. - Class
ru.mail.mrgservice.MRGSExternalSDKParams.SamsungBillingParamsrenamed and moved into module MRGSBillinggames.my.mrgs.billing.MRGSSamsungBillingParams. -
Class
ru.mail.mrgservice.MRGSExternalSDKParams.VKontakteParamsrenamed and moved into module MRGSAuthenticationVKgames.my.mrgs.authentication.vk.MRGSVKontakteParams. -
enum
ru.mail.mrgservice.MRGServiceParams.BillingSubstitutionremoved. UseMRGSMyGamesBilling#useAsMainBilling()andMRGSVKPay#useAsMainBilling()instead. -
Method
MRGService#service(Context, MRGSServerDataDelegate, String, String)removed. UseMRGService#service(Context, String, String, MRGSServerDataDelegate)instead. - Method
MRGService#service(Context, MRGSServerDataDelegate, String, String, Bundle)removed. UseMRGService#service(Context, MRGServiceParams, List<MRGSModuleParams>, MRGSServerDataDelegate loadDelegate)instead. - Method
MRGService#service(Context, MRGSServerDataDelegate, String, String, Bundle, Bundle)removed. UseMRGService#service(Context, MRGServiceParams, List<MRGSModuleParams>, MRGSServerDataDelegate loadDelegate)instead. - Method
MRGService#service(Context, MRGServiceParams, MRGSExternalSDKParams)removed. UseMRGService#service(Context, MRGServiceParams, List<MRGSModuleParams>)instead. -
Method
MRGService#service(Context, MRGServiceParams, MRGSExternalSDKParams, MRGSServerDataDelegate loadDelegate)removed. UseMRGService#service(Context, MRGServiceParams, List<MRGSModuleParams>, MRGSServerDataDelegate loadDelegate)instead. -
Method
ru.mail.mrgservice.MRGServiceParams#shouldUseMyGamesBillingOnly()removed. -
Method
ru.mail.mrgservice.MRGServiceParams#setUseMyGamesBillingOnly(boolean)removed. UseMRGSMyGamesBilling#useAsMainBilling()andMRGSVKPay#useAsMainBilling()instead. -
Field
ru.mail.mrgservice.MRGSSocial#ODNOKLASSNIKIremoved. - Field
ru.mail.mrgservice.MRGSSocial#MAILRUremoved. - Field
ru.mail.mrgservice.MRGSSocial#VKONTAKTEremoved. - Field
ru.mail.mrgservice.MRGSSocial#VKIDremoved.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGSExternalSDKParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.AppsFlyerParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.MyTrackerParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.FacebookParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.GooglePlayGamesParams;
import ru.mail.mrgservice.MRGSPlatform;
import ru.mail.mrgservice.MRGService;
import ru.mail.mrgservice.MRGServiceParams;
// 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(false);
// Setting External SDKS
final MRGSExternalSDKParams externalSDKParams = MRGSExternalSDKParams.newInstance();
// Setting MyTracker
final MyTrackerParams myTrackerParams = MyTrackerParams.init("MY_TRACKER_SDK_KEY");
myTrackerParams.setDebuggable(false);
externalSDKParams.myTrackerParams = myTrackerParams;
// Setting AppsFlyer
final AppsFlyerParams appsFlyerParams = AppsFlyerParams.init("DEV_KEY");
appsFlyerParams.setDebuggable(false);
appsFlyerParams.setForwardMetricsEnabled(true);
externalSDKParams.appsFlyerParams = appsFlyerParams;
// Setting other external SDKS
externalSDKParams.facebookParams = FacebookParams.init("FACEBOOK_APP_ID");
externalSDKParams.googlePlayGamesParams = GooglePlayGamesParams.init("GOOGLE_CLIENT_ID");
MRGService.service(context, serviceParams, externalSDKParams);
After
import java.util.ArrayList;
import java.util.List;
import games.my.mrgs.MRGSModuleParams;
import games.my.mrgs.MRGSPlatform;
import games.my.mrgs.MRGService;
import games.my.mrgs.MRGServiceParams;
import games.my.mrgs.analytics.MRGSAppsFlyerParams;
import games.my.mrgs.authentication.MRGSFacebookParams;
import games.my.mrgs.authentication.MRGSGooglePlayGamesParams;
import games.my.mrgs.my.tracker.MRGSMyTrackerParams;
// 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(false);
// Settings for MRGS modules
final List<MRGSModuleParams> moduleParams = new ArrayList<>();
// Setting MyTracker
final MRGSMyTrackerParams myTrackerParams = MRGSMyTrackerParams.init("MY_TRACKER_SDK_KEY");
myTrackerParams.setDebuggable(false);
moduleParams.add(myTrackerParams);
// Setting AppsFlyer
final MRGSAppsFlyerParams appsFlyerParams = MRGSAppsFlyerParams.init("DEV_KEY");
appsFlyerParams.setDebuggable(false);
appsFlyerParams.setForwardMetricsEnabled(true);
moduleParams.add(appsFlyerParams);
// Setting other external SDKS
final MRGSFacebookParams facebookParams = MRGSFacebookParams.init("FACEBOOK_APP_ID");
moduleParams.add(facebookParams);
final MRGSGoogleSignInParams googleSignInParams = MRGSGoogleSignInParams.init("GOOGLE_CLIENT_ID");
moduleParams.add(googleSignInParams);
MRGService.service(context, serviceParams, moduleParams);
MRGSAdvertising🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.x.x"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:advertising:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSAdvertmoved fromru.mail.mrgservice.advertisingtogames.my.mrgs.advertising. - Class
MRGSAdvertisingFactorymoved fromru.mail.mrgservice.advertisingtogames.my.mrgs.advertising.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.advertising.MRGSAdvert;
import ru.mail.mrgservice.advertising.MRGSAdvertisingFactory;
final MRGSAdvert videoAdvert = MRGSAdvertisingFactory.createMRGSAdvertising(true);
videoAdvert.showContent();
After
import games.my.mrgs.advertising.MRGSAdvert;
import games.my.mrgs.advertising.MRGSAdvertisingFactory;
final MRGSAdvert videoAdvert = MRGSAdvertisingFactory.createMRGSAdvertising(true);
videoAdvert.showContent();
MRGSAnalytics🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:analytics:$mrgsVersion"
}
Update SDK🔗
Main changes:
-
Class
AppsFlyerParamsrenamed toMRGSAppsFlyerParamsand moved into MRGSAnalytics module. -
Class
MRGSAnalyticsmoved fromru.mail.mrgservice.analyticstogames.my.mrgs.analytics. - Class
MRGSAppsFlyermoved fromru.mail.mrgservice.analyticstogames.my.mrgs.analytics. - Class
MRGSAppsFlyerLinkGeneratormoved fromru.mail.mrgservice.analyticstogames.my.mrgs.analytics.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.analytics.MRGSAnalytics;
import ru.mail.mrgservice.analytics.MRGSAppsFlyer;
final MRGSAnalytics analytics = MRGSAnalytics.getInstance();
analytics.sendEvent("<Event>", null);
MRGSAppsFlyer.forceCustomerUserId("custom_user_id");
final MRGSAppsFlyer appsFlyer = analytics.getAppsFlyer();
appsFlyer.sendEvent("<Event>", "<Value>");
After
import games.my.mrgs.analytics.MRGSAnalytics;
import games.my.mrgs.analytics.MRGSAppsFlyer;
final MRGSAnalytics analytics = MRGSAnalytics.getInstance();
analytics.sendEvent("<Event>", null);
MRGSAppsFlyer.forceCustomerUserId("custom_user_id");
final MRGSAppsFlyer appsFlyer = analytics.getAppsFlyer();
appsFlyer.sendEvent("<Event>", "<Value>");
MRGSAuthentications🔗
MRGSVK was moved to his own module and no more provides by MRGSAuthentication module. A new way to add MRGSVK to your project:
Add dependency in build.gradle file:
MRGSGoogleGames has been renamed and moved to its own module and no longer comes with MRGSAuthentication. A new way to add MRGSGoogleSignIn to your project:
Add dependency in build.gradle file:
Copy MRGSAuthenticationVK file to the libs directory of your project. Add the necessary dependencies to the build file.gradle
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:authentication:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSVKmoved into his ownMRGSAuthenticationVKmodule. -
Class
VKontakteParamsrenamed toMRGSVKontakteParamsand moved into MRGSAuthenticationVK module. -
Class
MRGSAmazonmoved fromru.mail.mrgservice.authentication.amazontogames.my.mrgs.authentication.amazon. - Class
MRGSFacebookmoved fromru.mail.mrgservice.authentication.facebooktogames.my.mrgs.authentication.facebook. - Class
MRGSGoogleGamesmoved fromru.mail.mrgservice.authentication.googlegamestogames.my.mrgs.authentication.googlegames. -
Class
MRGSMyGamesmoved fromru.mail.mrgservice.authentication.mygamestogames.my.mrgs.authentication.mygames. -
Class
MRGSUsermoved fromru.mail.mrgservice.authenticationtogames.my.mrgs.authentication. -
Class
MRGSAuthInforemoved. UseMRGSAccessTokeninstead. -
Interface
MRGSAuthentication.ExternalLogoutCallbackremoved. UseMRGSAuthentication.OnExternalLogoutListenerinstead. - Interface
MRGSSocialmoved fromru.mail.mrgservice.authenticationtogames.my.mrgs.authentication. - Interface
MRGSScoremoved fromru.mail.mrgservice.authenticationtogames.my.mrgs.authentication. - Interface
MRGSLeaderBoardsmoved fromru.mail.mrgservice.authenticationtogames.my.mrgs.authentication. -
Interface
MRGSAchievementsmoved fromru.mail.mrgservice.authenticationtogames.my.mrgs.authentication. -
Enum
MRGSAuthenticationNetworkremoved. - Enum
MRGSAuthenticationNetwork.UNKNOWNremoved. - Enum
MRGSAuthenticationNetwork.AMAZONremoved. UseMRGSAmazon.SOCIAL_IDinstead. - Enum
MRGSAuthenticationNetwork.FACEBOOKremoved. UseMRGSFacebook.SOCIAL_IDinstead. - Enum
MRGSAuthenticationNetwork.GOOGLE_GAMESremoved. UseMRGSGoogleSignIn.SOCIAL_IDinstead. - Enum
MRGSAuthenticationNetwork.MY_GAMESremoved. UseMRGSMyGames.SOCIAL_IDinstead. -
Enum
MRGSAuthenticationNetwork.VKONTAKTEremoved. UseMRGSVK.SOCIAL_IDinstead. -
Method
MRGSAccessToken#getSocialId()now returnsStringinsteadMRGSAuthenticationNetwork. - Method
MRGSAuthentication#getSocialId()now returnsStringinsteadMRGSAuthenticationNetwork. - Method
MRGSAuthentication#loginWithScopes(List<String>, MRGSLoginCallback)removed. UseMRGSAuthentication#login(List<String>, MRGSLoginCallback)instead. - Method
MRGSAuthentication#getAuthInfo(BiConsumer<MRGSAuthInfo, MRGSError>)removed. UseMRGSAuthentication#getAccessToken(BiConsumer<MRGSAccessToken, MRGSError>)instead. - Method
MRGSAuthentication#getUserAvatar(MRGSUser, MRGSAvatarCallback, int, int)removed. UseMRGSAuthentication#getUserAvatar(MRGSUser, int, int, MRGSAvatarCallback)instead. - Method
MRGSAuthentication#setOnExternalLogoutCallback(ExternalLogoutCallback)removed. UseMRGSAuthentication#setOnExternalLogoutListener(OnExternalLogoutListener)instead. -
Method
MRGSAuthentication.OnExternalLogoutListener#onUserLogoutnow requiresStringinsteadMRGSAuthenticationNetwork. -
Method
MRGSAmazon#tryUpdateToken()removed. UseMRGSAmazon#getAccessToken(BiConsumer<MRGSAccessToken, MRGSError>)instead. -
Method
MRGSAchievement#achievementId()removed. UseMRGSAchievement#getAchievementId()instead. - Method
MRGSAchievement#name()removed. UseMRGSAchievement#getName()instead. - Method
MRGSAchievement#description()removed. UseMRGSAchievement#getDescription()instead. - Method
MRGSAchievement#state()removed. UseMRGSAchievement#getState()instead. - Method
MRGSAchievement#currentSteps()removed. UseMRGSAchievement#getCurrentSteps()instead. - Method
MRGSAchievement#totalSteps()removed. UseMRGSAchievement#getTotalSteps()instead. -
Method
MRGSAchievement#completionPercent()removed. UseMRGSAchievement#getCompletionPercent()instead. -
Method
MRGSCredentials#setUserId(String)removed. - Method
MRGSCredentials#setUser(MRGSUser)removed. - Method
MRGSCredentials#setAuthInfo(MRGSAuthInfo)removed. - Method
MRGSCredentials#getAuthInfo()removed. UseMRGSCredentials#getAccessToken()instead. -
Method
MRGSCredentials#getSocialId()now returnsStringinsteadMRGSAuthenticationNetwork. -
Method
MRGSLeaderboard#leaderboardId()removed. UseMRGSLeaderboard#getLeaderboardId()instead. -
Method
MRGSLeaderboard#name()removed. UseMRGSLeaderboard#getName()instead. -
Method
MRGSScore#leaderboardId()removed. UseMRGSScore#getLeaderboardId()instead. - Method
MRGSScore#rank()removed. UseMRGSScore#getRank()instead. - Method
MRGSScore#displayRank()removed. UseMRGSScore#getDisplayRank()instead. - Method
MRGSScore#rawScore()removed. UseMRGSScore#getRawScore()instead. - Method
MRGSScore#displayScore()removed. UseMRGSScore#getDisplayScore()instead. -
Method
MRGSScore#player()removed. UseMRGSScore#getPlayer()instead. -
Method
MRGSUser#userId()removed. UseMRGSUser#getUserId()instead. - Method
MRGSUser#nick()removed. UseMRGSUser#getNickName()instead. - Method
MRGSUser#firstName()removed. UseMRGSUser#getFirstName()instead. - Method
MRGSUser#lastName()removed. UseMRGSUser#getLastName()instead. - Method
MRGSUser#middleName()removed. UseMRGSUser#getMiddleName()instead. - Method
MRGSUser#fullName()removed. UseMRGSUser#getFullName()instead. - Method
MRGSUser#displayName()removed. UseMRGSUser#getDisplayName()instead. - Method
MRGSUser#gender()removed. UseMRGSUser#getGender()instead. - Method
MRGSUser#birthDate()removed. UseMRGSUser#getBirthDate()instead. - Method
MRGSUser#location()removed. UseMRGSUser#getLocation()instead. - Method
MRGSUser#socialId()removed. UseMRGSUser#getSocialId()instead. - Method
MRGSUser#getSocialId()now returnsStringinsteadMRGSAuthenticationNetwork.
The following example shows how your app might look before and after making these changes:
Before
import java.util.Arrays;
import ru.mail.mrgservice.MRGSError;
import ru.mail.mrgservice.authentication.MRGSAccessToken;
import ru.mail.mrgservice.authentication.MRGSAuthentication;
import ru.mail.mrgservice.authentication.MRGSAuthentication.OnExternalLogoutListener;
import ru.mail.mrgservice.authentication.MRGSAuthenticationNetwork;
import ru.mail.mrgservice.authentication.MRGSCredentials;
import ru.mail.mrgservice.authentication.MRGSLoginCallback;
import ru.mail.mrgservice.authentication.MRGSUser;
import ru.mail.mrgservice.utils.optional.BiConsumer;
final MRGSAuthentication authentication = AuthenticationImpl.getInstance();
// Set logout listener
authentication.setOnExternalLogoutListener(new OnExternalLogoutListener() {
@Override
public void onUserLogout(@NonNull MRGSAuthenticationNetwork network) {
// Handle result
}
});
// Common login
authentication.login(new MRGSLoginCallback() {
@Override
public void onSuccess(@NonNull MRGSCredentials credentials) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
// Handle error
}
});
// Login with scopes
authentication.login(Arrays.asList("scope_1", "scope_2"), new MRGSLoginCallback() {
@Override
public void onSuccess(@NonNull MRGSCredentials credentials) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
// Handle error
}
});
// Get current user's information
authentication.getCurrentUser(new MRGSAuthentication.UserCallback() {
@Override
public void onSuccess(@NonNull final MRGSUser user) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
}
});
// Get current user's authentication information
authentication.getAccessToken(new BiConsumer<MRGSAccessToken, MRGSError>() {
@Override
public void accept(@Nullable MRGSAccessToken accessToken, @Nullable MRGSError error) {
if (error != null) {
// Handle error
} else {
// Handle result
}
}
});
// Call logout
authentication.logout();
After
import java.util.Arrays;
import games.my.mrgs.MRGSError;
import games.my.mrgs.authentication.MRGSAccessToken;
import games.my.mrgs.authentication.MRGSAuthentication;
import games.my.mrgs.authentication.MRGSAuthentication.OnExternalLogoutListener;
import games.my.mrgs.authentication.MRGSAuthenticationNetwork;
import games.my.mrgs.authentication.MRGSCredentials;
import games.my.mrgs.authentication.MRGSLoginCallback;
import games.my.mrgs.authentication.MRGSUser;
import games.my.mrgs.utils.optional.BiConsumer;
final MRGSAuthentication authentication = AuthenticationImpl.getInstance();
// Set logout listener
authentication.setOnExternalLogoutListener(new OnExternalLogoutListener() {
@Override
public void onUserLogout(@NonNull MRGSAuthenticationNetwork network) {
// Handle result
}
});
// Common login
authentication.login(new MRGSLoginCallback() {
@Override
public void onSuccess(@NonNull MRGSCredentials credentials) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
// Handle error
}
});
// Login with scopes
authentication.login(Arrays.asList("scope_1", "scope_2"), new MRGSLoginCallback() {
@Override
public void onSuccess(@NonNull MRGSCredentials credentials) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
// Handle error
}
});
// Get current user's information
authentication.getCurrentUser(new MRGSAuthentication.UserCallback() {
@Override
public void onSuccess(@NonNull final MRGSUser user) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
}
});
// Get current user's authentication information
authentication.getAccessToken(new BiConsumer<MRGSAccessToken, MRGSError>() {
@Override
public void accept(@Nullable MRGSAccessToken accessToken, @Nullable MRGSError error) {
if (error != null) {
// Handle error
} else {
// Handle result
}
}
});
// Call logout
authentication.logout();
MRGSBilling🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:billing:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSBillingmoved fromru.mail.mrgservice.billingtogames.my.mrgs.billing. - Class
MRGSBillingProductmoved fromru.mail.mrgservice.billingtogames.my.mrgs.billing. - Class
MRGSBillingEntitiesmoved fromru.mail.mrgservice.billingtogames.my.mrgs.billing. -
Class
MRGSMyGamesBillingmoved fromru.mail.mrgservice.billingtogames.my.mrgs.billing. -
Interface
MRGSBillingDelegatemoved fromru.mail.mrgservice.billingtogames.my.mrgs.billing. -
Field
MRGSBilling.BILLING_VKPAYremoved. UseMRGSVKPay.BILLING_VKPAYinstead.
The following example shows how your app might look before and after making these changes:
Before
import java.util.Arrays;
import java.util.List;
import ru.mail.mrgservice.billing.MRGSBilling;
import ru.mail.mrgservice.billing.MRGSBillingDelegate;
import ru.mail.mrgservice.billing.MRGSBillingEntities.MRGSBankProductsRequest;
import ru.mail.mrgservice.billing.MRGSBillingEntities.MRGSBankPurchaseRequest;
import ru.mail.mrgservice.billing.MRGSBillingProduct;
final MRGSBilling billing = MRGSBilling.getInstance();
final MRGSBillingDelegate listener = new MRGSBillingDelegate() {
...
};
billing.setDelegate(listener);
// Request Products
final List<String> consumable = Arrays.asList(
"games.my.mrgs.purchase1",
"games.my.mrgs.purchase2",
"android.test.purchased");
final List<String> nonConsumable = Arrays.asList("games.my.mrgs.mrgservisetest.noncons");
final List<String> subscriptions = Arrays.asList(
"games.my.mrgs.subs1",
"games.my.mrgs.subs2",
"games.my.mrgs.subs3");
final MRGSBankProductsRequest productRequest = new MRGSBankProductsRequest();
productRequest.add(consumable, MRGSBillingProduct.CONS);
productRequest.add(nonConsumable, MRGSBillingProduct.NONCONS);
productRequest.add(subscriptions, MRGSBillingProduct.SUBS);
// The result of request will be sent to one of
// MRGSBillingDelegate#onReceiveProductsResponse(MRGSBankProductsResponse)
// or to MRGSBillingDelegate#onReceiveProductsError(MRGSBankProductsResponse)
billing.requestProductsInfo(productRequest);
// Buy product
final String sku = "games.my.mrgs.purchase1";
final String devPayload = "{\"item\": 123,\"store\": 456}";
final MRGSBankPurchaseRequest purchaseRequest = new MRGSBankPurchaseRequest(sku, devPayload);
// The result of request will be sent to one of
// MRGSBillingDelegate#onReceiveSuccessfulPurchase(MRGSBankPurchaseResult),
// MRGSBillingDelegate#onReceiveFailedPurchase(MRGSBankPurchaseResult),
// MRGSBillingDelegate#onReceivePendingPurchase(MRGSBankPurchaseResult),
// or MRGSBillingDelegate#onReceiveCancelledPurchase(MRGSBankPurchaseResult).
billing.buyItem(purchaseRequest);
After
import java.util.Arrays;
import java.util.List;
import games.my.mrgs.billing.MRGSBilling;
import games.my.mrgs.billing.MRGSBillingDelegate;
import games.my.mrgs.billing.MRGSBillingEntities.MRGSBankProductsRequest;
import games.my.mrgs.billing.MRGSBillingEntities.MRGSBankPurchaseRequest;
import games.my.mrgs.billing.MRGSBillingProduct;
final MRGSBilling billing = MRGSBilling.getInstance();
final MRGSBillingDelegate listener = new MRGSBillingDelegate() {
...
};
billing.setDelegate(listener);
// Request Products
final List<String> consumable = Arrays.asList(
"games.my.mrgs.purchase1",
"games.my.mrgs.purchase2",
"android.test.purchased");
final List<String> nonConsumable = Arrays.asList("games.my.mrgs.mrgservisetest.noncons");
final List<String> subscriptions = Arrays.asList(
"games.my.mrgs.subs1",
"games.my.mrgs.subs2",
"games.my.mrgs.subs3");
final MRGSBankProductsRequest productRequest = new MRGSBankProductsRequest();
productRequest.add(consumable, MRGSBillingProduct.CONS);
productRequest.add(nonConsumable, MRGSBillingProduct.NONCONS);
productRequest.add(subscriptions, MRGSBillingProduct.SUBS);
// The result of request will be sent to one of
// MRGSBillingDelegate#onReceiveProductsResponse(MRGSBankProductsResponse)
// or to MRGSBillingDelegate#onReceiveProductsError(MRGSBankProductsResponse)
billing.requestProductsInfo(productRequest);
// Buy product
final String sku = "games.my.mrgs.purchase1";
final String devPayload = "{\"item\": 123,\"store\": 456}";
final MRGSBankPurchaseRequest purchaseRequest = new MRGSBankPurchaseRequest(sku, devPayload);
// The result of request will be sent to one of
// MRGSBillingDelegate#onReceiveSuccessfulPurchase(MRGSBankPurchaseResult),
// MRGSBillingDelegate#onReceiveFailedPurchase(MRGSBankPurchaseResult),
// MRGSBillingDelegate#onReceivePendingPurchase(MRGSBankPurchaseResult),
// or MRGSBillingDelegate#onReceiveCancelledPurchase(MRGSBankPurchaseResult).
billing.buyItem(purchaseRequest);
MRGSFirebase🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:firebase:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSFirebaseAnalyticsmoved fromru.mail.mrgservice.firebasetogames.my.mrgs.firebase.
The following example shows how your app might look before and after making these changes:
Before
import java.util.Map;
import java.util.TreeMap;
import ru.mail.mrgservice.firebase.MRGSFirebaseAnalytics;
final Map<String, Object> params = new TreeMap<>();
params.put("someInfoKey", "someImportantInfo");
MRGSFirebaseAnalytics.getInstance().sendEvent("event_name", params);
After
import java.util.Map;
import java.util.TreeMap;
import games.my.mrgs.firebase.MRGSFirebaseAnalytics;
final Map<String, Object> params = new TreeMap<>();
params.put("someInfoKey", "someImportantInfo");
MRGSFirebaseAnalytics.getInstance().sendEvent("event_name", params);
MRGSGDPR🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:gdpr:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSCCPAmoved fromru.mail.mrgservice.ccpatogames.my.mrgs.ccpa. - Class
MRGSCCPAmoved fromru.mail.mrgservice.coppatogames.my.mrgs.coppa. -
Class
MRGSGDPRmoved fromru.mail.mrgservice.gdprtogames.my.mrgs.gdpr. -
Interface
MRGSCOPPAParametersmoved fromru.mail.mrgservice.coppatogames.my.mrgs.coppa. - Interface
MRGSCOPPAShowResultmoved fromru.mail.mrgservice.coppatogames.my.mrgs.coppa.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.gdpr.MRGSGDPR;
final MRGSGDPR gdpr = MRGSGDPR.getInstance();
gdpr.setDelegate(this);
gdpr.onlyEU(true);
gdpr.setBackgroundColor(255, 0, 0);
gdpr.withAdvertising(true);
gdpr.setLocalizationLanguage("en");
After
import games.my.mrgs.gdpr.MRGSGDPR;
final MRGSGDPR gdpr = MRGSGDPR.getInstance();
gdpr.setDelegate(this);
gdpr.onlyEU(true);
gdpr.setBackgroundColor(255, 0, 0);
gdpr.withAdvertising(true);
gdpr.setLocalizationLanguage("en");
MRGSNotifications🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:notifications:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSNotificationCentermoved fromru.mail.mrgservicetogames.my.mrgs.notifications. - Class
MRGSNotificationChannelmoved fromru.mail.mrgservicetogames.my.mrgs.notifications. - Class
MRGSNotificationChannelGroupmoved fromru.mail.mrgservicetogames.my.mrgs.notifications. - Class
MRGSPushNotificationmoved fromru.mail.mrgservicetogames.my.mrgs.notifications. - Class
MRGSPushNotificationHandlermoved fromru.mail.mrgservicetogames.my.mrgs.notifications.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGS;
import ru.mail.mrgservice.MRGSMap;
import ru.mail.mrgservice.MRGSNotificationCenter;
import ru.mail.mrgservice.MRGSNotificationChannel;
import ru.mail.mrgservice.MRGSNotificationChannelGroup;
import ru.mail.mrgservice.MRGSPushNotification;
import ru.mail.mrgservice.MRGSPushNotificationHandler.MRGSPushNotificationDelegate;
final MRGSNotificationCenter notificationCenter = MRGSNotificationCenter.getInstance();
// Create a listener for local and remote notification.
// You can create another listener to separate notifications or uses one and separate them
// with boolean isLocal
MRGSPushNotificationDelegate notifyDelegate = new MRGSPushNotificationDelegate() {
@Override
public void clickOnNotification(int idNotify, String title, String msg, MRGSMap developerPayload, boolean isLocal) {
//Handle result.
}
@Override
public void receivedNotification(int idNotify, String title, String msg, MRGSMap developerPayload, boolean isLocal) {
//Handle result.
}
};
notificationCenter.setLocalDelegate(notifyDelegate);
notificationCenter.setRemoteDelegate(notifyDelegate);
// Create notification channel group
final MRGSNotificationChannelGroup group = new MRGSNotificationChannelGroup("my_group_id", "My Group");
notificationCenter.createNotificationChannelGroup(context, group);
// Create notification channel
final MRGSNotificationChannel channel = new MRGSNotificationChannel("my_channel_id", "My Channel");
channel.setDescription("Description");
channel.setGroup("my_group_id");
channel.setSound("push_sound");
channel.enableLights(true);
notificationCenter.createNotificationChannel(context, channel);
// Create local push notification
final int time = MRGS.timeUnix() + 10;
MRGSPushNotification notification = MRGSPushNotification.create("Message number 1", 1, time);
notification.setGroupId(222);
notification.setGroupMessage("New resources arrived");
notification.setGroupTitle("Receive your resources");
notificationCenter.addLocalPush(notification);
After
import games.my.mrgs.MRGS;
import games.my.mrgs.MRGSMap;
import games.my.mrgs.notifications.MRGSNotificationCenter;
import games.my.mrgs.notifications.MRGSNotificationChannel;
import games.my.mrgs.notifications.MRGSNotificationChannelGroup;
import games.my.mrgs.notifications.MRGSPushNotification;
import games.my.mrgs.notifications.MRGSPushNotificationHandler.MRGSPushNotificationDelegate;
final MRGSNotificationCenter notificationCenter = MRGSNotificationCenter.getInstance();
// Create a listener for local and remote notification.
// You can create another listener to separate notifications or uses one and separate them
// with boolean isLocal
MRGSPushNotificationDelegate notifyDelegate = new MRGSPushNotificationDelegate() {
@Override
public void clickOnNotification(int idNotify, String title, String msg, MRGSMap developerPayload, boolean isLocal) {
//Handle result.
}
@Override
public void receivedNotification(int idNotify, String title, String msg, MRGSMap developerPayload, boolean isLocal) {
//Handle result.
}
};
notificationCenter.setLocalDelegate(notifyDelegate);
notificationCenter.setRemoteDelegate(notifyDelegate);
// Create notification channel group
final MRGSNotificationChannelGroup group = new MRGSNotificationChannelGroup("my_group_id", "My Group");
notificationCenter.createNotificationChannelGroup(context, group);
// Create notification channel
final MRGSNotificationChannel channel = new MRGSNotificationChannel("my_channel_id", "My Channel");
channel.setDescription("Description");
channel.setGroup("my_group_id");
channel.setSound("push_sound");
channel.enableLights(true);
notificationCenter.createNotificationChannel(context, channel);
// Create local push notification
final int time = MRGS.timeUnix() + 10;
MRGSPushNotification notification = MRGSPushNotification.create("Message number 1", 1, time);
notification.setGroupId(222);
notification.setGroupMessage("New resources arrived");
notification.setGroupTitle("Receive your resources");
notificationCenter.addLocalPush(notification);
MRGSRecommendations🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:recsys:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSRecommendationsmoved fromru.mail.mrgservice.recsystogames.my.mrgs.recsys. - Class
MRGSRecSysEventmoved fromru.mail.mrgservice.recsystogames.my.mrgs.recsys. - Class
MRGSRecSysEventsmoved fromru.mail.mrgservice.recsystogames.my.mrgs.recsys.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.recsys.MRGSRecSysEvent;
import ru.mail.mrgservice.recsys.MRGSRecSysEvents;
import ru.mail.mrgservice.recsys.MRGSRecommendations;
final MRGSRecommendations recSys = MRGSRecommendations.getInstance();
final MRGSRecSysEvent offerEvent = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_VIEW);
recSys.trackEvent(offerEvent);
final MRGSRecSysEvent offerClick = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_CLICK);
recSys.trackEvent(offerClick);
final MRGSRecSysEvent offerBuy = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_CLICK);
offerBuy.putParam("sku", "ru.mail.mrgstestpurchase");
offerBuy.putParam("gameOfferId", "offer123");
recSys.trackEvent(offerBuy);
After
import games.my.mrgs.recsys.MRGSRecSysEvent;
import games.my.mrgs.recsys.MRGSRecSysEvents;
import games.my.mrgs.recsys.MRGSRecommendations;
final MRGSRecommendations recSys = MRGSRecommendations.getInstance();
final MRGSRecSysEvent offerEvent = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_VIEW);
recSys.trackEvent(offerEvent);
final MRGSRecSysEvent offerClick = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_CLICK);
recSys.trackEvent(offerClick);
final MRGSRecSysEvent offerBuy = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_CLICK);
offerBuy.putParam("sku", "games.my.mrgstestpurchase");
offerBuy.putParam("gameOfferId", "offer123");
recSys.trackEvent(offerBuy);
MRGSShowcase🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:showcase:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSShowcasemoved fromru.mail.mrgservice.showcasetogames.my.mrgs.showcase.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.showcase.MRGSShowcase;
final MRGSShowcase instance = MRGSShowcase.getInstance();
instance.setShowListener(this);
instance.setNewContentListener(this);
instance.showContent();
After
import games.my.mrgs.showcase.MRGSShowcase;
final MRGSShowcase instance = MRGSShowcase.getInstance();
instance.setShowListener(this);
instance.setNewContentListener(this);
instance.showContent();
MRGSSupport🔗
Update SDK🔗
dependencies {
- def mrgsVersion = "5.0.0"
+ def mrgsVersion = "6.0.0"
implementation "games.my.mrgs:support:$mrgsVersion"
}
Update SDK🔗
Main changes:
- Class
MRGSMyComSupportrenamed toMRGSMyGamesSupportand moved fromru.mail.mrgservicetogames.my.mrgs.support. - Class
MRGSMyComSupportDialogremoved, useMRGSMyGamesSupportinstead. - Class
MyComSupportParamsremoved, useMRGSMyGamesSupportWidgetConfiginstead. -
Class
MRGSMyGamesSupportTicketmoved fromru.mail.mrgservice.supporttogames.my.mrgs.supportinstead. -
Interface
MRGSMyGamesSupportDialog.MyComListenerremoved, useMRGSMyGamesSupport.show(Activity, Consumer<MRGSError>)instead. -
Enum
ru.mail.mrgservice.MRGSMyComSupport.Credential.SocialNetwork.VKremoved. -
Method
MRGSMyComSupport#getMyComSupport()renamed toMRGSMyGamesSupport#getInstance(). -
Method
MRGSMyGamesSupportDialog.setCode(String)removed, useMRGSMyGamesSupportWidgetConfig.setAuthCode(String)instead. -
Method
MRGSMyGamesSupportDialog.setFull(bool)removed, useMRGSMyGamesSupportWidgetConfig.setFullscreen(bool)instead. -
Method
MRGSMyGamesSupportDialog.addExtraParam(String)removed, useMRGSMyGamesSupportWidgetConfig.setExtraParameters(String)instead. - Method
MRGSMyGamesSupportDialog.show()removed, useMRGSMyGamesSupport.show(Activity)instead. - Method
MRGSMyGamesSupportDialog.showFeedback()removed, useMRGSMyGamesSupport.show(Activity, MRGSMyGamesSupportWidgetConfig)instead. - Method
MRGSMyGamesSupportDialog.setLocalizationLanguage(String)removed, useWidgetConfig.setLanguage(String)instead. - Method
MRGSMyGamesSupportDialog.setCategory(String)removed, useWidgetConfig.setPage(WidgetPage)instead. -
Method
MRGSMyGamesSupportDialog.setListener(OnUiListener)removed, useMRGSMyGamesSupport.show(Activity, Consumer<MRGSError>)instead. -
Method
MRGSMyGamesSupportDialog.setErrorTitle(String). removed, useMRGSMyGamesSupportLocalization.setErrorDialogParams(String, String, String)instead. - Method
MRGSMyGamesSupportDialog.setErrorMessage(String)removed, useMRGSMyGamesSupportLocalization.setErrorDialogParams(String, String, String)instead. -
Method
MRGSMyGamesSupportDialog.setErrorButton(String)removed, useMRGSMyGamesSupportLocalization.setErrorDialogParams(String, String, String)instead. -
Method
MRGSMyGamesSupportDialog.setText(String)removed, because it is no longer used. - Method
MRGSMyGamesSupportDialog.setWritePermissionRationaleDialogParams(String, String, String, String)removed, useMRGSMyGamesSupportLocalization.setWritePermissionRationaleDialogParams(String, String, String, String)instead. -
Method
MRGSMyGamesSupportDialog.setWritePermissionSettingsDialogParams(String, String, String, String)removed, useMRGSMyGamesSupportLocalization.setWritePermissionSettingsDialogParams(String, String, String, String)instead. -
Method
MRGSMyGamesSupportDialog.setRequestSettingClassName(String)removed, because it is no longer used. - Method
MRGSMyGamesSupportDialog.setRequestRationalActivityClassName(String)removed, because it is no longer used. - Method
MRGSMyGamesSupportDialog.setRequestRationalDialogParams(String, String, int)removed, because it is no longer used. - Method
MRGSMyGamesSupportDialog.setRequestRationalDialogParams(String, String)removed, because it is no longer used. - Method
MRGSMyGamesSupportDialog.setRequestSettingsDialogParams(String, String, String)removed, because it is no longer used. - Method
MRGSMyGamesSupportDialog.setRequestSettingsDialogParams(String, String, String, int)removed, because it is no longer used. - Method
MRGSMyGamesSupportDialog.setRequestSettingsDialogParams(String, String, String, int, String, String)removed, because it is no longer used.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGSMyComSupportDialog;
final MRGSMyComSupportDialog dialog = new MRGSMyComSupportDialog(activity);
dialog.setCategory(<CATEGORY>);
dialog.setText(<TEXT>);
dialog.setListener(this);
dialog.show();
// Or show feedback
dialog.showFeedback();
After
import android.app.Activity;
import androidx.annotation.Nullable;
import games.my.mrgs.MRGSError;
import games.my.mrgs.support.MRGSMyGamesSupport;
import games.my.mrgs.support.MRGSMyGamesSupportWidgetConfig;
import games.my.mrgs.support.MRGSMyGamesSupportWidgetPage;
import games.my.mrgs.utils.optional.Consumer;
final MRGSMyGamesSupportWidgetConfig widgetConfig = MRGSMyGamesSupportWidgetConfig.newInstance();
widgetConfig.setExtraParameters(<Payload>);
MRGSMyGamesSupport.getInstance().show(activity, widgetConfig, new Consumer<MRGSError>() {
@Override
public void accept(@Nullable MRGSError error) {
// Support widget was closed.
// Check if there was any errors
if (error != null) {
// Handle the error
}
}
});
// Or show feedback
widgetConfig.setPage(MRGSMyGamesSupportWidgetPage.FEEDBACK);
MRGSMyGamesSupport.getInstance().show(activity, widgetConfig, callback);
4.x.x → 5.0.0🔗
Version 5.0.0 contains backward incompatible changes due to partially redesigned API: removed @Deprecated functionality, changed function names, fixed typos, the public API changed package, and the private API moved to internal.
Java 8🔗
Also, to work with the SDK, you need to set to the project Java not lower than the version 8 in your application module. Most likely you already use Java 8 or higher, just check your application settings.
apply plugin: 'com.android.application'
android {
compileSdkVersion ...
buildToolsVersion ...
defaultConfig { ... }
buildTypes { ... }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
}
Supported Maven repository🔗
Supported distributing the SDK through the Maven repository. To use it, add url to the root build.gradle (for com.android.tools.build:gradle:7.0.4 and below) or in settings.gradle (for com.android.tools.build:gradle:7.1.0 and higher)
MRGService🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGService', ext:'aar')
+ implementation "games.my.mrgs:core:$mrgsVersion"
}
Update code🔗
Main changes:
-
Redesigned methods of MRGService initialization. Now it is similar to methods used in MRGS Unity SDK. Learn more
-
Interface
MRGService.ActivityResultListenerremoved. - Interface
Printableremoved. - Interface
MRGSIntegrationCheck.MRGSIntegrationCheckListenerremoved. - Class
MRGSX509ExtendedTrustManagerremoved. - Class
MRGSX509TrustManagerremoved. - Class
MRGSAirLogremoved. -
Class
MRGSExtSDKremoved. -
Method
MRGService#instance()renamed toMRGService#getInstance(). - Method
MRGService#checkIntegration(MRGSIntegrationCheck.MRGSIntegrationCheckListener)removed. UsecheckIntegration(@Nullable Consumer<MRGSIntegrationCheckResult>)instead. - Method
MRGService#initialized()removed. UseMRGService#isInitialized()instead. - Method
MRGService#registerResultListener(ActivityResultListener)removed. - Method
MRGService#unregisterResultListener(ActivityResultListener)removed. - Method
MRGService#onActivityRes(Activity, int, int, Intent)removed. - Method
MRGService#registerTransferManagerDelegate(String, MRGSTransferManagerDelegate)removed. - Method
MRGService#unregisterTransferManagerDelegate(MRGSTransferManagerDelegate)removed. - Method
MRGService#getIsRunService()removed. - Method
MRGService#setAppContext(Context)removed. - Method
MRGService#onStart(Activity)removed. - Method
MRGService#onStop(Activity)removed. - Method
MRGService#getSharedPreferences(String)removed. UseMRGSSharedPreferences#newInstance(String)instead. - Method
MRGService#getSharedPreferences(Context, String)removed. UseMRGSSharedPreferences#newInstance(Context, String)instead. - Method
MRGService#sendHandleException(String)removed. UseMRGSCrashReports#sendHandleException(String)instead. -
Method
MRGService#sendHandleException(String, String)removed. UseMRGSCrashReports#sendHandleException(String, String)instead. -
Method
MRGSLog#log(String)removed. -
Method
MRGSMetrics.addPurchase(String, String, String)removed. UseMRGSMetrics.addPurchase(MRGSPurchaseEvent)instead. -
Method
MRGSUsers#instance()renamed toMRGSUsers#getInstance(). -
Method
MRGSUsers#getCurrentUser()now returns MRGSUser instead of MRGSMap. -
Method
MRGSDevice#instance()renamed toMRGSDevice#getInstance(). - Method
MRGSDevice#useOldUDIDMethod()removed. - Method
MRGSDevice#shouldUseOldUDIDMethod()removed. - Method
MRGSDevice#generateDeviceIdOld(Context)removed. - Method
MRGSDevice#getGoogleAccountPrimary()removed. - Method
MRGSDevice#getODIN1()removed. - Method
MRGSDevice#getIMEI()removed. - Method
MRGSDevice#openSystemSettingsOfApplication()removed.MRGSDevice#openApplicationDetailsSettings(Context). -
Method
MRGSDevice#getOldOpenUDID()renamed toMRGSDevice#getDeviceIdOrUUID(). -
Method
MRGSApplication#instance()renamed toMRGSApplication#getInstance(). -
Method
MRGSApplication#getApplicationBundleName()will not return any more null. -
Method
MRGSServerData#instance()renamed toMRGSServerData#getInstance().
The following example shows how your app might look before and after making these changes:
Before
import android.os.Bundle;
import ru.mail.mrgservice.MRGSBillingDelegateEx;
import ru.mail.mrgservice.MRGService;
// Setting MRGService
final Bundle serviceParams = new Bundle();
serviceParams.putBoolean("debug", false);
serviceParams.putString("billing", "google");
// Setting External SDKS
final Bundle externalSDKParams = new Bundle();
// Setting MyTracker
final Bundle tracker = new Bundle();
tracker.putString("appId", "MY_TRACKER_SDK_KEY");
tracker.putString("enable", "true");
tracker.putString("debug", "false");
externalSDKParams.putBundle("MyTracker", tracker);
// Setting AppsFlyer
Bundle appsFlyer = new Bundle();
appsFlyer.putString("app_key", "<APPS_FLYER_DEVKEY>");
appsFlyer.putString("debug", "false");
appsFlyer.putString("enable", "true");
externalSDKParams.putBundle("AppsFlyer", appsFlyer);
// Setting other external SDKS
externalSDKParams.putBundle("Facebook", facebook);
externalSDKParams.putBundle("GoogleGames", googleGames);
MRGService.service(context, null, MRGS_APP_ID, CLIENT_SECRET, serviceParams, externalSDKParams);
After
import ru.mail.mrgservice.MRGSExternalSDKParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.AppsFlyerParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.MyTrackerParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.FacebookParams;
import ru.mail.mrgservice.MRGSExternalSDKParams.GooglePlayGamesParams;
import ru.mail.mrgservice.MRGSPlatform;
import ru.mail.mrgservice.MRGService;
import ru.mail.mrgservice.MRGServiceParams;
// 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(false);
// Setting External SDKS
final MRGSExternalSDKParams externalSDKParams = MRGSExternalSDKParams.newInstance();
// Setting MyTracker
final MyTrackerParams myTrackerParams = MyTrackerParams.init("MY_TRACKER_SDK_KEY");
myTrackerParams.setDebuggable(false);
externalSDKParams.myTrackerParams = myTrackerParams;
// Setting AppsFlyer
final AppsFlyerParams appsFlyerParams = AppsFlyerParams.init("DEV_KEY");
appsFlyerParams.setDebuggable(false);
appsFlyerParams.setForwardMetricsEnabled(true);
externalSDKParams.appsFlyerParams = appsFlyerParams;
// Setting other external SDKS
externalSDKParams.facebookParams = FacebookParams.init("FACEBOOK_APP_ID");
externalSDKParams.googlePlayGamesParams = GooglePlayGamesParams.init("GOOGLE_CLIENT_ID");
MRGService.service(context, serviceParams, externalSDKParams);
MRGSAdvertising🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSAdvertising', ext:'aar')
+ implementation "games.my.mrgs:advertising:$mrgsVersion"
}
Update code🔗
Main changes:
- Class
MRGSAdvertisingConstsremoved. - Class
MRGSAdvertisingFactorymoved fromru.mail.mrgservicetoru.mail.mrgservice.advertising.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGSAdvertisingFactory;
import ru.mail.mrgservice.advertising.MRGSAdvert;
final MRGSAdvert videoAdvert = MRGSAdvertisingFactory.createMRGSAdvertising(true);
videoAdvert.showContent();
After
import ru.mail.mrgservice.advertising.MRGSAdvert;
import ru.mail.mrgservice.advertising.MRGSAdvertisingFactory;
final MRGSAdvert videoAdvert = MRGSAdvertisingFactory.createMRGSAdvertising(true);
videoAdvert.showContent();
MRGSAnalytics🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSAnalytics', ext:'aar')
+ implementation "games.my.mrgs:analytics:$mrgsVersion"
}
Update code🔗
Main changes:
- Class
MRGSGoogleConversionremoved. - Class
MRGSAnalyticsmoved fromru.mail.mrgservicetoru.mail.mrgservice.advertising. -
Class
MRGSAppsFlyermoved fromru.mail.mrgservicetoru.mail.mrgservice.advertising. -
Method
MRGSAnalytics#getGoogleConversion()removed. - Method
MRGSAppsFlyer#setCustomerUserId(String)removed. UseMRGSAppsFlyer#forceCustomerUserId(String)instead.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGSAnalytics;
import ru.mail.mrgservice.MRGSAppsFlyer;
final MRGSAnalytics analytics = MRGSAnalytics.getInstance();
analytics.sendEvent("<Event>", null);
MRGSAppsFlyer.forceCustomerUserId("custom_user_id");
final MRGSAppsFlyer appsFlyer = analytics.getAppsFlyer();
appsFlyer.sendEvent("<Event>", "<Value>");
After
import ru.mail.mrgservice.analytics.MRGSAnalytics;
import ru.mail.mrgservice.analytics.MRGSAppsFlyer;
final MRGSAnalytics analytics = MRGSAnalytics.getInstance();
analytics.sendEvent("<Event>", null);
MRGSAppsFlyer.forceCustomerUserId("custom_user_id");
final MRGSAppsFlyer appsFlyer = analytics.getAppsFlyer();
appsFlyer.sendEvent("<Event>", "<Value>");
MRGSAuthentications🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSAuthentication', ext:'aar')
+ implementation "games.my.mrgs:authentication:$mrgsVersion"
}
Update code🔗
Main changes:
- Class
MRGSAmazonmoved fromru.mail.mrgservice.amazontoru.mail.mrgservice.authentication.amazon. - Class
MRGSFacebookmoved fromru.mail.mrgservice.facebooktoru.mail.mrgservice.authentication.facebook.. - Class
MRGSGoogleGamesmoved fromru.mail.mrgservice.googlegamestoru.mail.mrgservice.authentication.googlegames. - Class
MRGSMyGamesmoved fromru.mail.mrgservice.mygamestoru.mail.mrgservice.authentication.mygames. - Class
MRGSVKmoved fromru.mail.mrgservice.vktoru.mail.mrgservice.authentication. - Class
MRGSUseris interface now, and also moved fromfrom ru.mail.mrgservicetoru.mail.mrgservice.authentication.amazon. - Class
FacebookUserremoved. - Class
MRGSCredentialsis interface now. -
Class
MRGSAuthInfomarked ad @Deprecated. UseMRGSAccessTokeninstead. -
Interface
MRGSAuthentication.ExternalLogoutCallbackmarked as @Deprecated. UseMRGSAuthentication.OnExternalLogoutListenerinstead. - Interface
MRGSSocialmoved fromru.mail.mrgservice.socialtoru.mail.mrgservice.authentication. - Interface
MRGSScoremoved fromru.mail.mrgservice.gamestoru.mail.mrgservice.authentication. - Interface
MRGSLeaderBoardsmoved fromru.mail.mrgservice.gamestoru.mail.mrgservice.authentication. - Interface
MRGSAchievementsmoved fromru.mail.mrgservice.gamestoru.mail.mrgservice.authentication. -
Interface
MRGSAuthInfoCallback.javaremoved. -
Enum
MRGSAuthenticationNetwork.MRGSAuthenticationNetworkAmazonrenamed toMRGSAuthenticationNetwork.AMAZON. - Enum
MRGSAuthenticationNetwork.MRGSAuthenticationNetworkFacebookrenamed toMRGSAuthenticationNetwork.FACEBOOK. - Enum
MRGSAuthenticationNetwork.MRGSAuthenticationNetworkGoogleGamesrenamed toMRGSAuthenticationNetwork.GOOGLE_GAMES. - Enum
MRGSAuthenticationNetwork.MRGSAuthenticationNetworkMyGamesrenamed toMRGSAuthenticationNetwork.MY_GAMES. - Enum
MRGSAuthenticationNetwork.MRGSAuthenticationNetworkVKontakterenamed toMRGSAuthenticationNetwork.VKONTAKTE. -
Enum
MRGSAuthenticationNetwork.Unknownrenamed toMRGSAuthenticationNetwork.UNKNOWN. -
Method
MRGSAuthentication#loginWithScopes(List<String>, MRGSLoginCallback)marked as @Deprecated. UseMRGSAuthentication#login(List<String>, MRGSLoginCallback)instead. - Method
MRGSAuthentication#getAuthInfo(BiConsumer<MRGSAuthInfo, MRGSError>)marked as @Deprecated. UseMRGSAuthentication#getAccessToken(BiConsumer<MRGSAuthInfo, MRGSError>)instead. - Method
MRGSAuthentication#getUserAvatar(MRGSUser, MRGSAvatarCallback, int, int)marked as @Deprecated. UseMRGSAuthentication#getUserAvatar(MRGSUser, int, int, MRGSAvatarCallback)instead. -
Method
MRGSAuthentication#setOnExternalLogoutCallback(ExternalLogoutCallback)marked as @Deprecated. UseMRGSAuthentication#setOnExternalLogoutListener(OnExternalLogoutListener)instead. -
Method
MRGSAmazon#tryUpdateToken()removed. UseMRGSAmazon#getAccessToken(BiConsumer<MRGSAccessToken, MRGSError>)instead. -
Method
MRGSAchievement#achievementId()marked as @Deprecated. UseMRGSAchievement#getAchievementId()instead. - Method
MRGSAchievement#name()marked as @Deprecated. UseMRGSAchievement#getName()instead. - Method
MRGSAchievement#description()marked as @Deprecated. UseMRGSAchievement#getDescription()instead. - Method
MRGSAchievement#state()marked as @Deprecated. UseMRGSAchievement#getState()instead. - Method
MRGSAchievement#currentSteps()marked as @Deprecated. UseMRGSAchievement#getCurrentSteps()instead. - Method
MRGSAchievement#totalSteps()marked as @Deprecated. UseMRGSAchievement#getTotalSteps()instead. -
Method
MRGSAchievement#completionPercent()marked as @Deprecated. UseMRGSAchievement#getCompletionPercent()instead. -
Method
MRGSCredentials#setUserId(String)removed. - Method
MRGSCredentials#setUser(MRGSUser)removed. - Method
MRGSCredentials#setAuthInfo(MRGSAuthInfo)removed. -
Method
MRGSCredentials#getAuthInfo()marked as @Deprecated. UseMRGSCredentials#getAccessToken()instead. -
Method
MRGSLeaderboard#leaderboardId()marked as @Deprecated. UseMRGSLeaderboard#getLeaderboardId()instead. -
Method
MRGSLeaderboard#name()marked as @Deprecated. UseMRGSLeaderboard#getName()instead. -
Method
MRGSScore#leaderboardId()marked as @Deprecated. UseMRGSScore#getLeaderboardId()instead. - Method
MRGSScore#rank()marked as @Deprecated. UseMRGSScore#getRank()instead. - Method
MRGSScore#displayRank()marked as @Deprecated. UseMRGSScore#getDisplayRank()instead. - Method
MRGSScore#rawScore()marked as @Deprecated. UseMRGSScore#getRawScore()instead. - Method
MRGSScore#displayScore()marked as @Deprecated. UseMRGSScore#getDisplayScore()instead. -
Method
MRGSScore#player()marked as @Deprecated. UseMRGSScore#getPlayer()instead. -
Method
MRGSUser#userId()marked as @Deprecated. UseMRGSUser#getUserId()instead. - Method
MRGSUser#nick()marked as @Deprecated. UseMRGSUser#getNickName()instead. - Method
MRGSUser#firstName()marked as @Deprecated. UseMRGSUser#getFirstName()instead. - Method
MRGSUser#lastName()marked as @Deprecated. UseMRGSUser#getLastName()instead. - Method
MRGSUser#middleName()marked as @Deprecated. UseMRGSUser#getMiddleName()instead. - Method
MRGSUser#fullName()marked as @Deprecated. UseMRGSUser#getFullName()instead. - Method
MRGSUser#displayName()marked as @Deprecated. UseMRGSUser#getDisplayName()instead. - Method
MRGSUser#gender()marked as @Deprecated. UseMRGSUser#getGender()instead. - Method
MRGSUser#birthDate()marked as @Deprecated. UseMRGSUser#getBirthDate()instead. - Method
MRGSUser#location()marked as @Deprecated. UseMRGSUser#getLocation()instead. - Method
MRGSUser#socialId()marked as @Deprecated. UseMRGSUser#getSocialId()instead.
The following example shows how your app might look before and after making these changes:
Before
import androidx.annotation.Nullable;
import java.util.Arrays;
import ru.mail.mrgservice.MRGSError;
import ru.mail.mrgservice.MRGSUser;
import ru.mail.mrgservice.authentication.MRGSAuthInfo;
import ru.mail.mrgservice.authentication.MRGSAuthentication;
import ru.mail.mrgservice.authentication.MRGSAuthenticationNetwork;
import ru.mail.mrgservice.authentication.MRGSCredentials;
import ru.mail.mrgservice.authentication.MRGSLoginCallback;
import ru.mail.mrgservice.utils.optional.BiConsumer;
final MRGSAuthentication authentication = AuthenticationImpl.getInstance();
// Set logout listener
authentication.setOnExternalLogoutCallback(new MRGSAuthentication.ExternalLogoutCallback() {
@Override
public void onUserLogout(MRGSAuthenticationNetwork network) {
// Handle result
}
});
// Common login
authentication.login(new MRGSLoginCallback() {
@Override
public void onSuccess(MRGSCredentials credentials) {
// Handle result
}
@Override
public void onError(MRGSError error) {
// Handle error
}
});
// Login with scopes
authentication.loginWithScopes(Arrays.asList("scope_1", "scope_2"), new MRGSLoginCallback() {
@Override
public void onSuccess(MRGSCredentials credentials) {
// Handle result
}
@Override
public void onError(MRGSError error) {
// Handle error
}
});
// Get current user's information
authentication.getCurrentUser(new MRGSAuthentication.UserCallback() {
@Override
public void onSuccess(final MRGSUser user) {
// Handle result
}
@Override
public void onError(MRGSError error) {
}
});
// Get current user's authentication information
authentication.getAuthInfo(new BiConsumer<MRGSAuthInfo, MRGSError>() {
@Override
public void accept(@Nullable MRGSAuthInfo authInfo, @Nullable MRGSError error) {
if (error != null) {
// Handle error
} else {
// Handle result
}
}
});
// Call logout
authentication.logout();
After
import java.util.Arrays;
import ru.mail.mrgservice.MRGSError;
import ru.mail.mrgservice.authentication.MRGSAccessToken;
import ru.mail.mrgservice.authentication.MRGSAuthentication;
import ru.mail.mrgservice.authentication.MRGSAuthentication.OnExternalLogoutListener;
import ru.mail.mrgservice.authentication.MRGSAuthenticationNetwork;
import ru.mail.mrgservice.authentication.MRGSCredentials;
import ru.mail.mrgservice.authentication.MRGSLoginCallback;
import ru.mail.mrgservice.authentication.MRGSUser;
import ru.mail.mrgservice.utils.optional.BiConsumer;
final MRGSAuthentication authentication = AuthenticationImpl.getInstance();
// Set logout listener
authentication.setOnExternalLogoutListener(new OnExternalLogoutListener() {
@Override
public void onUserLogout(@NonNull MRGSAuthenticationNetwork network) {
// Handle result
}
});
// Common login
authentication.login(new MRGSLoginCallback() {
@Override
public void onSuccess(@NonNull MRGSCredentials credentials) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
// Handle error
}
});
// Login with scopes
authentication.login(Arrays.asList("scope_1", "scope_2"), new MRGSLoginCallback() {
@Override
public void onSuccess(@NonNull MRGSCredentials credentials) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
// Handle error
}
});
// Get current user's information
authentication.getCurrentUser(new MRGSAuthentication.UserCallback() {
@Override
public void onSuccess(@NonNull final MRGSUser user) {
// Handle result
}
@Override
public void onError(@NonNull MRGSError error) {
}
});
// Get current user's authentication information
authentication.getAccessToken(new BiConsumer<MRGSAccessToken, MRGSError>() {
@Override
public void accept(@Nullable MRGSAccessToken accessToken, @Nullable MRGSError error) {
if (error != null) {
// Handle error
} else {
// Handle result
}
}
});
// Call logout
authentication.logout();
MRGSBilling🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSBilling', ext:'aar')
+ implementation "games.my.mrgs:billing:$mrgsVersion"
}
Update code🔗
Main changes:
- Class
MRGSBillingmoved fromru.mail.mrgservicetoru.mail.mrgservice.billing. - Class
MRGSPurchaseItemrenamed toMRGSBillingProductand moved fromru.mail.mrgservicetoru.mail.mrgservice.billing. - Class
MRGSBillingEntitiesmoved fromru.mail.mrgservicetoru.mail.mrgservice.billing. - Class
MRGSMyGamesBillingmoved fromru.mail.mrgservicetoru.mail.mrgservice.billing. - Interface
MRGSBillingDelegateremoved. -
Interface
MRGSBillingDelegateExrenamed toMRGSBillingDelegateand moved fromru.mail.mrgservicetoru.mail.mrgservice.billing. -
Method
MRGSBilling#instance()renamed toMRGSBilling#getInstance(). - Method
MRGSBilling#requestProductsInfoWithRequest(MRGSBankProductsRequest)renamed toMRGSBilling#requestProductsInfo(MRGSBankProductsRequest). - Method
MRGSBilling#buyItem(String sku, final String type)removed. UseMRGSBilling#buyItem(String sku)instead. - Method
MRGSBilling#buyItem(String sku, String type, String developerPayload)removed. UseMRGSBilling#buyItem(String sku, String developerPayload)instead. - Method
MRGSBilling#buyItem(final MRGSPurchaseItem purchase)removed. UseMRGSBilling#buyItem(MRGSBankPurchaseRequest)instead. - Method
MRGSBilling#setDelegate(MRGSBillingDelegateEx)removed. - Method
MRGSBilling#changeItem(String, String, String)removed. UseMRGSBilling#buyItem(MRGSBankPurchaseRequest)instead. - Method
MRGSBilling#changeItem(String, String, String, String)removed. UseMRGSBilling#buyItem(MRGSBankPurchaseRequest)instead. - Method
MRGSBilling#changeItem(MRGSPurchaseItem, MRGSPurchaseItem)removed. UseMRGSBilling#buyItem(MRGSBankPurchaseRequest)instead. - Method
MRGSBilling#getProductsInfo(ArrayList<String>)removed. UseMRGSBilling#requestProductsInfo(MRGSBankProductsRequest)instead. - Method
MRGSBilling#getProductsInfoWithTypes(ArrayList<Pair<String, String>>)removed. UseMRGSBilling#requestProductsInfo(MRGSBankProductsRequest)instead. - Method
MRGSBilling#getProductsInfoFromPurchaseInfo(ArrayList<MRGSBillingProduct>)removed. UseMRGSBilling#requestProductsInfo(MRGSBankProductsRequest)instead. - Method
MRGSBilling#notifyMRGSAboutConsume(MRGSPurchaseItem)changed onMRGSBilling#notifyMRGSAboutConsume(String sku, String transactionId) -
Method
MRGSBilling#closePayment(MRGSPurchaseItem)removed. UseMRGSBilling#notifyMRGSAboutConsume(String sku, String transactionId)instead. -
Method
MRGSBillingProduct#createWithPurchaseInfo(String)removed. - Method
MRGSBillingProduct#createWithPurchaseInfoWithType(String, String)removed. - Method
MRGSBillingProduct#fromJSON(String)removed. - Method
MRGSBillingProduct#setSku(String)removed. - Method
MRGSBillingProduct#setIntroductoryPeriod(String)removed. - Method
MRGSBillingProduct#setType(String)removed. - Method
MRGSBillingProduct#getDictionary()removed. - Method
MRGSBillingProduct#getPurchaseToken()removed. - Method
MRGSBillingProduct#setPurchaseToken(String token)removed. - Method
MRGSBillingProduct#getTransactionId()removed. UseMRGSBankTransaction#getTransactionIdentifier()instead. - Method
MRGSBillingProduct#getTransactionReceipt()removed. - Method
MRGSBillingProduct#getResultCode()removed. - Method
MRGSBillingProduct#getRawPurchaseInfo()removed. UseMRGSBankTransaction#getRawPurchaseResult()instead. - Method
MRGSBillingProduct#getDeveloperPayload()removed. UseMRGSBankPurchaseResult#getDeveloperPayload()instead. - Method
MRGSBillingProduct#setDeveloperPayload(String)removed. -
Method
MRGSBillingProduct#getUserId()removed. -
Method
MRGSBillingDelegate#onReceiveProductsResponcerenamed toMRGSBillingDelegate#onReceiveProductsResponse. - Method
MRGSBillingDelegate#onReceiveSuccessfullPurchaserenamed toMRGSBillingDelegate#onReceiveSuccessfulPurchase.
The following example shows how your app might look before and after making these changes:
Before
import java.util.Arrays;
import java.util.List;
import ru.mail.mrgservice.MRGSBilling;
import ru.mail.mrgservice.MRGSBillingDelegateEx;
import ru.mail.mrgservice.MRGSBillingEntities.MRGSBankProductsRequest;
import ru.mail.mrgservice.MRGSBillingEntities.MRGSBankPurchaseRequest;
import ru.mail.mrgservice.MRGSPurchaseItem;
final MRGSBilling billing = MRGSBilling.instance();
final MRGSBillingDelegateEx listener = new MRGSBillingDelegateEx() {
...
};
billing.setDelegateEx(listener);
// Request Products
final List<String> consumable = Arrays.asList(
"ru.mail.games.mrgservisetest.purchase1",
"ru.mail.games.mrgservisetest.purchase2",
"android.test.purchased");
final List<String> nonConsumable = Arrays.asList("ru.mail.games.mrgservisetest.noncons");
final List<String> subscriptions = Arrays.asList(
"ru.mail.mrgs.subs1",
"ru.mail.mrgs.subs2",
"ru.mail.mrgs.subs3");
final MRGSBankProductsRequest productRequest = new MRGSBankProductsRequest();
productRequest.add(consumable, MRGSPurchaseItem.CONS);
productRequest.add(nonConsumable, MRGSPurchaseItem.NONCONS);
productRequest.add(subscriptions, MRGSPurchaseItem.SUBS);
// The result of request will be sent to one of
// MRGSBillingDelegateEx#onReceiveProductsResponce(MRGSBankProductsResponse)
// or to MRGSBillingDelegateEx#onReceiveProductsError(MRGSBankProductsResponse)
billing.requestProductsInfoWithRequest(productRequest);
// Buy product
final String sku = "ru.mail.games.mrgservisetest.purchase1";
final String devPayload = "{\"item\": 123,\"store\": 456}";
final MRGSBankPurchaseRequest purchaseRequest = new MRGSBankPurchaseRequest(sku, devPayload);
// The result of request will be sent to one of
// MRGSBillingDelegateEx#onReceiveSuccessfullPurchase(MRGSBankPurchaseResult),
// MRGSBillingDelegateEx#onReceiveFailedPurchase(MRGSBankPurchaseResult),
// MRGSBillingDelegateEx#onReceivePendingPurchase(MRGSBankPurchaseResult),
// or MRGSBillingDelegateEx#onReceiveCancelledPurchase(MRGSBankPurchaseResult).
billing.buyItem(purchaseRequest);
After
import java.util.Arrays;
import java.util.List;
import ru.mail.mrgservice.billing.MRGSBilling;
import ru.mail.mrgservice.billing.MRGSBillingDelegate;
import ru.mail.mrgservice.billing.MRGSBillingEntities.MRGSBankProductsRequest;
import ru.mail.mrgservice.billing.MRGSBillingEntities.MRGSBankPurchaseRequest;
import ru.mail.mrgservice.billing.MRGSBillingProduct;
final MRGSBilling billing = MRGSBilling.getInstance();
final MRGSBillingDelegate listener = new MRGSBillingDelegate() {
...
};
billing.setDelegate(listener);
// Request Products
final List<String> consumable = Arrays.asList(
"ru.mail.games.mrgservisetest.purchase1",
"ru.mail.games.mrgservisetest.purchase2",
"android.test.purchased");
final List<String> nonConsumable = Arrays.asList("ru.mail.games.mrgservisetest.noncons");
final List<String> subscriptions = Arrays.asList(
"ru.mail.mrgs.subs1",
"ru.mail.mrgs.subs2",
"ru.mail.mrgs.subs3");
final MRGSBankProductsRequest productRequest = new MRGSBankProductsRequest();
productRequest.add(consumable, MRGSBillingProduct.CONS);
productRequest.add(nonConsumable, MRGSBillingProduct.NONCONS);
productRequest.add(subscriptions, MRGSBillingProduct.SUBS);
// The result of request will be sent to one of
// MRGSBillingDelegate#onReceiveProductsResponse(MRGSBankProductsResponse)
// or to MRGSBillingDelegate#onReceiveProductsError(MRGSBankProductsResponse)
billing.requestProductsInfo(productRequest);
// Buy product
final String sku = "ru.mail.games.mrgservisetest.purchase1";
final String devPayload = "{\"item\": 123,\"store\": 456}";
final MRGSBankPurchaseRequest purchaseRequest = new MRGSBankPurchaseRequest(sku, devPayload);
// The result of request will be sent to one of
// MRGSBillingDelegate#onReceiveSuccessfulPurchase(MRGSBankPurchaseResult),
// MRGSBillingDelegate#onReceiveFailedPurchase(MRGSBankPurchaseResult),
// MRGSBillingDelegate#onReceivePendingPurchase(MRGSBankPurchaseResult),
// or MRGSBillingDelegate#onReceiveCancelledPurchase(MRGSBankPurchaseResult).
billing.buyItem(purchaseRequest);
MRGSFirebase🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSFirebase', ext:'aar')
+ implementation "games.my.mrgs:firebase:$mrgsVersion"
}
Update code🔗
Main changes:
- Class
MRGSFirebaseAnalyticsmoved fromru.mail.mrgservicetoru.mail.mrgservice.firebase.
The following example shows how your app might look before and after making these changes:
Before
import java.util.Map;
import java.util.TreeMap;
import ru.mail.mrgservice.MRGSFirebaseAnalytics;
final Map<String, Object> params = new TreeMap<>();
params.put("someInfoKey", "someImportantInfo");
MRGSFirebaseAnalytics.getInstance().sendEvent("event_name", params);
After
import java.util.Map;
import java.util.TreeMap;
import ru.mail.mrgservice.firebase.MRGSFirebaseAnalytics;
final Map<String, Object> params = new TreeMap<>();
params.put("someInfoKey", "someImportantInfo");
MRGSFirebaseAnalytics.getInstance().sendEvent("event_name", params);
MRGSGameCenter🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSGameCenter', ext:'aar')
+ implementation "games.my.mrgs:gamecenter:$mrgsVersion"
}
Update code🔗
No changes.
MRGSGDPR🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSGDPR', ext:'aar')
+ implementation "games.my.mrgs:gdpr:$mrgsVersion"
}
Update code🔗
Main changes:
- Class
MRGSGDPRmoved fromru.mail.mrgservicetoru.mail.mrgservice.gdpr. - Class
MRGSGDPR.MRGSGDPRFactoryremoved. UseMRGSGDPR#getInstance()instead. -
Interface
MRGSCOPPA.OnResponseCallbackremoved from the public API, as it's intended for internal work. -
Method
MRGSGDPR#showAgreementAtActivity(Activity, String, String, int)removed. UseMRGSGDPR#showAgreementAtActivity(Activity, String, String)instead. - Method
MRGSGDPR#shouldShowGDPRForVersion(Activity, String, int, boolean, MRGSGDPRAsyncStatus)removed. UseMRGSGDPR#shouldShowGDPRForVersion(Activity, String, boolean, MRGSGDPRAsyncStatus)instead. - Method
MRGSGDPR#setUserHasAcceptedAgreementWithVersion(Context, int, boolean, boolean, String)removed. UseMRGSGDPR#setUserHasAcceptedAgreementWithVersion(Context, boolean, boolean, String)instead. - Method
MRGSCCPA#fetchCountyIfNeeded()removed from the public API, as it's intended for internal work. - Method
MRGSCOPPA#isUnderUk(Consumer<Boolean>)removed from the public API, as it's intended for internal work. - Method
MRGSCOPPA#shouldShowCoppa(Consumer<Boolean>)removed from the public API, as it's intended for internal work. - Method
MRGSCOPPA#shouldShowCoppa(Context, Consumer<Boolean>)removed from the public API, as it's intended for internal work. - Method
MRGSCOPPA#sendEmail(String, OnResponseCallback<MRGSSendEmailResult>)removed from the public API, as it's intended for internal work. - Method
MRGSCOPPA#checkEmails(List<String>, OnResponseCallback<MRGSCheckEmailResult>)removed from the public API, as it's intended for internal work.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGSGDPR;
final MRGSGDPR gdpr = MRGSGDPR.getInstance();
gdpr.setDelegate(this);
gdpr.onlyEU(true);
gdpr.setBackgroundColor(255, 0, 0);
gdpr.withAdvertising(true);
gdpr.setLocalizationLanguage("en");
After
import ru.mail.mrgservice.gdpr.MRGSGDPR;
final MRGSGDPR gdpr = MRGSGDPR.getInstance();
gdpr.setDelegate(this);
gdpr.onlyEU(true);
gdpr.setBackgroundColor(255, 0, 0);
gdpr.withAdvertising(true);
gdpr.setLocalizationLanguage("en");
MRGSMyTarget🔗
- Was removed.
MRGSNotifications🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSNotifications', ext:'aar')
+ implementation "games.my.mrgs:notifications:$mrgsVersion"
}
Update code🔗
Main changes:
- Class
MRGSGDPRmoved fromru.mail.mrgservicetoru.mail.mrgservice.gdpr. - Class
MRGSPushNotificationsremoved. UseMRGSNotificationCenterinstead. - Class
MRGSLocalPushServiceremoved. UseMRGSNotificationCenterinstead. - Class
MRGSLocalPushAutoStartReceiverremoved. - Class
MRGSPushNotification.MRGSPushNotificationChannelremoved. Useru.mail.mrgservice.MRGSNotificationChannelinstead. -
Class
MRGSPushNotification.MRGSPushNotificationChannelsGroupremoved. Useru.mail.mrgservice.MRGSNotificationChannelGroupinstead. -
Interface
MRGSPushNotificationHandler.MRGSPushNotificationDelegateremoved. -
Interface
MRGSPushNotificationHandler.MRGSPushNotificationDelegateExrenamed toMRGSPushNotificationHandler.MRGSPushNotificationDelegate. -
Interface
MRGSPushNotificationHandler.MRGSPushNotificationGroupDelegateremoved. -
Interface
MRGSPushNotificationHandler.MRGSPushNotificationExGroupDelegaterenamed toMRGSPushNotificationHandler.MRGSPushNotificationGroupDelegate. -
Method
MRGSNotificationCenterImpl.getInstance()removed. UseMRGSNotificationCenter.getInstance()instead. - Method
MRGSPushNotification.getCutomTextStrings()renamed toMRGSPushNotification.getCustomTextStrings(). - Method
MRGSPushNotificationHandler#setDelegate(MRGSPushNotificationDelegateEx)removed.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGS;
import ru.mail.mrgservice.MRGSMap;
import ru.mail.mrgservice.MRGSNotificationCenter;
import ru.mail.mrgservice.MRGSNotificationCenterImpl;
import ru.mail.mrgservice.MRGSPushNotification;
import ru.mail.mrgservice.MRGSPushNotification.MRGSPushNotificationChannel;
import ru.mail.mrgservice.MRGSPushNotification.MRGSPushNotificationChannelsGroup;
import ru.mail.mrgservice.MRGSPushNotificationHandler.MRGSPushNotificationExDelegate;
final MRGSNotificationCenter notificationCenter = MRGSNotificationCenterImpl.getInstance();
// Create a listener for local and remote notification.
// You can create another listener to separate notifications or uses one and separate them
// with boolean isLocal
MRGSPushNotificationExDelegate notifyDelegate = new MRGSPushNotificationExDelegate() {
@Override
public void clickOnNotification(int idNotify, String title, String msg, MRGSMap developerPayload, boolean isLocal) {
//Handle result.
}
@Override
public void receivedNotification(int idNotify, String title, String msg, MRGSMap developerPayload, boolean isLocal) {
//Handle result.
}
};
notificationCenter.setLocalDelegate(notifyDelegate);
notificationCenter.setRemoteDelegate(notifyDelegate);
// Create notification channel group
final MRGSPushNotificationChannelsGroup group = new MRGSPushNotificationChannelsGroup();
group.Id = "my_group_id";
group.Name = "My Group";
notificationCenter.createNotificationChannelGroup(context, group);
// Create notification channel
final MRGSPushNotificationChannel channel = new MRGSPushNotificationChannel();
channel.Id = "my_channel_id";
channel.Name= "My Channel";
channel.Description = "Description";
channel.Group = "my_group_id";
channel.Sound = "push_sound";
channel.ShowLights = true;
notificationCenter.createNotificationChannel(context, channel);
// Create local push notification
final int time = MRGS.timeUnix() + 10;
MRGSPushNotification notification = MRGSPushNotification.create("Message number 1", 1, time);
notification.setGroupId(222);
notification.setGroupMessage("New resources arrived");
notification.setGroupTitle("Receive your resources");
notificationCenter.addLocalPush(notification);`
After
import ru.mail.mrgservice.MRGS;
import ru.mail.mrgservice.MRGSMap;
import ru.mail.mrgservice.MRGSNotificationCenter;
import ru.mail.mrgservice.MRGSNotificationChannel;
import ru.mail.mrgservice.MRGSNotificationChannelGroup;
import ru.mail.mrgservice.MRGSPushNotification;
import ru.mail.mrgservice.MRGSPushNotificationHandler.MRGSPushNotificationDelegate;
final MRGSNotificationCenter notificationCenter = MRGSNotificationCenter.getInstance();
// Create a listener for local and remote notification.
// You can create another listener to separate notifications or uses one and separate them
// with boolean isLocal
MRGSPushNotificationDelegate notifyDelegate = new MRGSPushNotificationDelegate() {
@Override
public void clickOnNotification(int idNotify, String title, String msg, MRGSMap developerPayload, boolean isLocal) {
//Handle result.
}
@Override
public void receivedNotification(int idNotify, String title, String msg, MRGSMap developerPayload, boolean isLocal) {
//Handle result.
}
};
notificationCenter.setLocalDelegate(notifyDelegate);
notificationCenter.setRemoteDelegate(notifyDelegate);
// Create notification channel group
final MRGSNotificationChannelGroup group = new MRGSNotificationChannelGroup("my_group_id", "My Group");
notificationCenter.createNotificationChannelGroup(context, group);
// Create notification channel
final MRGSNotificationChannel channel = new MRGSNotificationChannel("my_channel_id", "My Channel");
channel.setDescription("Description");
channel.setGroup("my_group_id");
channel.setSound("push_sound");
channel.enableLights(true);
notificationCenter.createNotificationChannel(context, channel);
// Create local push notification
final int time = MRGS.timeUnix() + 10;
MRGSPushNotification notification = MRGSPushNotification.create("Message number 1", 1, time);
notification.setGroupId(222);
notification.setGroupMessage("New resources arrived");
notification.setGroupTitle("Receive your resources");
notificationCenter.addLocalPush(notification);
MRGSRecommendations🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSRecommendations', ext:'aar')
+ implementation "games.my.mrgs:recsys:$mrgsVersion"
}
Update code🔗
Main changes:
-
Class
MRGSRecommendationsmoved fromru.mail.mrgservicetoru.mail.mrgservice.recsys. -
Method
MRGSRecommendations#offerView(String, MRGSMap)removed. UseMRGSRecommendations#trackEvent(MRGSRecSysEvent)instead. - Method
MRGSRecommendations#offerClick(String, MRGSMap)removed. UseMRGSRecommendations#trackEvent(MRGSRecSysEvent)instead. - Method
MRGSRecommendations#offerBuy(String, MRGSMap)removed. UseMRGSRecommendations#trackEvent(MRGSRecSysEvent)instead.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGSMap;
import ru.mail.mrgservice.MRGSRecommendations;
final MRGSRecommendations recSys = MRGSRecommendations.getInstance();
recSys.offerView("testOffer1", null);
recSys.offerClick("testOffer1", null);
final MRGSMap buyParams = new MRGSMap();
buyParams.put("sku", "ru.mail.mrgstestpurchase");
buyParams.put("gameOfferId", "offer123");
recSys.offerBuy("testOffer1", buyParams);
After
import ru.mail.mrgservice.recsys.MRGSRecSysEvent;
import ru.mail.mrgservice.recsys.MRGSRecSysEvents;
import ru.mail.mrgservice.recsys.MRGSRecommendations;
final MRGSRecommendations recSys = MRGSRecommendations.getInstance();
final MRGSRecSysEvent offerEvent = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_VIEW);
recSys.trackEvent(offerEvent);
final MRGSRecSysEvent offerClick = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_CLICK);
recSys.trackEvent(offerClick);
final MRGSRecSysEvent offerBuy = new MRGSRecSysEvents.OfferActionEvent("testOffer1", MRGSRecSysEvent.ACTION_TYPE_CLICK);
offerBuy.putParam("sku", "ru.mail.mrgstestpurchase");
offerBuy.putParam("gameOfferId", "offer123");
recSys.trackEvent(offerBuy);
MRGSShowcase🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSShowcase', ext:'aar')
+ implementation "games.my.mrgs:showcase:$mrgsVersion"
}
Update code🔗
No changes.
MRGSSupport🔗
Update SDK🔗
Now the SDK can be downloaded via Maven repository, to do this, update your build.gradle file
dependencies {
def mrgsVersion = "5.0.0"
- implementation(name:'MRGSSupport', ext:'aar')
+ implementation "games.my.mrgs:support:$mrgsVersion"
}
Update code🔗
Main changes:
- Constructor
MRGSMyComSupportDialog(Activity, String)removed. UseMRGSMyComSupportDialog(Activity)instead. - Constructor
MRGSMyComSupportDialog(Activity, String, boolean)removed. UseMRGSMyComSupportDialog(Activity)instead.
The following example shows how your app might look before and after making these changes:
Before
import ru.mail.mrgservice.MRGSMyComSupportDialog;
final MRGSMyComSupportDialog dialog = new MRGSMyComSupportDialog(activity, "<SECRET>", true);
dialog.setCategory(<CATEGORY>);
dialog.setText(<TEXT>);
dialog.setListener(this);
dialog.show();
After
import ru.mail.mrgservice.MRGSMyComSupportDialog;
final MRGSMyComSupportDialog dialog = new MRGSMyComSupportDialog(activity);
dialog.setCategory(<CATEGORY>);
dialog.setText(<TEXT>);
dialog.setListener(this);
dialog.show();
4.1.x → 4.1.3🔗
In version 4.1.3, the user interface API was completely reworked. Now there is no need to register and then authorize the user. It is enough to call the setUserId method. However, to correctly calculate statistics on the MyTracker side, you must call trackRegistrationEvent and trackLoginEvent methods of the MRGSMyTracker class. Read the details in the documentation in the User Authorization section.
4.0.x → 4.1🔗
The main change - MRGService now depends on the androidx series libraries, instead of support-library.
Edit your build.gradle file to remove old dependencies, such as:
'com.google.android.gms:play-services-ads-identifier:16.0.0'
'com.android.support:support-v4:28.0.0'
'com.android.support:recyclerview-v7:28.0.0'
'com.android.support:appcompat-v7:28.0.0'
'com.android.support:support-vector-drawable:28.0.0'
'com.android.support:multidex:1.0.3'
and add new ones:
'androidx.appcompat:appcompat:1.1.0'
'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
'androidx.recyclerview:recyclerview:1.0.0'
'androidx.vectordrawable:vectordrawable:1.1.0'
'androidx.multidex:multidex:2.0.0'
Firebase (which also now depends on androidx) was updated in this version. Remove old dependencies:
Add new ones:
MyTracker was updated to version 1.5.12. Replace
with
3.8.x → 4.0🔗
The main change - now MRGService consists of a set of modules (aar library). The main module is MRGService.aar. The remaining modules can be added only if necessary.
If you already use all the functions of MRGS, the easiest way is to add all the aar files from the archive to your project.
Delete the MRGServiceDependencies.aar library if you have one.
Since MRGS is now distributed only as aar files, the first thing to do is to remove everything related to MRGS from your AndroidManifest.xml file:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.android.vending.BILLING"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<activity
android:name="ru.mail.mrgservice.MRGSGoogleBillingActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity
android:name="ru.mail.mrgservice.MRGSCafebazaarBillingActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
<activity
android:name="ru.mail.mrgservice.MRGSSendFeedbackActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"/>
<activity
android:name="ru.mail.mrgservice.MRGSGCMActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"/>
<activity
android:name="ru.mail.mrgservice.MRGSMyComSupportUtilActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
<activity android:name="ru.mail.mrgservice.gc.GCActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"/>
<activity android:name="ru.mail.mrgservicetest.PermissionRationaleActivity"/>
<activity android:name="ru.mail.mrgservicetest.ShowSettingActivity"/>
<activity android:name="ru.mail.mrgservice.advertising.MRGSAdvertisingActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/TranslucentTheme"
/>
<!--android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"-->
<activity android:name="ru.mail.mrgservice.advertising.MRGSAdvertisingSliderActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/NotTranslucentTheme"
/>
<!-- MyTarget activity -->
<activity android:name="com.my.target.common.MyTargetActivity" />
<!-- Firebase push notification -->
<service
android:name="ru.mail.mrgservice.MRGSFirebaseInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service
android:name="ru.mail.mrgservice.MRGSFCMIntentService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- END: Firebase push notification -->
<!-- tracking users -->
<receiver
android:name="ru.mail.mrgservice.MRGSBroadcastReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.analytics.CampaignTrackingService"/>
<service android:name="com.my.tracker.campaign.CampaignService"/>
<!-- Local Push -->
<receiver android:name="ru.mail.mrgservice.MRGSLocalPushBroadcastReceiver"/>
<receiver android:name="ru.mail.mrgservice.MRGSNotificationDeleteReceiver"/>
<!-- Samsung billing !-->
<activity
android:name="ru.mail.mrgservice.MRGSSamsungBillingActivity"
android:configChanges="keyboardHidden|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
<!-- Amazon In-App Purchases !-->
<receiver android:name = "com.amazon.device.iap.ResponseReceiver" >
<intent-filter>
<action android:name = "com.amazon.inapp.purchasing.NOTIFY"/>
</intent-filter>
</receiver>
MyTracker🔗
the MRGService.instance().getMyTracker() method is removed, instead use
Working with notifications🔗
To subscribe to events from server push notifications, you need to replace the call
MRGService.instance().initPushEx(notifyDelegate); or MRGService.instance().initPush(notifyDelegate);
to
Analytics🔗
- The MRGSGoogleAnalytics class was removed,
- The MRGSChartboost class was removed,
- The MRGSFlurry class was removed,
- The MRGSSendFeedbackActivity class was removed,
- The sendGASocEvent method of the MRGService class was removed,
-
The sendGATimings method of the MRGService class was removed.
-
Added the MRGSAnalytics class. Use this class to add custom events to third-party SDK.
-
The sendAFEvent method that was used for sending events to AppsFlyer was removed of the MRGService class, instead use
Note that the arguments of the sendEvent method also changed. The method used to accept two String parameters - name, value. Now the method accepts String name, and value is the java.util.Map type. Example of use:
MRGSMap params = new MRGSMap();
params.put("param1", button.getText().toString());
MRGSAnalytics.getInstance().getAppsFlyer().sendEvent("press_button", params);
You can also call the method
And then the event will be connected to all third-party analytical SDKs (currently only AppsFlyer, in the near future there will be Firebase support)
Billing🔗
The isBillingAvailable method of the MRGSBilling class is not static now. To call it, you need to call
The getBillingName method of the MRGSBilling class is not static now. To call it, you need to call
The sendPaymentInfo method was removed. Now you need to use the MRGSMetrics.addPurchase method. Note that the addPurchase method accepts 3 parameters! You can find detailed description of these parameters in the Installing the MRGS library for Android documentation.
Piligrim🔗
Removed the createMRGSAdvertising and getMRGSAdvertising methods from the MRGService class. They were moved to the MRGSAdvertisingFactory class.
GameCenter🔗
Delete the MRGServicePlayCenter.aar library and add the MRGSGameCenter.aar. Removed the getGameCenter method from the MRGService class, now you need to access the MRGSGameCenter class through the getInstance method.
3.6.5 → 3.7🔗
In this version, changes related to receiving Push notifications were made to the client-side.
- Delete the gcm.jar library and connect Google Play Services instead, if they have not already been connected (the source files are in the MRGS archive).
- Update the android-support-v4.jar (also located in the archive).
- Rename the
ru.mail.mrgservice.MRGSGCMBroadcastReceiverreceiver intocom.google.android.gms.gcm.GcmReceiverand add the following attribute:android:exported="true". - Add the
android:exported="false"attribute to the ru.mail.mrgservice.MRGSGCMIntentService service, also add the intent-filter:
- Add the service:
<service
android:name="ru.mail.mrgservice.MRGSInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
- Make sure the tag
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
is version 7571000. Ideally, if Google Play Services is connected with the source files and, accordingly, resources, then instead of manually changing the version number, you can simply leave @integer/google_play_services_version (as in the example above). 7. Permissions section remains unchanged.
As a result, AndroidManifest.xml should look like this:
...
<!-- push notification -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
<category android:name="ru.mail.mrgservicetest"/>
</intent-filter>
</receiver>
<service
android:name="ru.mail.mrgservice.MRGSGCMIntentService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service
android:name="ru.mail.mrgservice.MRGSInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<!-- END: push notification -->
...
To check if the AndroidManifest.xml is valid, use the mrgsmanifest utility located in the archive with MRGService.
Created: 2020-01-16