Documents
Overview
The SDK functionality allows you to add automatically generated standard documents to your game project. You can also upload your own HTML, RAW, TXT documents and display them in the app as needed.
Privacy Policy
You can turn on the privacy policy for the game at any time in the documents section of the project.
You can use an auto-generated standard document, taking into account GamePush and the metrics that you have included in the project.
Or you can upload your document, it can be text or HTML.
Then you can open privacy policy from the game by +1 Request:
- JavaScript
- Unity
gp.documents.open({ type: 'PLAYER_PRIVACY_POLICY' });
public void Open() => GP_Documents.Open(OnOpen, OnClose);
Or you can download document and display as you want +1 Request:
- JavaScript
- Unity
// By default format is HTML
const document = await gp.documents.fetch({
type: 'PLAYER_PRIVACY_POLICY',
});
// Type of document - PLAYER_PRIVACY_POLICY
document.type
// Content in preferred format
document.content
// Custom format - HTML | RAW | TXT
gp.documents.fetch({
type: 'PLAYER_PRIVACY_POLICY',
format: 'TXT'
});
public void Fetch() => GP_Documents.Fetch(OnFetchSuccess, OnFetchError);
Documents events
- JavaScript
- Unity
// Overlay opened
gp.documents.on('open', () => {});
// Overlay closed
gp.documents.on('close', () => {});
// Fetch
gp.documents.on('fetch', (document) => {});
// Fetch error
gp.documents.on('error:fetch', (error) => {});
// Overlay opened
private void OnOpen() => Debug.Log("On Documents: OPEN");
// Overlay closed
private void OnClose() => Debug.Log("On Documents: CLOSE");
// Fetch
private void OnFetchSuccess(string privacy) => Debug.Log(privacy);
// Fetch error
private void OnFetchError() => Debug.Log("Documents Fetch: ERROR");
Stay in Touch
Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.
GamePush Community Telegram
: @gs_community.
For your suggestions e-mail
: [email protected]
We Wish you Success!