To ensure your playable is compatible with the supported networks, it is important to implement a handful of global functions so that Luna knows how to appropriately map your game logic to the playable networks' specifications.
Luna makes this simple by providing a single C# API, which is then tailored for the network at time of export with no additional work for you.
Handling screen orientation
We recommend that you build a responsive playable ad, and ensure that the UI and other elements scale or adapt accordingly. In a playable ad context, you will not have access to Unity APIs such as
Input.deviceOrientation. Therefore we recommend using
Screen.height to handle this.
App Store Clicks (CTAs)
When you wish to direct a user to the app store in your playable ad i.e. after clicking the in-game CTA button, or end card, then you need to call the following API from your game code:
Pausing and Resuming Gameplay
In order to pause the gameplay when the app is sent to the background or the app store link is clicked, Luna provides lifecycle events to which you can subscribe.
For example, it is recommended to pause the gameplay when the user leaves the app, or you may wish to present the end card after the user has returned.
Please use the
Luna.Unity.LifeCycle.OnPause events. For example:
Game Ended lifecycle event
Some networks require that you notify them when the end of the playable ad is reached. This event must be called when the experience is complete, for example, when the end card is presented.
Testing your builds
Every ad network has their own specification and toolset for testing playables. See the following guides for how to test for each ad network.