com.gmonks.crosspromotion
v3.2.1
Published
A CrossPromotion library for Unity, enabling seamless in-app promotion of other games and apps within your Unity projects.
Readme
GMonks CrossPromotion for Unity
A Unity package for seamless in-app cross-promotion of other games and apps within your Unity projects.
Features
- Display image and video banners, interstitials, and rewarded promos
- Supports Android platform
- Easy integration with Unity UI
- Automatic asset management and caching
Installation
Option 1: Using Unity Package Manager with Scoped Registry
- Open your Unity project.
- Go to Edit > Project Settings > Package Manager > Scoped Registries.
- Click + to add a new scoped registry and enter:
- Name: GMonks
- URL:
https://registry.npmjs.org - Scope(s):
com.gmonks
- Click Save.
- After adding the scoped registry, open the Package Manager.
- Locate
com.gmonks.crosspromotionin the list, select it, and choose the desired version to install. - Click Install.
Option 2: Modify manifest.json Directly
- Open your project folder and navigate to
Packages/manifest.json. - Add or update the
scopedRegistriessection:"scopedRegistries": [ { "name": "GMonks", "url": "https://registry.npmjs.org", "scopes": [ "com.gmonks" ] } ], - Add the package to the
dependenciessection:
Replace"com.gmonks.crosspromotion": "x.y.z"x.y.zwith the specific version you want to install, as listed in the package registry or release notes - Save the file and return to Unity. The package will be installed automatically.
Usage
Add the CrossPromotion prefab to your scene.
- If you are developing the package locally, the prefab is located at
Assets/Package/Runtime/Prefabs/CrossPromotion.prefab. - If installed via Unity Package Manager, find it in the
Packages/com.gmonks.crosspromotion/Runtime/Prefabs/folder in your project window.
- If you are developing the package locally, the prefab is located at
Create and configure a CrossPromotionSettings asset:
- In the Unity Editor, right-click in your Project window and select Create > GMonks > CrossPromotionSettings.
- Fill in the required fields such as API Key, Platform, Device Type, etc.
Assign the CrossPromotion prefab and settings in your scene:
- Drag the CrossPromotion prefab into your scene.
- In your script, reference the CrossPromotion component and assign the settings asset.
Initialize the CrossPromotion system in your code:
using GMonks.CrossPromotionLib; public class MyGameManager : MonoBehaviour { [SerializeField] private CrossPromotion crossPromotion; [SerializeField] private CrossPromotionSettings crossPromotionSettings; void Start() { if (crossPromotionSettings != null) { crossPromotion.Initialize(crossPromotionSettings); } } }Show or hide promos as needed:
// Show an image banner crossPromotion.ShowImageBanner(); // Show a video banner crossPromotion.ShowVideoBanner(/*Vector2 screen position or Transform reference*/); // Show a video interstitial crossPromotion.ShowVideoInterstitial(() => { // Callback after ad is closed or ad failed to show }); // Show a rewarded video crossPromotion.ShowRewardedVideo(result => { if (result) { // Reward the user } else { // ad closed before reward granted or failed to show } }); // Hide all promos crossPromotion.HideAllPromos();Listen for promo click events:
crossPromotion.onPromoClickedEvent += (appId, promoType, platform) => { // Handle promo click, e.g., analytics or custom navigation };
API Reference
CrossPromotion: Main entry point for showing/hiding promos and initialization.CrossPromotionSettings: Configuration for API key, platform, and device type.PromoType: Enum for promo types (banner, interstitial, rewarded, etc.).PromoPlatform: Enum for supported platforms.
Support
This package is maintained by GMonks Entertainment Private Limited.
For support, please contact the package maintainer directly.
© 2014-2025 GMonks Entertainment Pvt. Ltd. All Rights Reserved.
