Mobile Background

The Mobile Background plugin is specifically designed to implement native mobile background features in both Android and iOS, for games built using Construct 3 and Construct 2.


The Mobile Background plugin features include excluding the application from the task list, for the application to go to the background or foreground, override the back button, unlock or wake up the application, configure background notifications, override notifications, etc.

PlayFab API v2.png

Introduction

Step 1.png

The Construct Master Collection supports the full and easy integration of native mobile Android SDKs and iOS SDKs for both Construct 3 and Construct 2.


Please click here to learn more about Mobile.

Features


The Mobile Background plugin is specifically designed to implement native mobile background features in both Android and iOS, for games built using Construct 3 and Construct 2.


Here are some of the native features of the mobile plugin:

  • Android application background features

  • iOS application background features

  • Native background features

  • Native background service features

  • Application go to foreground

  • Application go to background

  • Application wake up

  • Application unlock

  • Application exclude from recent tasks list.

  • Background notifications

  • Background service notifications

  • Background notification configuration

  • Battery optimization settings

  • Disable Webview optimizations to allow application to run in full performance in the background.

  • Well maintained and fully tested for production.

For more information about native mobile or Android and iOS features, please click here to learn the introductory lessons to Mobile.


Platform Integration


Here are some of the platforms that are natively supported:

  • Android

  • iOS

  • Native Android

  • Native iOS


Build Support


Here are some of the supported build options:


Editor Features


Here are some of the features in the Construct editor:

  • Construct 3

  • Construct 2

 
 

How to use?

It is easy to use the Mobile Background plugin, you will only need to follow the steps below.

1. The first step is to add the Mobile Background object into the project.


2. The Debug property is a toggle to enable logging of errors in the console, for mobile debugging.


3. The Auto-Start property is a toggle to automatically enable the background features.



4. The Run In Background is a toggle to run the Disable Webview Optimizations feature on startup. This will prevent the app from running less frequently in the background.

5. The Run In Full Power is a toggle to run the Disable Battery Optimizations feature on startup. This will prevent the app from sleeping in the background to conserve energy.

6. The Override Back Button is a toggle to run Override Back Button, on startup. This will override the back button to go to the background, instead of closing the app.

7. The Exclude Tasks List is a toggle to run Exclude Tasks List, on startup. This will exclude the app from the recent tasks list, this works on Android 5.0+.

 
 

Documentation

There is currently nothing to show, we will add more in the future.

 

Actions, Conditions & Expressions

Actions

press to zoom

press to zoom

press to zoom
1/2

The following action groups:

  • Core Features

  • Android Exclusive

  • Android Exclusive - Notifications

  • Android Quirks

Core Features

  • Enable - If Enabled, when the application moves to the background, the mode will activate.

  • Disable - If Disabled, the plugin will deactivate and the application will normally pause on background.



Android Exclusive

  • Go Background - If on Android, call to move the application to the background.

  • Request Foreground Permission - Starting Android 10.0, apps must request the Draw on Top permission, otherwise the action Go Foreground will silently fail.

  • Go Foreground - If on Android, call to move the application to the foreground.

  • Wake Up - If on Android, call to turn on the screen.

  • Unlock - If on Android, call to move the app to the foreground, even when the device is locked.


Android Exclusive - Notifications

  • Override Defaults - If on Android, call to customize later shown notifications.

  • Title - The title of the notification. Leave empty for default.

  • Text - The text of the notification. Leave empty for default.

  • Sub Text - Click here for more information. Leave empty for default.

  • Icon - The icon of the notification. This will look for "xxxx.png" in platforms/android/res/drawable|mipmap. Leave empty for default.

  • Color - The color of the notification. In Hex format, for example "F14F4D". On Android 5.0+, the color option will set the background color of the notification circle. Leave empty for default.

  • Resume - If Enabled, the app will come to the foreground when tapping on the notification. Default is Enabled.

  • Hidden - On Android 5.0, if Enabled, the application notification will be hidden from the lockscreen.

  • Big Text - If Enabled, the text will be big in size.

  • Channel Name - Shown when the user views the app's notification settings.

  • Channel Description - Shown when the user views the channel's settings.

  • Allow Close - If Enabled, a close action will be shown with the notification.

  • Close Icon - The icon shown for the close action.

  • Close Title - The text for the close action.

  • Show Duration - If Enabled, it will show the duration since the notification was created. Default is Enabled.

  • Visibility - Android only, click here for more information. Default is Private.


  • Silent Defaults - If on Android, call to stop displaying notifications. Be aware that Android recommends adding a notification otherwise the OS may pause the app.

  • Reset Defaults - If on Android, call to reset the notification defaults to its original settings.

  • Configure - If on Android, call to customize the currently shown notifications.

  • Title - The title of the notification. Leave empty for default.

  • Text - The text of the notification. Leave empty for default.

  • Sub Text - Click here for more information. Leave empty for default.

  • Icon - The icon of the notification. This will look for "xxxx.png" in platforms/android/res/drawable|mipmap. Leave empty for default.

  • Color - The color of the notification. In Hex format, for example "F14F4D". On Android 5.0+, the color option will set the background color of the notification circle. Leave empty for default.

  • Resume - If Enabled, the app will come to the foreground when tapping on the notification. Default is Enabled.

  • Hidden - On Android 5.0, if Enabled, the application notification will be hidden from the lockscreen.

  • Big Text - If Enabled, the text will be big in size.

  • Channel Name - Shown when the user views the app's notification settings.

  • Channel Description - Shown when the user views the channel's settings.

  • Allow Close - If Enabled, a close action will be shown with the notification.

  • Close Icon - The icon shown for the close action.

  • Close Title - The text for the close action.

  • Show Duration - If Enabled, it will show the duration since the notification was created. Default is Enabled.

  • Visibility - Android only, click here for more information. Default is Private.


Android Quirks

  • Disable Webview Optimizations - The app may run less frequently or not at all while in the background, due to the Webview slowing down. Running this after On Activated or checking the property Run In Background, will prevent that.

  • Override Back Button - If on Android, call to override the back button to go to the background instead of closing the app.

  • Exclude Tasks List - If on Android, call to exclude the app from the recent tasks list, this works on Android 5.0+.

  • Disable Battery Optimizations - Starting Android 8.0, apps can be put to sleep to conserve battery, which will kill the background apps. This will ignore the optimizations and allow the app to run in the background.

  • Show Battery Settings - Starting Android 8.0, apps can be put to sleep to conserve battery, which will kill the background apps. Let the user manually choose whether to disable this or keep it enabled.

Conditions

The following condition groups:

  • Core Features

  • Android Exclusive

  • Android Quirks

  • Event Triggers

press to zoom

press to zoom

press to zoom
1/2

Core Features

  • Is Active - Checks if the application is on the background while background mode is active.


Android Exclusive

  • Is Screen Off - Checks if the application is on the background while background mode is active. This works async compared to Is Active.

Android Quirks

  • Is Ignoring Battery Optimizations - Checks if the battery optimizations are disabled for the application.

Event Triggers

  • On Enabled - An Event Trigger condition that fires when the Mobile Background is Enabled.

  • On Disabled - An Event Trigger condition that fires when the Mobile Background is Disabled.

  • On Activated - An Event Trigger condition that fires when the Mobile Background is Activated, this is when the application goes into the background while also Enabled.

  • On Deactivated - An Event Trigger condition that fires when the Mobile Background is Deactivated, this is when the application goes into the foreground from the background.

  • On Failed - An Event Trigger condition that fires when the Mobile Background has encountered a Failure achieving background mode.

Expressions

press to zoom

press to zoom
1/1

The following expression groups:

  • Event Triggers

Event Triggers

  • EventResponse - Returns the response from event triggers. The conditions with green arrows are the event triggers.

Object   Properties

Plugin Properties

press to zoom

press to zoom
1/1

The following property groups:

  • Configuration

Configuration - The options to set the plugin settings.

  • Debug - If checked, the runtime will log runtime notifications. This should be unchecked on production builds.

  • Auto Start - If checked, the plugin will automatically enable the background features.

  • Android - The options to set the Android features.

  • Run In Background - If checked, it will run Disable Webview Optimizations on startup. This will prevent the app from running less frequently in the background.

  • Run In Full Power - If checked, it will run Disable Battery Optimizations on startup. This will prevent the app from sleeping in the background to conserve energy.

  • Override Back Button - If checked, it will run Override Back Button on startup. This will override the back button to go to the background, instead of closing the app.

  • Exclude Tasks List - If checked, it will run Exclude Tasks List on startup. This will exclude the app from the recent tasks list, this works on Android 5.0+.

 
 

Showcase

There is currently nothing to show, we will add more in the future.

 

Game Projects 

Instructions Kit

Construct 3 Project
Construct 3 Project

press to zoom
Construct 2 Project
Construct 2 Project

press to zoom
Construct 3 Project
Construct 3 Project

press to zoom
1/2

Specifications

  • Instructions - The game project contains instructions and steps on how to use the addon and its features.

  • Action, Conditions and Expressions - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks on the recommended ways of using the addon.

Supporters

Only