native.canShowPopup() — Social Popup

Type Function
Library native.*
Return value Boolean
Revision Release 2022.3683
Keywords native, canShowPopup, social, Twitter, Facebook, Sina Weibo

Overview

Returns whether or not the popup type can be shown. On iOS, this means that the service has been set up on the device (for example, Twitter has been configured via the Settings app). On Android, this means that the service has been installed on the device.

Syntax

native.canShowPopup( name, service )
name (required)

String. The string name of the popup to be shown. For the Social Popup plugin, use "social".

service (required)

String.

  • On iOS, this is the name of the social service popup to show. Supported values are "twitter", "facebook", or "sinaWeibo".

  • On Android, this is the package name of the social service you wish to check is installed on the device. For example, if you set this to "twitter", this function will check to see if any package names installed on the device contain the string twitter and, if a match is found, it will return true. If you don't care about checking for a specific service, and simply want to check if at least one is available, set this to "share".