Instructions for migration🔗
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🔗
MRGSAuthentication🔗
- The class
MRGSAuthenticationVKontaktemoved into its own module MRGSAuthenticationVK.
Adding the MRGSAuthenticationVK module to the project
Step 1: Add dependencies
Via Package collection
- In Xcode select File > Add Packages
- Select "+" > "Add Swift Package Collection"
- Insert URL:
https://mrgs-nexus.my.games/repository/ios-sdks/MRGSPackageCollection.json - Select module MRGSAuthenticationVK from "MRGS Package Collection".
- Or you can select "MRGS" package from "MRGS Package Collection" (contains all mrgs modules as products) and then select "MRGS/AuthenticationVK" product only.
Individual packages
- In Xcode select File > Add Packages
- In the search bar at the top right, paste the URL:
https://mrgs-gitea.my.games/mrgs/mrgsauthenticationvk-ios-sdk.git - Add a module to your project
- Or you can paste the url
https://mrgs-gitea.my.games/mrgs/ios-sdks.gitto include the "MRGS" package which contains all mrgs modules as products and then select only the product" MRGS/AuthenticationVK".
Step 2: Add support for ObjectiveC categories
- Set the
-ObjCflag in the "Other linker Flags" field in the project settings. - Import the module in code:
@import MRGServiceKit;or@import MRGSAuthenticationVK;or#import <MRGSAuthenticationVK/MRGSAuthenticationVK.h>
Step 1. Add Sources
In your podfile, add sources to the top of the file:
source 'https://github.com/CocoaPods/Specs.git' # For main repo
source 'https://mrgs-gitea.my.games/mrgs/cocoapods-specs.git' # For MRGS repo
Step 2: Add dependencies
Add the latest version of MRGSAuthenticationVK to target:
To add via subspecs:
To add via individual modules:
To add all mrgs modules:
Step 3: Install dependencies
- Run
pod install(orpod install --repo-updateif necessary) - Import the module in code:
@import MRGServiceKit;or@import MRGSAuthenticationVK;or#import <MRGSAuthenticationVK/MRGSAuthenticationVK.h>
Step 1: Add dependencies
Add the dependency to your Cartfile:
binary "https://mrgs-nexus.my.games/repository/ios-sdks/MRGSAuthenticationVK/MRGSAuthenticationVK.json" ~> 5.0.0
Step 2: Install dependencies
- Run
carthage update --use-xcframeworks - Add downloaded frameworks to your project (make sure "do not embed" option is enabled)
- Set the
-ObjCflag in the "Other linker Flags" field in the project settings. - Import the module in code:
@import MRGServiceKit;or@import MRGSAuthenticationVK;or#import <MRGSAuthenticationVK/MRGSAuthenticationVK.h>
- Download the latest version of the library. Unzip the archive.
-
Add
MRGSAuthenticationVK.xcframeworkfrom the downloaded archive to your project (Drag the libraries to the "Linked frameworks and Libraries" section) (Also contains MRGSAuthenticationVK.framework for compatibility - fat framework) -
Set the
-ObjCflag in the "Other linker Flags" field in the project settings. - Import the module in code:
@import MRGSAuthenticationVK;or#import <MRGSAuthenticationVK/MRGSAuthenticationVK.h> - Also, you can add the
MRGServiceKit.handmodule.modulemapfiles from the archive to your project, or specify the path to them in the project settings in theBuild Settings -> Header search pathssection. Now, instead of importing each of our frameworks separately, you can only import one header file:@import MRGServiceKit;
kMRGSAuthenticationVKontakteScopescopes have moved into their own MRGSAuthenticationVK module.-
MRGSAuthenticationNetworkVKontakteconstant moved to its own module MRGSAuthenticationVK. -
Enum
MRGSAuthenticationNetworkremoved, replaced bystring enum(string constants)MRGSAuthenticationNetworkcontaining the same set of social networks.
MRGService🔗
- MRGSMyTracker has been moved into its own MRGSMyTracker module and no longer comes with the MRGService module.
Adding the MRGSMyTracker module to the project
Step 1: Add dependencies
Via Package collection
- In Xcode select File > Add Packages
- Select "+" > "Add Swift Package Collection"
- Insert URL:
https://mrgs-nexus.my.games/repository/ios-sdks/MRGSPackageCollection.json - Select module MRGSMyTracker from "MRGS Package Collection".
- Or you can select "MRGS" package from "MRGS Package Collection" (contains all mrgs modules as products) and then select "MRGS/MyTracker" product only.
Individual packages
- In Xcode select File > Add Packages
- In the search bar at the top right, paste the URL:
https://mrgs-gitea.my.games/mrgs/mrgsmytracker-ios-sdk.git - Add a module to your project
- Or you can paste the url
https://mrgs-gitea.my.games/mrgs/ios-sdks.gitto include the "MRGS" package which contains all mrgs modules as products and then select only the product" MRGS/MyTracker".
Step 2: Add support for ObjectiveC categories
- Set the
-ObjCflag in the "Other linker Flags" field in the project settings. - Import the module in code:
@import MRGServiceKit;or@import MRGSMyTracker;or#import <MRGSMyTracker/MRGSMyTracker.h>
Step 1. Add Sources
In your podfile, add sources to the top of the file:
source 'https://github.com/CocoaPods/Specs.git' # For main repo
source 'https://mrgs-gitea.my.games/mrgs/cocoapods-specs.git' # For MRGS repo
Step 2: Add dependencies
Add the latest version of MRGSMyTracker to target:
To add via subspecs:
To add via individual modules:
To add all mrgs modules:
Step 3: Install dependencies
- Run
pod install(orpod install --repo-updateif necessary) - Import the module in code:
@import MRGServiceKit;or@import MRGSMyTracker;or#import <MRGSMyTracker/MRGSMyTracker.h>
Step 1: Add dependencies
Add the dependency to your Cartfile:
Step 2: Install dependencies
- Run
carthage update --use-xcframeworks - Add downloaded frameworks to your project (make sure "do not embed" option is enabled)
- Set the
-ObjCflag in the "Other linker Flags" field in the project settings. - Import the module in code:
@import MRGServiceKit;or@import MRGSMyTracker;or#import <MRGSMyTracker/MRGSMyTracker.h>
- Download the latest version of the library. Unzip the archive.
-
Add
MRGSMyTracker.xcframeworkfrom the downloaded archive to your project (Drag the libraries to the "Linked frameworks and Libraries" section) (Also contains MRGSMyTracker.framework for compatibility - fat framework) -
Set the
-ObjCflag in the "Other linker Flags" field in the project settings. - Import the module in code:
@import MRGSMyTracker;or#import <MRGSMyTracker/MRGSMyTracker.h> - Also, you can add the
MRGServiceKit.handmodule.modulemapfiles from the archive to your project, or specify the path to them in the project settings in theBuild Settings -> Header search pathssection. Now, instead of importing each of our frameworks separately, you can only import one header file:@import MRGServiceKit;
- The
MRGSMyTrackerParamsclass has moved into the MRGSMyTracker module. - Class
MRGSVKontakteParamsmoved to module MRGSAuthenticationVK. -
The
MRGSVKIdParamsclass has moved to the MRGSAuthenticationVKId module. -
Property
MRGSMyGamesParams#vkPlayModeremoved. UseMRGSMyGamesParams#customHost.
MRGSSupport🔗
- Enum entity
kMRGSMyGamesSupportCredentialSocialNetworkVkontakterenamed tokMRGSMyGamesSupportCredentialSocialNetworkInTouch.
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, reworked nullability notations, fixed method names to comply with naming conventions.
Support for Swift Package Manager/Cocoapods/Carthage🔗
Added support for popular dependency managers for iOS:
Swift Package Manager🔗
Step 1: Add dependencies
Via Package collection
- In Xcode select File > Add Packages
- Select "+" > "Add Swift Package Collection"
- Insert URL:
https://mrgs-nexus.my.games/repository/ios-sdks/MRGSPackageCollection.json - Select required modules from "MRGS Package Collection".
- Or you can select "MRGS" package from "MRGS Package Collection" (contains all mrgs modules as products) and then select only the required product module.
Individual packages
- In Xcode select File > Add Packages
- In the search bar in the upper right corner, paste the URL of the desired MRGS module in the format:
https://mrgs-gitea.my.games/mrgs/<MODULE>-ios-sdk.git(for example,https://mrgs-gitea.my.games/mrgs/mrgsbank-ios-sdk.git) - Add a module to your project
- Or you can paste the URL
https://mrgs-gitea.my.games/mrgs/ios-sdks.gitto include the "MRGS" package which contains all mrgs modules as products and then select only the required module product.
Step 2: Add support for ObjectiveC categories
- Set the
-ObjCflag in the "Other linker Flags" field in the project settings. - Import the module in code:
@import MRGServiceKit;or@import MRGS_MODULE;or#import <MRGS_MODULE/MRGS_MODULE.h>
Cocoapods🔗
Step 1. Add Sources
In your podfile, add sources to the top of the file:
source 'https://github.com/CocoaPods/Specs.git' # For main repo
source 'https://mrgs-gitea.my.games/mrgs/cocoapods-specs.git' # For MRGS repo
Step 2: Add dependencies
In target, add the latest versions of the required MRGS frameworks:
To add via subspecs:
To add via individual modules:
target 'MyProject' do
pod 'MRGSAuthentication', '~> 5.0.0'
pod 'MRGSBank', '~> 5.0.0'
pod 'MRGSGDPR', '~> 5.0.0'
end
To add all mrgs modules:
Step 3: Install dependencies
- Run
pod install(orpod install --repo-updateif necessary) - Import the module in code:
@import MRGServiceKit;or@import MRGS_MODULE;or#import <MRGS_MODULE/MRGS_MODULE.h>
Carthage🔗
Step 1: Add dependencies
Add the required dependencies to your Cartfile in the format:
For example:
binary "https://mrgs-nexus.my.games/repository/ios-sdks/MRGSShowcase/MRGSShowcase.json" ~> 5.0.0
binary "https://mrgs-nexus.my.games/repository/ios-sdks/MRGSGDPR/MRGSGDPR.json" ~> 5.0.0
binary "https://mrgs-nexus.my.games/repository/ios-sdks/MRGSAuthentication/MRGSAuthentication.json" ~> 5.0.0
Step 2: Install dependencies
- Run
carthage update --use-xcframeworks - Add downloaded frameworks to your project (make sure "do not embed" option is enabled)
- Set the
-ObjCflag in the "Other linker Flags" field in the project settings. - Import the module in code:
@import MRGServiceKit;or@import MRGS_MODULE;or#import <MRGS_MODULE/MRGS_MODULE.h>
MRGSAdvertising🔗
- Fixed a bug with the ability to create the MRGSAdvertising class through a constructor without parameters
- Fixed a bug with the ability to create the MRGSAdvertisingManager class
- Fixed
nullabilitynotations
Swift only:
- The sharedInstance method has been moved to the shared field:
MRGSAdvertisingManager.sharedInstance().method() -> MRGSAdvertisingManager.shared.method()
MRGSAnalytics🔗
- Fixed a bug with the ability to create the MRGSAppsFlyer class through a constructor without parameters
- Fixed a bug with the ability to create the MRGSAnalytics class
- Fixed
nullabilitynotations - Removed support for Flurry, Chartboost, GoogleConversion (classes
MRGSFlurry, MRGSFlurryParams, MRGSChartboostParams, MRGSGoogleConversionTrackingParams, fieldsflurry, flurryParams, chartboostParams, googleConversionParams)
Swift only:
- Moved sharedInstance method to shared field:
MRGSAnalytics.sharedInstance().method() -> MRGSAnalytics.shared.method()
MRGSAuthentication🔗
- Fixed a bug with the ability to create classes
MRGSAuthenticationAccessToken, MRGSAuthenticationAmazon, MRGSAuthenticationAppleGameCenter, MRGSAuthenticationCredential, MRGSAuthenticationFacebook, MRGSAuthenticationMyGames, MRGSAuthenticationSignInWithApple, MRGSAuthenticationDate, MRGSAuthenticationUser, MRGSAuthenticationVKontakte, MRGSAuthenticationAchievement, MRGSAuthenticationLeaderboard, MRGSAuthenticationLeaderboardScore - Fixed
nullabilitynotations - Changed error domains from
com.my.MRGSAuthentication.<network>togames.my.mrgs.authentication.<network> - Removed
deprecatedmethods MRGSAuthenticationDateclass fields becamereadonly
Swift only:
-
The sharedInstance method has been moved to the shared field:
.sharedInstance().method() -> .shared.method()for classes:MRGSAuthenticationAmazon MRGSAuthenticationAppleGameCenter MRGSAuthenticationFacebook MRGSAuthenticationMyGames MRGSAuthenticationSignInWithApple MRGSAuthenticationVKontakte -
Renamed methods:
MRGSAuthenticationAccessToken.hasScopes(_:) -> MRGSAuthenticationAccessToken.has(_:) resetAchievementsWithCompletionHandler -> resetAchievements(completionHandler:) getUsersWithIds -> getUsers(withIds:completionHandler:) (async users(withIds:)) sendPost(onWall:completionHandler:) -> sendPostOnWall(_:completionHandler:) (async sendPostOnWall(_:) sendPost(onWall:toUserWithId:completionHandler:) -> sendPostOnWall(_:toUserWithId:completionHandler:) (async sendPostOnWall(_:toUserWithId:) showPostOnWall(dialog:completionHandler:) -> showPostOnWallDialog(_:completionHandler:) (async showPostOnWallDialog(_:)) getFriendsIds(availableForInvite:) -> getFriendsIdsAvailableForInvite(_:) (async friendsIdsAvailableForInvite()) getFriendsIds(availableForGameRequest:) -> getFriendsIdsAvailableForGameRequest(_:) (async friendsIdsAvailableForGameRequest()) -
Renamed enum:
MRGSAuthenticationAchievementState -> MRGSAuthenticationAchievement.State
MRGSBank🔗
- Removed deprecated methods
- Fixed a bug with the ability to create classes
MRGSBank, MRGSBankProductPriceInformation, MRGSBankProduct, MRGSBankProductsResponse, MRGSBankTransaction, MRGSBankPurchaseResult, MRGSBankSubscriptionGroup, MRGSBankReceiptItem, MRGSBankReceiptProcessor, MRGSMyGamesBank - Fixed
nullabilitynotations MRGSBankProduct.skProductbecamenullableMRGSBankPurchaseResult.productIdentifierbecamenonnullMRGSBankPurchaseRequest.productIdentifierbecamereadonly, constructors without parameters were removed- Fields of the MRGSBankSubscriptionGroup class have become readonly, use the constructor
- Fields of the MRGSBankReceiptItem class have become readonly
- Renamed class
MRGSBankProductsResponse -> MRGSBankProductsResponse -
Changed delegate
MRGSBankDelegateEx:
Swift only:
-
The sharedInstance method has been moved to the shared field:
-
Renamed methods:
MRGSBank: showProductInStore(_:completionHandler:) isProductVisibleInStore(_:completionHandler:) setDefaultStorePromotionOrder(completionHandler:) MRGSBankProductsRequest: addProduct(identifier:withType:) -> add(productIdentifier:type:) addProducts(identifiers:withType:) -> add(productsIdentifiers:type:) MRGSBankSubscriptionGroup: createGroup(withName:andIdentifiers:) -> init(name:identifiers:) MRGSBankReceiptProcessor: getUserDiscountEligabilityForSubscriptions -> getUserDiscountEligability(for:completionHandler:) (async userDiscountEligability(for:)); getUserIntroductoryEligabilityForSubscriptions -> getUserIntroductoryEligability(for:completionHandler:)) (async userIntroductoryEligability(for:)) -
MRGSBankErrorCodebecameMRGSBankError: Error, so you can docatch(MRGSBankError.purchasesAreUnavailableForUser)
MRGService🔗
- Fixed a bug with the ability to create classes
MRGSApplication, MRGSDevice, MRGSExternalSDKParams, MRGSLogs, MRGSMyTrackerAttribution, MRGSMyTracker, MRGSReachability, MRGSServerData, MRGSTracker, MRGSUser, MRGSUsers - Fixed
nullabilityandreadonlynotations MRGServiceInitclass renamed toMRGService- Integration check now returns object of a new class
MRGSIntegrationCheckResult - Method
MRGServiceWithAppId:andSecret:andDelegatechanged tostartWithAppId:secret:delegate - Added more variations of SDK startup methods to avoid filling in unnecessary parameters
- All fields in external SDK settings are made
readonly, use constructors - Removed
MRGSLogS:method - All methods for sending metrics to
MRGSMetricshave been renamed to analogues without the prefixandbefore the parameter - Removed
deprecatedmethods - Field type of
MRGSTrackerEventclass changed frominttoNSInteger - Renamed method
MRGSDevice.erraseUDIDInfoFromDevice -> MRGSDevice.eraseUDIDInfoFromDevice
Swift only:
-
Changed access to singleton:
MRGSApplication.currentApplication().method() -> MRGSApplication.current.method() MRGSDevice.currentDevice().method() -> MRGSDevice.current.method() MRGServiceInit.sharedInstance().method() -> MRGService.shared.method() MRGSServerData.sharedInstance().method() -> MRGSServerData.shared.method() MRGSUsers.sharedInstance().method() -> MRGSUsers.shared.method() -
Renamed methods:
MRGSFirebase🔗
- Fixed a bug with the ability to create a class
MRGSFirebase - Fixed
nullabilitynotations
Swift only:
- The sharedInstance method has been moved to the shared field:
MRGSFirebase.sharedInstance().method() -> MRGSFirebase.shared.method()
MRGSGameCenter🔗
- Fixed a bug with the ability to create a class
MRGSGameCenter - Fixed
nullabilitynotations
Swift only:
- The sharedInstance method has been moved to the shared field:
MRGSGameCenter.sharedInstance().method() -> MRGSGameCenter.shared.method()
MRGSGDPR🔗
- Fixed a bug with the ability to create a classes
MRGSGDPR, MRGSCOPPAShowResult, MRGSCOPPA - Fixed
nullabilitynotations - Removed
deprecatedmethods
Swift only:
-
Changed access to singleton:
-
Renamed methods:
MRGSGDPR.enableAutomaticCOPPAFlow(forAppId:andSecret:) -> MRGSGDPR.enableAutomaticCOPPAFlow(appId:secret:) MRGSCOPPA.setup(forAppId:andSecret:) -> MRGSCOPPA.setup(appId:secret:) MRGSCOPPA.showCOPPAFlowIfNeeded(atViewController:) -> MRGSCOPPA.showFlowIfNeeded(at:) MRGSCOPPA.showCOPPAFlowIfNeeded(atViewController:withCompletion:) -> MRGSCOPPA.showFlowIfNeeded(at:completionHandler:) -
Changed enum:
MRGSMyTarget🔗
The module is completely removed
MRGSNotifications🔗
- Fixed a bug with the ability to create a classes
MRGSNotificationCenter, MRGSNotificationSettings - Fixed
nullabilityandreadonlynotations - Removed
deprecatedmethods and classes - Renamed
MRGSNotificationCategory.categoryWithIdentifier:andActions: -> MRGSNotificationCategory.categoryWithIdentifier:actions: - Renamed delegate method:
didClickedOnNotification -> didClickOnNotification, didClickedOnLocalNotification -> didClickLocalOnNotification, didClickedOnRemoteNotification -> didClickOnRemoteNotification - Renamed method
findPendingNotificationWithIdentifier:andCompletionHandler: -> findPendingNotificationWithIdentifier:completionHandler: - Renamed method
findDeliveredNotificationWithIdentifier:andCompletionHandler: -> findDeliveredNotificationWithIdentifier:completionHandler: - Added a new delegate method
shouldPresentNotification, which will allow you to show a notification when the application is running - Removed
MRGSNotificationCenterSupportedflag fromMRGServiceParams - Renamed flag
deferedMRGSNotificationCenterStart -> deferredMRGSNotificationCenterStartinMRGServiceParams
Swift only:
- Static methods for creating
MRGSNotificationchanged toinit(<params>) -
Changed access to singleton:
-
Renamed methods:
MRGSNotificationCenter.addNotification(_:) -> MRGSNotificationCenter.add(_:) MRGSNotificationCenter.requestNotificationsAuthorisationFromUser(withTypes:) -> requestNotificationsAuthorisation(with:) MRGSNotificationCenter.enableMRGSNotifications(_:) -> enable(_:) MRGSNotificationCenter.disableMRGSNotifications(_:) -> disable(_:) MRGSNotificationCenter.isMRGSNotificationsEnabled(_:) -> isEnabled(_:) -
Changed enum:
MRGSRecommendations🔗
- Fixed a bug with the ability to create a class
MRGSRecommendations - Fixed
nullabilitynotations - Removed
deprecatedmethods
Swift only:
- The sharedInstance method has been moved to the shared field:
MRGSRecommendations.sharedInstance().method() -> MRGSRecommendations.shared.method()
MRGSShowcase🔗
- Fixed a bug with the ability to create a class
MRGSShowcase - Fixed
nullabilitynotations
Swift only:
- The sharedInstance method has been moved to the shared field:
MRGSShowcase.sharedInstance().method() -> MRGSShowcase.shared.method()
MRGSSupport🔗
- Fixed a bug with the ability to create a class
MRGSMyComSupport - Fixed
nullabilitynotations - Instead of define errors MyComSupport added error enum
MRGSMyGamesSupportErrorCode
Swift only:
- The sharedInstance method has been moved to the shared field:
MRGSMyComSupport.sharedInstance().method() -> MRGSMyComSupport.shared.method() - Added
MRGSMyGamesSupportError : Error, so you can docatch(MRGSMyGamesSupportError.networkConnectionFailed) - Changed enum
MRGSMyGamesSupportCredentialSocialNetwork -> MRGSMyGamesSupportCredential.SocialNetwork
3.x.x -> 4.0.0🔗
- The
MRGSBank - sendPaymentInfoForProduct:transaction:method has moved to theMRGSMetricsclass, that is, it is enough to replace[[MRGSBank sharedInstance] sendPaymentInfo...with[MRGSMetrics sendPaymentInfo... - To access advertising objects, the
MRGSAdvertisingManagerclass is now used, the signatures remain the same. That is, you need to replace[MRGServiceInit sharedInstance]with[MRGSAdvertisingManager sharedInstance] - To access the API of external SDKs, the
MRGSAnalyticsclass is now used - Methods required for tracking notifications
didFinishLaunchingWithOptions: and startObservingWithLaunchingOptions:replaced with a single[MRGServiceInit application: didFinishLaunchingWithOptions:]; - Now, instead of one common bundle with resources, we have our own bundle with the appropriate name for each framework that has resources.
- We recommend adding the
MRServiceKit.hfile to the project, and replacing all occurrences of#import <MRGService/MRGService.h>with#import "MRServiceKit.h" or @import MRGServiceKit;
Also in this version there were some innovations and changes:
- We now have Documentation in English, to access change the language on the MRGS website, and go to "Documentation - iOS/MacOS Documentation"
- Improved slider view in cross-promo for devices with frameless screens
- Improved the logic of requests for the presence of ads
- Added Firebase support (payments, launches, users). Located in MRGSFirebase.framework.
- Updated 3rd party SDKs
- Added automatic linking of system libraries, now it's enough just to add our frameworks to the project, and it will immediately assemble, linking the libraries necessary for each module.
- Added module support (construct like
@import MRGServiceKit;) for each of our libraries, as well as a universal module that imports all frameworks added to the project. This approach can speed up the build of the application. - The structure of the framework has been changed, now there are no symlinks in it, which will make it easier for Windows and Unity users to work with them.
Created: 2020-01-16