### GP_Storage API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md API documentation for the GP_Storage class, including methods for setting and getting data, and associated actions for value retrieval and updates. ```APIDOC GP_Storage: Methods: SetStorage(SaveStorageType storage): void - Saves storage configuration. Get(string key, Action onGetValue): void - Retrieves a value from storage asynchronously. - Parameters: - key: The key of the data to retrieve. - onGetValue: A callback function executed upon successful retrieval, receiving the data as an object. Set(string key, object value, Action onSetValue = null): void - Sets a value in storage asynchronously. - Parameters: - key: The key for the data. - value: The data to store. - onSetValue: An optional callback function executed after the value is set, receiving the StorageField. GetGlobal(string key, Action onGetValue): void - Retrieves a global value from storage asynchronously. - Parameters: - key: The key of the global data to retrieve. - onGetValue: A callback function executed upon successful retrieval, receiving the data as an object. SetGlobal(string key, object value, Action onSetValue = null): void - Sets a global value in storage asynchronously. - Parameters: - key: The key for the global data. - value: The global data to store. - onSetValue: An optional callback function executed after the value is set, receiving the StorageField. Actions: OnGetValue: Returns StorageField when a value is retrieved. OnSetValue: Returns StorageField when a value is set. OnGetGlobalValue: Returns StorageField when a global value is retrieved. OnSetGlobalValue: Returns StorageField when a global value is set. ``` -------------------------------- ### GP_Files API and Data Structures Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md API documentation for GP_Files module, covering file upload, download, selection, and fetching, along with related data structures. ```APIDOC GP_Files: Upload(tags: string, onUpload: Action = null, onUploadError: Action = null) Parameters: tags: Comma-separated string of tags for the file. onUpload: Callback action executed on successful upload, receives FileData. onUploadError: Callback action executed on upload failure. Returns: void Description: Initiates an upload for a file with specified tags. UploadUrl(url: string, filename: string = "", tags: string = "", onUploadUrl: Action = null, onUploadUrlError: Action = null) Parameters: url: The URL to upload from. filename: The name of the file to be uploaded. tags: Comma-separated string of tags for the file. onUploadUrl: Callback action executed on successful upload, receives FileData. onUploadUrlError: Callback action executed on upload failure. Returns: void Description: Uploads a file from a given URL with specified filename and tags. UploadContent(content: string, filename: string, tags: string, onUploadContent: Action = null, onUploadContentError: Action = null) Parameters: content: The string content to upload. filename: The name for the file. tags: Comma-separated string of tags for the file. onUploadContent: Callback action executed on successful upload, receives FileData. onUploadContentError: Callback action executed on upload failure. Returns: void Description: Uploads string content as a file with a given filename and tags. LoadContent(url: string, onLoadContent: Action = null, onLoadContentError: Action = null) Parameters: url: The URL of the content to load. onLoadContent: Callback action executed on successful content load, receives the content as a string. onLoadContentError: Callback action executed on content load failure. Returns: void Description: Loads content from a specified URL. ChooseFile(type: string, onFileChoose: Action = null, onFileChooseError: Action = null) Parameters: type: The file type filter (e.g., 'image/*'). onFileChoose: Callback action executed when a file is chosen, receives the file path. onFileChooseError: Callback action executed if file selection fails. Returns: void Description: Opens a file chooser dialog for the user. Fetch(filter: FilesFetchFilter = null, onFetch: Action, bool> = null, onFetchError: Action = null) Parameters: filter: Optional filter criteria for fetching files. onFetch: Callback action executed on successful fetch, receives a list of FileData and a boolean indicating if more data is available. onFetchError: Callback action executed on fetch failure. Returns: void Description: Fetches a list of files based on the provided filter. FetchMore(filter: FilesFetchMoreFilter = null, onFetchMore: Action, bool> = null, onFetchMoreError: Action = null) Parameters: filter: Optional filter criteria for fetching more files. onFetchMore: Callback action executed on successful fetch, receives a list of FileData and a boolean indicating if more data is available. onFetchMoreError: Callback action executed on fetch failure. Returns: void Description: Fetches the next batch of files based on the provided filter. Actions: OnUploadSuccess(FileData fileData) OnUploadError() OnUploadUrlSuccess(FileData fileData) OnUploadUrlError() OnUploadContentSuccess(FileData fileData) OnUploadContentError() OnChooseFile(string filePath) OnChooseFileError() OnLoadContent(string content) OnLoadContentError() OnFetchSuccess(List files, bool hasMore) OnFetchError() OnFetchMoreSuccess(List files, bool hasMore) OnFetchMoreError() ``` ```csharp public class FileData { public string id; public int playerId; public string name; public string src; public float size; public string[] tags; } public class FilesFetchFilter { public string[] tags; public int playerId; public int limit = 10; public int offset = 0; } public class FilesFetchMoreFilter { public string[] tags; public int playerId; public int limit = 10; } ``` -------------------------------- ### GP_App Methods and Actions Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Manages application-specific features such as retrieving title, description, image URLs, and handling review requests or adding shortcuts. Includes callbacks for review results and shortcut actions. ```APIDOC GP_App: Title() Retrieves the application title. Returns: string Description() Retrieves the application description. Returns: string GetImage(Image image) Sets an Image object for the application. Parameters: image: The Image object to set. Returns: void ImageUrl() Retrieves the application's image URL. Returns: string Url() Retrieves the application's URL. Returns: string ReviewRequest(Action onReviewResult = null, Action onReviewClose = null) Requests a review from the user, with optional callbacks for the result and close event. Parameters: onReviewResult: Callback for the review result (int). onReviewClose: Callback for when the review dialog is closed (string). Returns: void IsAlreadyReviewed() Checks if the application has already been reviewed. Returns: bool CanReview() Checks if the application can request a review. Returns: bool AddShortcut(Action onAddShortcut = null) Attempts to add a shortcut for the application, with an optional callback for success. Parameters: onAddShortcut: Callback for the shortcut addition result (bool). Returns: void CanAddShortcut() Checks if the application can add a shortcut. Returns: bool Actions: OnReviewResult(int result) Callback triggered when a review action is completed. Parameters: result: The result of the review action. OnReviewClose(string message) Callback triggered when the review dialog is closed. Parameters: message: A message indicating why the dialog was closed. OnAddShortcut(bool success) Callback triggered after attempting to add a shortcut. Parameters: success: Indicates if the shortcut was added successfully. ``` -------------------------------- ### Configure and Load Unity Build Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/Demo/Assets/WebGLTemplates/GamePush/index.html Sets up the necessary JavaScript variables, configuration object, and event listeners to load a Unity WebGL build. It dynamically creates a script tag for the Unity loader and initializes the Unity instance, handling progress updates and completion. ```javascript const overlayBackgroundColor = "{{{ OVERLAY_BACKGROUND_COLOR.replace(/ /g, '') }}}"; const progressBarFillColor = "{{{ PROGRESS_BAR_FILL_COLOR.replace(/ /g, '') }}}"; const progressBarBackgroundColor = "{{{ PROGRESS_BAR_BACKGROUND_COLOR.replace(/ /g, '') }}}"; const progressBarBorderColor = "{{{ PROGRESS_BAR_BORDER_COLOR.replace(/ /g, '') }}}"; const backgroundFileName = "{{{ BACKGROUND_IMAGE_FILE.replace(/ /g, '') }}}"; const buildUrl = "Build"; const loaderUrl = buildUrl + "/{{{ LOADER_FILENAME }}}"; const config = { dataUrl: buildUrl + "/{{{ DATA_FILENAME }}}}", workerUrl: buildUrl + "/{{{ DATA_FILENAME }}}}", frameworkUrl: buildUrl + "/{{{ FRAMEWORK_FILENAME }}}}", codeUrl: buildUrl + "/{{{ CODE_FILENAME }}}}", // #if MEMORY_FILENAME // memoryUrl: buildUrl + "/{{{ MEMORY_FILENAME }}}}", // #endif // #if SYMBOLS_FILENAME // symbolsUrl: buildUrl + "/{{{ SYMBOLS_FILENAME }}}}", // #endif streamingAssetsUrl: "StreamingAssets", companyName: "{{{ COMPANY_NAME }}}", productName: "{{{ PRODUCT_NAME }}}", productVersion: "{{{ PRODUCT_VERSION }}}", }; const container = document.querySelector("#unity-container"); const canvas = document.querySelector("#unity-canvas"); const loadingCover = document.querySelector("#loading-cover"); const progressBarEmpty = document.querySelector("#unity-progress-bar-empty"); const progressBarFull = document.querySelector("#unity-progress-bar-full"); const spinner = document.querySelector('.spinner'); if (overlayBackgroundColor !== " " && overlayBackgroundColor !== "") { canvas.style.background = overlayBackgroundColor; } if (progressBarFillColor !== " " && progressBarFillColor !== "") { progressBarFull.style.background = progressBarFillColor; } if (progressBarBackgroundColor !== " " && progressBarBackgroundColor !== "") { progressBarEmpty.style.background = progressBarBackgroundColor; } if (progressBarBorderColor !== " " && progressBarBorderColor !== "") { progressBarEmpty.style.border.color = progressBarBorderColor; } if (backgroundFileName !== " " && backgroundFileName !== "") { canvas.style.background = "url('" + backgroundFileName + "') center / cover"; } if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) { container.className = "unity-mobile"; } // #if BACKGROUND_FILENAME // canvas.style.background = "url('" + buildUrl + "/{{{ BACKGROUND_FILENAME.replace(/'/g, '%27') }}}\') center / cover"; // #endif loadingCover.style.display = ""; // Выключаем появление меню при правом клике мыши document.addEventListener('contextmenu', event => event.preventDefault()); // Возвращаем фокус, если кликнули по экрану function FocusGame() { window.focus(); canvas.focus(); } window.addEventListener('pointerdown', () => { FocusGame(); }); window.addEventListener('touchstart', () => { FocusGame(); }); const unityLoader = document.createElement("script"); unityLoader.src = loaderUrl; unityLoader.onload = async () => { createUnityInstance(canvas, config, (progress) => { spinner.style.display = "none"; progressBarEmpty.style.display = ""; progressBarFull.style.width = `${100 * progress}%`; }).then((unityInstance) => { window.unityInstance = unityInstance; loadingCover.style.display = "none"; }).catch((message) => { alert(message); }); }; document.body.appendChild(unityLoader); document.addEventListener("pointerdown", () => { container.focus(); window.focus(); canvas.focus(); }); ``` -------------------------------- ### GP_Fullscreen API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md API documentation for the GP_Fullscreen module, enabling control over fullscreen mode and handling related events. ```APIDOC GP_Fullscreen: Open(onFullscreenOpen: Action = null) Parameters: onFullscreenOpen: Callback action executed when fullscreen is opened. Returns: void Description: Opens the fullscreen mode. Close(onFullscreenClose: Action = null) Parameters: onFullscreenClose: Callback action executed when fullscreen is closed. Returns: void Description: Closes the fullscreen mode. Toggle() Parameters: void Returns: void Description: Toggles the fullscreen mode between open and closed. Actions: OnFullscreenOpen() OnFullscreenClose() OnFullscreenChange() ``` -------------------------------- ### GP_Experiments API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md API documentation for the GP_Experiments module, including methods for mapping and checking tags/cohorts. ```APIDOC GP_Experiments: Map() Parameters: void Returns: string Description: Maps experiments. No specific parameters are required. Has(tag: string, cohort: string) Parameters: tag: The tag to check. cohort: The cohort to check. Returns: bool Description: Checks if a specific tag and cohort combination exists. ``` -------------------------------- ### GamePush Plugin System Methods (GP_System) Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Provides utility methods for checking the game environment and origin. These are useful for debugging and environment-specific logic. ```APIDOC IsDev() - Checks if the game is running in a development environment. - Returns: bool IsAllowedOrigin() - Checks if the current origin is allowed by the GamePush service. - Returns: bool ``` -------------------------------- ### GP_Documents API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Manages the opening and fetching of documents within the GamePush service, including callbacks for document opening, closing, and fetch success/failure. ```APIDOC GP_Documents: Methods: Open(Action onDocumentsOpen = null, Action onDocumentsClose = null): void - Opens the documents interface with optional callbacks for when it's opened and closed. Fetch(Action onFetchSuccess = null, Action onFetchError = null): void - Fetches document data, providing callbacks for success (with data) and failure. Actions: OnDocumentsOpen(): void - Callback invoked when the documents interface is opened. OnDocumentsClose(): void - Callback invoked when the documents interface is closed. OnFetchSuccess(string data): string - Callback for successful document data fetching, returning the fetched data. OnFetchError(): void - Callback invoked when there is an error fetching document data. ``` -------------------------------- ### General Actions/Event Handlers Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Defines common actions or event handlers related to ads, fullscreen, preloader, rewarded ads, and sticky ads. These are typically callbacks for various lifecycle events. ```APIDOC Actions/Event Handlers: OnAdsStart() Called when an ad session starts. Returns: void OnAdsClose() Called when an ad session closes. Returns: bool OnFullscreenStart() Called when a fullscreen ad session starts. Returns: void OnFullscreenClose() Called when a fullscreen ad session closes. Returns: bool OnPreloaderStart() Called when a preloader session starts. Returns: void OnPreloaderClose() Called when a preloader session closes. Returns: bool OnRewardedStart() Called when a rewarded ad session starts. Returns: void OnRewardedClose() Called when a rewarded ad session closes. Returns: bool OnRewardedReward() Called when a rewarded ad grants a reward. Returns: string OnStickyStart() Called when a sticky ad session starts. Returns: void OnStickyClose() Called when a sticky ad session closes. Returns: void OnStickyRefresh() Called when a sticky ad is refreshed. Returns: void OnStickyRender() Called when a sticky ad is rendered. Returns: void ``` -------------------------------- ### GP_Game API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md API documentation for the GP_Game module, providing methods to manage game state like pausing and resuming, and tracking gameplay. ```APIDOC GP_Game: IsPaused() Parameters: void Returns: bool Description: Checks if the game is currently paused. Pause(onPause: Action = null) Parameters: onPause: Callback action executed when the game is paused. Returns: void Description: Pauses the game. Resume(onResume: Action = null) Parameters: onResume: Callback action executed when the game resumes. Returns: void Description: Resumes the game from a paused state. GameplayStart() Parameters: void Returns: void Description: Signals the start of gameplay. GameplayStop() Parameters: void Returns: void Description: Signals the stop of gameplay. GameReady() Parameters: void Returns: void Description: Signals that the game is ready. HappyTime() Parameters: void Returns: void Description: Triggers a 'happy time' event, potentially for special game states. Actions: OnPause() OnResume() ``` -------------------------------- ### FetchProducts Data Structure Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Defines the structure for product information returned during a fetch operation. ```csharp public class FetchProducts { public int id; public string tag; public string name; public string description; public string icon; public string iconSmall; public int price; public string currency; public string currencySymbol; public bool isSubscription; public int period; public int trialPeriod; } ``` -------------------------------- ### GP_Payments API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Provides methods for handling in-game purchases, subscriptions, and consumption of virtual goods. Includes callbacks for success and error events. ```APIDOC GP_Payments Methods: Fetch() - Initiates the fetching of available payment products. - Parameters: None - Returns: void Purchase(string idOrTag, Action onPurchaseSuccess = null, Action onPurchaseError = null) - Initiates a purchase for a specific product. - Parameters: - idOrTag: The unique identifier or tag of the product to purchase. - onPurchaseSuccess: Callback function executed upon successful purchase (receives product ID). - onPurchaseError: Callback function executed upon purchase failure. - Returns: void Consume(string idOrTag, Action onConsumeSuccess = null, Action onConsumeError = null) - Consumes a purchased item, typically used for one-time use virtual goods. - Parameters: - idOrTag: The unique identifier or tag of the product to consume. - onConsumeSuccess: Callback function executed upon successful consumption (receives product ID). - onConsumeError: Callback function executed upon consumption failure. - Returns: void IsPaymentsAvailable() - Checks if the payment system is available on the current platform. - Parameters: None - Returns: bool (true if available, false otherwise) IsSubscriptionsAvailable() - Checks if subscription functionality is available on the current platform. - Parameters: None - Returns: bool (true if available, false otherwise) Subscribe(string idOrTag, Action onSubscribeSuccess = null, Action onSubscribeError = null) - Initiates a subscription for a specific product. - Parameters: - idOrTag: The unique identifier or tag of the subscription product. - onSubscribeSuccess: Callback function executed upon successful subscription (receives product ID). - onSubscribeError: Callback function executed upon subscription failure. - Returns: void Unsubscribe(string idOrTag, Action onUnsubscribeSuccess = null, Action onUnsubscribeError = null) - Initiates the unsubscription from a specific product. - Parameters: - idOrTag: The unique identifier or tag of the subscription product to unsubscribe from. - onUnsubscribeSuccess: Callback function executed upon successful unsubscription (receives product ID). - onUnsubscribeError: Callback function executed upon unsubscription failure. - Returns: void GP_Payments Actions (Callbacks): OnFetchProducts - Triggered after Fetch() completes successfully. - Returns: List OnFetchProductsError - Triggered if Fetch() fails. - Returns: void OnFetchPlayerPurchases - Triggered to retrieve a list of the player's past purchases. - Returns: List OnPurchaseSuccess(string productId) - Callback for successful purchase. - Parameters: - productId: The ID of the successfully purchased product. - Returns: void OnPurchaseError() - Callback for purchase failure. - Returns: void OnConsumeSuccess(string productId) - Callback for successful consumption. - Parameters: - productId: The ID of the successfully consumed product. - Returns: void OnConsumeError() - Callback for consumption failure. - Returns: void OnSubscribeSuccess(string productId) - Callback for successful subscription. - Parameters: - productId: The ID of the successfully subscribed product. - Returns: void OnSubscribeError() - Callback for subscription failure. - Returns: void OnUnsubscribeSuccess(string productId) - Callback for successful unsubscription. - Parameters: - productId: The ID of the successfully unsubscribed product. - Returns: void OnUnsubscribeError() - Callback for unsubscription failure. - Returns: void ``` -------------------------------- ### GP_Platform API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Provides methods to query information about the current gaming platform and its capabilities. ```APIDOC GP_Platform Methods: Type() - Gets the current platform type. - Parameters: None - Returns: Platform (enum value representing the platform) TypeAsString() - Gets the current platform type as a string. - Parameters: None - Returns: string (name of the platform) HasIntegratedAuth() - Checks if the current platform has integrated authentication features. - Parameters: None - Returns: bool (true if integrated auth is available, false otherwise) IsExternalLinksAllowed() - Checks if the platform allows opening external links (e.g., for web views or redirects). - Parameters: None - Returns: bool (true if external links are allowed, false otherwise) ``` -------------------------------- ### Image Management API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Enables image selection, upload, fetching, and resizing. Supports various upload methods (direct, URL) and filtering for image retrieval. Includes methods for format conversion. ```APIDOC GP_Images: Choose(Action onImagesChooseFile = null, Action onImagesChooseError = null) - Initiates the process for the user to choose an image file. - Parameters: - onImagesChooseFile: Callback for successful file selection, providing the file path. - onImagesChooseError: Callback for errors during file selection. - Returns: void Upload(string[] tags = null, Action onImagesUploadSuccess = null, Action onImagesUploadError = null) - Uploads selected image files with associated tags. - Parameters: - tags: An array of strings representing tags for the image. - onImagesUploadSuccess: Callback for successful upload, returning ImageData. - onImagesUploadError: Callback for upload errors. - Returns: void UploadUrl(string url, string[] tags = null, Action onImagesUploadUrlSuccess = null, Action onImagesUploadUrlError = null) - Uploads an image from a given URL with associated tags. - Parameters: - url: The URL of the image to upload. - tags: An array of strings representing tags for the image. - onImagesUploadUrlSuccess: Callback for successful upload, returning ImageData. - onImagesUploadUrlError: Callback for upload errors. - Returns: void Fetch(ImagesFetchFilter filter = null, Action> onImagesFetchSuccess = null, Action onImagesFetchError = null) - Fetches a list of images based on specified filter criteria. - Parameters: - filter: An ImagesFetchFilter object to define search parameters. - onImagesFetchSuccess: Callback for successful fetch, returning a list of ImageData. - onImagesFetchError: Callback for fetch errors. - Returns: void FetchMore(ImagesFetchFilter filter = null, Action> onImagesFetchSuccess = null, Action onImagesFetchError = null) - Fetches the next page of images based on filter criteria. - Parameters: - filter: An ImagesFetchFilter object. - onImagesFetchSuccess: Callback for successful fetch. - onImagesFetchError: Callback for fetch errors. - Returns: void Resize(ImageResizeData resizeData = null, Action onImagesResize = null, Action onImagesResizeError = null) - Resizes an image according to the provided ImageResizeData. - Parameters: - resizeData: An ImageResizeData object specifying resize parameters. - onImagesResize: Callback for successful resize operation. - onImagesResizeError: Callback for resize errors. - Returns: void FormatToPng(string url) - Converts an image URL to PNG format. - Parameters: - url: The URL of the image to convert. - Returns: string (The URL of the PNG formatted image) FormatUrl(string url, string format) - Converts an image URL to a specified format. - Parameters: - url: The URL of the image. - format: The target image format (e.g., "png", "jpg"). - Returns: string (The URL of the formatted image) Data Structures: ImageData: - id: string - playerId: int - src: string - tags: string[] - width: int - height: int ImageResizeData: - url: string - width: int (default: 256) - height: int (default: 256) - cutBySize: bool (default: true) ImagesFetchFilter: - tags: string[] - playerId: int - limit: int (default: 10) - offset: int (default: 0) ``` -------------------------------- ### C# CreateChannelData Structure Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Represents the data payload for creating a new channel. It includes properties for channel configuration, permissions, and metadata. ```csharp public class CreateChannelData { public int id; public string[] tags; public string[] messageTags; public int templateId; public int capacity; public int ownerId; public string name; public string description; public bool ch_private; public bool visible; public bool permanent; public bool hasPassword; public bool isJoined; public bool isRequestSent; public bool isInvited; public bool isMuted; public string password; public int membersCount; public OwnerAcl ownerAcl; public MemberAcl memberAcl; public GuestAcl guestAcl; } ``` -------------------------------- ### Gamepush Service API Methods Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Provides a comprehensive set of methods for managing chat channels, player interactions, and notifications within the Gamepush Unity plugin. This includes opening chats, joining/leaving channels, managing invites, and processing join requests. ```APIDOC Chat and Channel Management: OpenChat(Action onOpen = null, Action onClose = null, Action onOpenError = null) - Opens a chat interface without specifying a channel or player. - Parameters: - onOpen: Callback for when the chat successfully opens. - onClose: Callback for when the chat is closed. - onOpenError: Callback for when an error occurs during opening. - Returns: void OpenChat(int channel_ID, string tags, Action onOpen = null, Action onClose = null, Action onOpenError = null) - Opens a specific chat channel identified by channel_ID, with optional tags. - Parameters: - channel_ID: The unique identifier for the chat channel. - tags: Optional string for categorizing or filtering the chat. - onOpen: Callback for when the chat successfully opens. - onClose: Callback for when the chat is closed. - onOpenError: Callback for when an error occurs during opening. - Returns: void OpenPersonalChat(int player_ID, string tags, Action onOpen = null, Action onClose = null, Action onOpenError = null) - Opens a private chat with a specific player. - Parameters: - player_ID: The unique identifier for the target player. - tags: Optional string for categorizing or filtering the chat. - onOpen: Callback for when the chat successfully opens. - onClose: Callback for when the chat is closed. - onOpenError: Callback for when an error occurs during opening. - Returns: void OpenFeed(int player_ID, string tags, Action onOpen = null, Action onClose = null, Action onOpenError = null) - Opens a feed associated with a specific player. - Parameters: - player_ID: The unique identifier for the player whose feed to open. - tags: Optional string for categorizing or filtering the feed. - onOpen: Callback for when the feed successfully opens. - onClose: Callback for when the feed is closed. - onOpenError: Callback for when an error occurs during opening. - Returns: void IsMainChatEnabled() - Checks if the main chat feature is currently enabled. - Parameters: void - Returns: bool MainChatId() - Retrieves the identifier for the main chat. - Parameters: void - Returns: int Join(int channel_ID) - Joins a specified channel. - Parameters: - channel_ID: The unique identifier for the channel to join. - Returns: void Join(int channel_ID, string password) - Joins a specified channel using a password. - Parameters: - channel_ID: The unique identifier for the channel to join. - password: The password required to join the channel. - Returns: void CancelJoin(int channel_ID) - Cancels a pending request to join a channel. - Parameters: - channel_ID: The unique identifier for the channel whose join request to cancel. - Returns: void Leave(int channel_ID) - Leaves a specified channel. - Parameters: - channel_ID: The unique identifier for the channel to leave. - Returns: void Kick(int channel_ID, int player_ID) - Removes a player from a specified channel. - Parameters: - channel_ID: The unique identifier for the channel. - player_ID: The unique identifier for the player to kick. - Returns: void Mute(int channel_ID, int player_ID, int seconds) - Mutes a player in a specified channel for a given duration in seconds. - Parameters: - channel_ID: The unique identifier for the channel. - player_ID: The unique identifier for the player to mute. - seconds: The duration in seconds for which the player will be muted. - Returns: void Mute(int channel_ID, int player_ID, string unmuteAT) - Mutes a player in a specified channel until a specific time. - Parameters: - channel_ID: The unique identifier for the channel. - player_ID: The unique identifier for the player to mute. - unmuteAT: A string representing the date and time when the mute should expire. - Returns: void UnMute(int channel_ID, int player_ID) - Unmutes a player in a specified channel. - Parameters: - channel_ID: The unique identifier for the channel. - player_ID: The unique identifier for the player to unmute. - Returns: void SendMessage(int channel_ID, string text, string tags = "") - Sends a message to a specified channel. - Parameters: - channel_ID: The unique identifier for the channel to send the message to. - text: The content of the message. - tags: Optional string for categorizing or filtering the message. - Returns: void Invite Management: SendInvite(int channel_ID, int player_ID) - Sends an invitation to a player to join a channel. - Parameters: - channel_ID: The unique identifier for the channel. - player_ID: The unique identifier for the player to invite. - Returns: void CancelInvite(int channel_ID, int player_ID) - Cancels a previously sent invitation to a player for a channel. - Parameters: - channel_ID: The unique identifier for the channel. - player_ID: The unique identifier for the player whose invitation to cancel. - Returns: void AcceptInvite(int channel_ID) - Accepts an invitation to join a channel. - Parameters: - channel_ID: The unique identifier for the channel for which the invite is accepted. - Returns: void RejectInvite(int channel_ID) - Rejects an invitation to join a channel. - Parameters: - channel_ID: The unique identifier for the channel for which the invite is rejected. - Returns: void FetchInvites(int limit = 50, int offset = 0) - Fetches a list of pending invitations for the current user. - Parameters: - limit: The maximum number of invitations to retrieve. - offset: The number of invitations to skip. - Returns: void FetchMoreInvites(int limit = 50) - Fetches the next batch of pending invitations. - Parameters: - limit: The maximum number of invitations to retrieve in this batch. - Returns: void FetchChannelInvites(int channel_ID, int limit = 50, int offset = 0) - Fetches pending invitations for a specific channel. - Parameters: - channel_ID: The unique identifier for the channel. - limit: The maximum number of invitations to retrieve. - offset: The number of invitations to skip. - Returns: void FetchMoreChannelInvites(int channel_ID, int limit = 50) - Fetches the next batch of pending invitations for a specific channel. - Parameters: - channel_ID: The unique identifier for the channel. - limit: The maximum number of invitations to retrieve in this batch. - Returns: void FetchSentInvites(int channel_ID, int limit = 50, int offset = 0) - Fetches invitations sent by the current user for a specific channel. - Parameters: - channel_ID: The unique identifier for the channel. - limit: The maximum number of sent invitations to retrieve. - offset: The number of sent invitations to skip. - Returns: void FetchMoreSentInvites(int channel_ID, int limit = 50) - Fetches the next batch of invitations sent by the current user for a specific channel. - Parameters: - channel_ID: The unique identifier for the channel. - limit: The maximum number of sent invitations to retrieve in this batch. - Returns: void Join Request Management: AcceptJoinRequest(int channel_ID, int player_ID) - Accepts a player's request to join a channel. - Parameters: - channel_ID: The unique identifier for the channel. - player_ID: The unique identifier for the player whose join request to accept. - Returns: void RejectJoinRequest(int channel_ID, int player_ID) - Rejects a player's request to join a channel. - Parameters: - channel_ID: The unique identifier for the channel. - player_ID: The unique identifier for the player whose join request to reject. - Returns: void FetchJoinRequests(int channel_ID, int limit = 50, int offset = 0) - Fetches pending join requests for a specific channel. - Parameters: - channel_ID: The unique identifier for the channel. - limit: The maximum number of join requests to retrieve. - offset: The number of join requests to skip. - Returns: void FetchMoreJoinRequests(int channel_ID, int limit = 50) - Fetches the next batch of pending join requests for a specific channel. - Parameters: - channel_ID: The unique identifier for the channel. - limit: The maximum number of join requests to retrieve in this batch. - Returns: void FetchSentJoinRequests(int limit = 50, int offset = 0) - Fetches join requests sent by the current user. - Parameters: - limit: The maximum number of sent join requests to retrieve. - offset: The number of sent join requests to skip. - Returns: void FetchMoreSentJoinRequests(int limit = 50) - Fetches the next batch of join requests sent by the current user. - Parameters: - limit: The maximum number of sent join requests to retrieve in this batch. - Returns: void ``` -------------------------------- ### APIDOC: Game Push Open Chat Events Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Manages events related to opening a chat session. Includes success and error callbacks. ```APIDOC OnOpenChat: void - Callback for successfully opening a chat session. OnOpenChatError: void - Callback for errors when opening a chat session. ``` -------------------------------- ### GamePush Unity Plugin: Channel Management API Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Provides methods for managing channels, including creation, deletion, fetching, and updating channel information. Supports filtering and pagination for channel lists. ```APIDOC DeleteChannel: Signature: void DeleteChannel(int channel_ID) Description: Deletes a specific channel. Parameters: - channel_ID: The identifier of the channel to delete. FetchChannel: Signature: void FetchChannel(int channel_ID) Description: Fetches details for a specific channel. Parameters: - channel_ID: The identifier of the channel to fetch. CreateChannel: Signature: void CreateChannel(CreateChannelFilter filter) Description: Creates a new channel with specified properties. Parameters: - filter: An object containing properties for the new channel (e.g., name, description). UpdateChannel: Signature: void UpdateChannel(UpdateChannelFilter filter) Description: Updates an existing channel's properties. Parameters: - filter: An object containing updated properties for the channel. FetchChannels: Signature: void FetchChannels(FetchChannelsFilter filter) Description: Fetches a list of channels based on specified filter criteria. Parameters: - filter: An object containing criteria to filter channels (e.g., pagination, search terms). FetchMoreChannels: Signature: void FetchMoreChannels(FetchMoreChannelsFilter filter) Description: Fetches the next batch of channels based on the provided filter. Parameters: - filter: An object containing criteria for fetching more channels. ``` -------------------------------- ### Data Fetching and Status Checks Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Provides methods for fetching external data, checking login status, and verifying credential presence. These are utility methods for managing player context and data availability. ```APIDOC FetchFields(Action> onFetchFields = null) Description: Fetches player fields data asynchronously. An optional callback can be provided. Parameters: - onFetchFields: An optional callback action that receives a list of PlayerFetchFieldsData upon completion. Returns: void IsLoggedIn() Description: Checks if the player is currently logged in. Returns: bool HasAnyCredentials() Description: Checks if the player has any valid credentials stored. Returns: bool IsStub() Description: Checks if the current player instance is a stub or a fully initialized player. Returns: bool ``` -------------------------------- ### C# FetchChannelData Structure Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Represents the data structure for fetching channel details. It includes comprehensive information about a channel's state and configuration. ```csharp public class FetchChannelData { public int id; public string[] tags; public string[] messageTags; public int templateId; public int projectId; public int capacity; public int ownerId; public string name; public string description; public bool ch_private; public bool visible; public bool permanent; public bool hasPassword; public string password; public bool isJoined; public bool isInvited; public bool isMuted; public bool isRequestSent; public int membersCount; public OwnerAcl ownerAcl; public MemberAcl memberAcl; public GuestAcl guestAcl; } ``` -------------------------------- ### APIDOC: Game Push Fetch Messages Events Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Manages events for fetching lists of messages. Includes callbacks for initial fetches and error notifications. ```APIDOC OnFetchMessages: GP_Data, bool - Callback for successfully fetching a list of messages. - Parameters: - GP_Data: Data containing the fetched messages. - bool: Indicates if there are more messages available. OnFetchMessagesError: void - Callback for errors during message fetching. ``` -------------------------------- ### Gamepush Plugin Methods Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Provides methods for fetching and accessing variables, including platform-specific variables. Supports asynchronous operations with callbacks for success and error handling. ```APIDOC Fetch Parameters: onFetchSuccess: Action> - Callback for successful fetch. onFetchError: Action - Callback for fetch errors. Returns: void Has Parameters: key: string - The key of the variable to check. Returns: bool - True if the variable exists, false otherwise. GetInt Parameters: key: string - The key of the integer variable. Returns: int - The integer value of the variable. GetFloat Parameters: key: string - The key of the float variable. Returns: float - The float value of the variable. GetString Parameters: key: string - The key of the string variable. Returns: string - The string value of the variable. GetBool Parameters: key: string - The key of the boolean variable. Returns: bool - The boolean value of the variable. GetImage Parameters: key: string - The key of the image variable. Returns: string - The string representation of the image (e.g., URL or base64). GetFile Parameters: key: string - The key of the file variable. Returns: string - The string representation of the file (e.g., URL or path). IsPlatformVariablesAvailable Parameters: void Returns: bool - True if platform variables are available, false otherwise. FetchPlatformVariables Parameters: optionsDict: Dictionary - Optional dictionary for custom options. onPlatformFetchSuccess: Action> - Callback for successful platform variable fetch. onPlatformFetchError: Action - Callback for platform variable fetch errors. Returns: void FetchPlatformVariables Parameters: onPlatformFetchSuccess: Action> - Callback for successful platform variable fetch. onPlatformFetchError: Action - Callback for platform variable fetch errors. Returns: void ``` -------------------------------- ### APIDOC: Game Push Join Request Events Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Handles events related to fetching and managing join requests within the game push service. Includes success callbacks with data and boolean flags, and error callbacks. ```APIDOC OnFetchSentJoinRequests: List, bool - Callback for successfully fetching sent join requests. - Parameters: - List: A list of join request data objects. - bool: Indicates if there are more requests available. OnFetchSentJoinRequestsError: void - Callback for errors during fetching sent join requests. ``` -------------------------------- ### APIDOC: Game Push Fetch Feed Messages Events Source: https://github.com/gamepushservice/gamepush-unity-plugin/blob/main/README.md Manages events for fetching messages from the feed. Includes callbacks for initial fetches and error notifications. ```APIDOC OnFetchFeedMessages: GP_Data, bool - Callback for successfully fetching feed messages. - Parameters: - GP_Data: Data containing the fetched feed messages. - bool: Indicates if there are more feed messages available. OnFetchFeedMessagesError: void - Callback for errors during feed message fetching. ```