Skip to main content

4. Game Launch JS Library

Operator is required to launch the game by using PG SOFT JS library to provide the best gaming experience to players:

  • Implementation of automatically adapting pop-up window according to the user's display size.
  • PG SOFT games are all designed to be displayed vertically, the pop-up window format is consistent with product design.
  • Achieving the optimal gaming Interface height will allow users to feel visually comfortable, in line with usage habits.
  • Presenting the best in-game visual quality to the players, providing the best gaming experience.

4.1 Avoid Browser Pop-up Blockers

The general rules that popup blockers will engage are:

  • Invoked from JavaScript that is not invoked by direct user action.
  • Pop-up content are not from the same domain as the source.

Operator is recommended to follow the instructions below to avoid browser pop-up blockers:

  • Create a redirection page and redirect to game launch URL (URL scheme[11]).
  • When players click the game launch button/link, use the PG SOFT JS function (PGSDK.launchGame) and launch the redirection page.

4.2 Implementation

Step 1
Include the following line in the HTML <head> tags:

<script defer
src="https://public.pg-redirect.net/sdk/main.min.js"></script>

Note: Operator can self-host the JS library as well: https://public.pg-redirect.net/sdk/main.min.js

Step2
Operator is required to create a self-host redirection page to bypass popup blockers on web browsers.
Sample code of redirect page:

<!DOCTYPE html>
<html xmlns-"https://www.w3.org/1999/xhtml>
<head>
<script>

window.location.replace("https://m.pg-redirect.net/1/index.html?l=en&btt=1&ot=12345abcde&opt=abcde-12345-abcde-12345");
</script>
</head>
</html>

Step3
Use the following JS script to launch PG SOFT games. Operator is required to create a self-host redirection page to bypass popup blockers on web browsers.

PGSDK.launchGame('{operator_redirection_URK}');

Parameters:

Parameter nameData TypeMandatoryDescription
operator_redirection_URLStringYesOperator self-host page which will redirect to game launch URL (URL scheme[12])

Example:
PGSDK.launchGame('https://[OperatorDomain]/redirect.html');

References

[11] Please refer to URL Scheme section for more information.
[12] Please refer to URL Scheme section for more information.