Application build

Learn about advanced setups from our how-tos.

How to integrate SDKs in projects for Android applications

Recommendations

When developing projects for Android applications, follow these recommendations:

  1. Set up native authentication via social networks.

Note
Currently, native authentication is supported by the following social networks:
  • Google
  • Facebook
Use the WebView tool to set up native authentication for other social networks.
  1. Set up deep links to return users to the application after they confirm registration via email.
  2. Customize registration confirmation email.
Note
You can disable sending of registration confirmation emails if your security principles allow it. Contact your Account Manager to disable it, or email csm@xsolla.com.
  1. Choose and set up the most suitable method of working with an in-game store. If you wish, you don’t have to implement the cart feature in your game. Instead, implement the ability to make an in-game purchase by clicking the Buy button.
  2. Set up user redirection to your application after making a payment via an external browser.
  3. Follow the Unity customization instruction to customize the UI for errors and pop-ups. Errors and pop-ups in the integration demo are created for game developers. Therefore, make them more suitable for the end users of your application.
  1. Go to Publisher Account.
  2. To set up returning users to the application after they confirm registration:
    1. Go to your project and click Open in the Login block.
    2. Go to Login projects.
    3. Click Open and set up.
    4. Go to the URL block, specify Callback URL (a URL address or a path a user is redirected to after successful authentication, email confirmation, or password reset), and click Save changes.
  1. To set up user redirection to your application after making a payment via an external browser:
    1. Go to your project and click Open in the Pay Station block.
    2. Go to Settings.
    3. Specify the required parameters in the Redirect policy section and click Save.
  1. Manually create the AndroidManifest.xml file with the code below. Specify:
    • Callback URL divided into 3 parts. The example for https://example.com/callback is below.
    • Return URL (a URL address or a path a user is redirected to after making a payment) divided into 3 parts. The example for https://example.com/return is below.
Copy
Full screen
Small screen
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <application>
        <activity
            android:name="com.unity3d.player.UnityPlayerActivity"
            android:label="@string/app_name"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <data android:scheme="https" />
                <data android:host="example.com" />
                <data android:pathPrefix="/callback" />

                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
            <intent-filter>
                <data android:scheme="https" />
                <data android:host="example.com" />
                <data android:pathPrefix="/return" />

                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
        </activity>
    </application>
</manifest>
Note
If you want to set up user redirection to your application for only one case, delete the intent-filter block with the corresponding parameters from the code.
  1. Place the created file in the Assets/Plugins/Android folder of your Unity project.
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Hide

How to create an application build to run in a browser

Create a WebGL build to run your application in a browser.

Select the Unity WebGL component when installing Unity Editor. To add a module to an already installed Unity Editor, run the installer for your version and select the missing components.

Demo WebGL build
See the demo in a browser.

To create a WebGL build:

  1. Open your Unity project.
  2. Go to File > Build settings.
  3. In the Platform panel, select WebGL.
  4. Select build type (optional).
  5. Click Build and Run.

Note
Not all Unity features are available in WebGL builds. See the Unity documentation for limitations.

For the payment interface to work correctly, open it in an iframe. To do this, call the Purchase method of the Assets > Xsolla > Plugins > paystation JS library following the Unity instructions.

Continue reading

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Hide
Last updated: October 10, 2023

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!