PICO Platform Unity SDK
ApplicationService Class Reference

Static Public Member Functions

static Task< string > LaunchApp (string packageName, ApplicationOptions options=null)
 Launches another app by app package name. More...
 
static Task< string > LaunchAppByAppId (string appId, ApplicationOptions options=null)
 Launches another app by app ID. More...
 
static Task< string > LaunchStore ()
 Launches the PICO Store app and go to the current app's details page. More...
 
static Task< ApplicationVersionGetVersion ()
 Gets the app's current version info and the latest version info. More...
 
static LaunchDetails GetLaunchDetails ()
 Gets the details about an app launch event. More...
 
static SystemInfo GetSystemInfo ()
 Get system info synchronously. More...
 
static void LogDeeplinkResult (string trackId, LaunchResult result)
 Logs whether a user has been successfully directed to the desired destination via a deep link. More...
 
static void SetLaunchIntentChangedCallback (Message< string >.Handler callback)
 When the launch intent is changed, you will receive this notification. Then you can call GetLaunchDetails to retrieve the launch details. More...
 

Detailed Description

ApplicationService provides functions like launch other application,jump to store, get launch details.

Member Function Documentation

◆ LaunchApp()

static Task< string > LaunchApp ( string  packageName,
ApplicationOptions  options = null 
)
inlinestatic

Launches another app by app package name.

Note
If the user does not have that app installed, the user will be directed to the app's download page on the PICO Store.
Parameters
packageNameThe package name of the to-be-launched app.
optionsThe options for launching the app. Pass null or leave this parameter empty.
Returns
If something goes wrong, a description message will be returned.

◆ LaunchAppByAppId()

static Task< string > LaunchAppByAppId ( string  appId,
ApplicationOptions  options = null 
)
inlinestatic

Launches another app by app ID.

Note
If the user does not have that app installed, the user will be directed to the app's download page on the PICO Store.
Parameters
appIdThe ID of the to-be-launched app.
optionsThe options for launching the app. Pass null or leave this parameter empty.
Returns
If something goes wrong, a description message will be returned.

◆ LaunchStore()

static Task< string > LaunchStore ( )
inlinestatic

Launches the PICO Store app and go to the current app's details page.

You can direct user to the PICO Store to upgrade the installed app by this method. To judge whether there is a new version in the PICO Store, you can call GetVersion.

Note
  • If the current app has never published in the PICO Store, the response error code is non-zero.
  • The current app will quit once the PICO Store app is launched.
Returns
A string that describes the launch info.

◆ GetVersion()

static Task< ApplicationVersion > GetVersion ( )
inlinestatic

Gets the app's current version info and the latest version info.

You can compare the current version info and the latest version info, and then decide whether to call LaunchStore to direct users to the current app's details page to upgrade the app.

Returns
The response will contain the latest version info in the PICO Store and the app's current version info.

◆ GetLaunchDetails()

static LaunchDetails GetLaunchDetails ( )
inlinestatic

Gets the details about an app launch event.

Returns
App launch details, including LaunchResult and LaunchType:
  • LaunchResult:
    • 0: Unknown
    • 1: Success
    • 2: FailedRoomFull
    • 3: FailedGameAlreadyStarted
    • 4: FailedRoomNotFound
    • 5: FailedUserDeclined
    • 6: FailedOtherReason
  • LaunchType:
    • 0: Unknown
    • 1: Normal
    • 2: Invite
    • 3: Coordinated
    • 4: Deeplink

◆ GetSystemInfo()

static SystemInfo GetSystemInfo ( )
inlinestatic

Get system info synchronously.

Returns
A structure contains system info.

◆ LogDeeplinkResult()

static void LogDeeplinkResult ( string  trackId,
LaunchResult  result 
)
inlinestatic

Logs whether a user has been successfully directed to the desired destination via a deep link.

Parameters
trackIdThe tracking ID of the app launch event.
resultThe app launch result:
  • 0: Unknown
  • 1: Success
  • 2: FailedRoomFull
  • 3: FailedGameAlreadyStarted
  • 4: FailedRoomNotFound
  • 5: FailedUserDeclined
  • 6: FailedOtherReason

◆ SetLaunchIntentChangedCallback()

static void SetLaunchIntentChangedCallback ( Message< string >.Handler  callback)
inlinestatic

When the launch intent is changed, you will receive this notification. Then you can call GetLaunchDetails to retrieve the launch details.

Parameters
callbackThe callback function.