Adding MRGS ONEstore🔗
MRGS ONEstore is an additional behavior for the existing MRGS module (MRGSBilling). Therefore, it will be enough to specify the ONESTORE platform when configuring and initializing the MRGS SDK to change the behavior. This page will highlight only the basic nuances of connecting and using MRGS ONEstore.
ONEStore is only available for the Android platform.
Supported Modules🔗
The following modules are currently supported:
- Payments via ONEStore (MRGSBilling Module).
Creating a project🔗
- To create a project in ONEstore follow documentation
- Then open the application on the website MRGS with the platform parameter "OneStore".
Setup ONEstore🔗
- Add the repository to your root build.gradle file
buildscript {
repositories {
...
maven { url 'https://repo.onestore.co.kr/repository/onestore-sdk-public' }
...
}
...
}
- When initializing the MRGService SDK, it is extremely important to specify the ONESTORE platform; the behavior of the billing module depends on it.
using MRGS;
public class MasterController : MonoBehaviour
{
void Awake()
{
var serviceParams = new MRGServiceParams(appId: APP_ID, appSecret: APP_SECRET);
// Setting MRGServiceParams
// ...
// Requires Platform for Android application
// Available platforms: Amazon, Android, Huawei, Samsung, FacebookCloud, RStore, Onestore
serviceParams.AndroidExtraOptions.Platform = MRGSPlatformAndroid.Onestore;
// Settings external SDK and initializing MRGS SDK
// ...
}
}
import games.my.mrgs.MRGSPlatform;
import games.my.mrgs.MRGService;
import games.my.mrgs.MRGServiceParams;
public class YourApplicationClass extends Application {
@Override
public void onCreate() {
super.onCreate();
// Setting MRGService
// Available MRGSPlatform: AMAZON, ANDROID, HUAWEI, SAMSUNG, FACEBOOK_CLOUD, RSTORE, ONESTORE
final MRGServiceParams serviceParams
= MRGServiceParams.init(<MRGS_APP_ID>, <CLIENT_SECRET>, MRGSPlatform.ONESTORE)
// Settings external SDK and initialization MRGS SDK
// ...
}
}
In-app payments🔗
-
To create payments in ONEstore, follow instructions.
-
Add a module MRGSBank (MRGSBilling)
Unity:
Adding to the project (general instructions)
Step 1. Add Sources
To add MRGS to a project via the Unity Package Manager (available from Unity 2018+) simply add a
scopedRegistriessection to thePackages/manifest.jsonfile by adding the following entry:{ "dependencies": { ... }, "scopedRegistries": [ { "name": "MRGS", "url": "https://mrgs-nexus.my.games/repository/mrgs-uninty-plugins/", "scopes": [ "games.my.mrgs" ] } ] }Alternatively, you can click
Edit -> Project Settings -> Package Manager -> '+' in scoped registry section, and fill in the fields according to the data above.Step 2. Add dependency
- Click
Window -> Package Manager -> select 'Packages: MyRegistries' from dropdown list, select packageMRGSBankfrom the list, then click "Install" - Import the module:
using MRGS;
- Download the latest version of the library. Unzip the archive.
- (For unitypackage integration) In Unity, click
Assets -> Import Package -> Custom Package, and select thegames.my.mrgs.bank.unitypackagepackage from the downloaded archive. - (For tgz integration) In Unity, click
Window -> Package Manager -> '+' -> Add package from tarball, and select thegames.my.mrgs.bank-<version> package. tgzfrom the downloaded archive. - Import the module:
using MRGS;
Android:
Copy the MRGSBilling.aar file to your project's libs directory. Add the required dependencies to the build.gradle file
1 2 3 4 5 6 7 8 9 10
```Java dependencies { ... implementation(name: 'MRGSBilling', ext:'aar') implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.android.billingclient:billing:6.0.1' implementation 'com.onestorecorp.sdk:sdk-iap:21.01.00' ... } ``` - Click
Making payments🔗
The payment mechanism in the SDK has not undergone any changes, so to work with the MRGSBank functionality, you can refer to instructions.
Created: 2024-01-15