VKBridge class abstract
Contact for interacting with VK Mini Aps platform Original VK documentation here: https://vk.com/dev/vk_bridge_events
Constructors
- VKBridge()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- launchHash → String
-
When starting the service, an additional hash parameter can be passed to
the URL specified in the application control
no setter
- launchParams → LaunchParams
-
When the service is started, additional parameters are passed to the URL
specified in the application control, containing data about the user and
the source of launch
no setter
-
locationChangedStream
→ Stream<
VKWebAppLocationChanged> -
The event occurs when the hash value changes
after the # character in the browser address bar.
For example, this happens as a result of using the back and forward
buttons in the browser.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
updateConfigStream
→ Stream<
VKWebAppUpdateConfig> -
Stream with VKWebAppUpdateConfig events:
The client dispatches a
VKWebAppUpdateConfig
event to the application with information about the theme being used in the following cases:no setter -
viewHideStream
→ Stream<
VKWebAppViewHide> -
After minimizing the service, the client dispatches an event
with VKWebAppViewHide with an empty data field.
no setter
Methods
-
addToCommunity(
) → Future< VKWebAppAddToCommunityResult> -
VKWebAppAddToCommunity
calls the community selection window for installing the service. -
addToFavorites(
) → Future< VKWebAppBoolResult> -
VKWebAppAddToFavorites
invokes a request window for adding a service to favorites. -
addToHomeScreen(
) → Future< VKWebAppBoolResult> -
Calling the
VKWebAppAddToHomeScreen
event allows you to add VK Mini Apps to the device screen. -
addToHomeScreenInfo(
) → Future< VKWebAppAddToHomeScreenInfoResult> -
Calling the
VKWebAppAddToHomeScreenInfo
event allows you to get information about adding a shortcut to the device's home screen. -
allowMessagesFromGroup(
{required int groupId, String? key}) → Future< VKWebAppBoolResult> -
VKWebAppAllowMessagesFromGroup
allows you to request permission from the user to send messages on behalf of the community. -
allowNotifications(
) → Future< VKWebAppBoolResult> -
VKWebAppAllowNotifications
allows you to ask the user for permission to send notifications from the app. -
checkNativeAds(
AdFormat adFormat, {bool? useWaterfall}) → Future< VKWebAppBoolResult> -
Checks if there are ads available for display in the specified format
adFormat
- type of advertisementuseWaterfall
- Only for adFormat = reward. Whether to use the interstitial advertising mechanism when there is no rewarded video -
close(
{String? status, Object? payload}) → Future< VKWebAppOpenAppResult> -
VKWebAppClose
If the application was launched using theVKWebAppOpenApp
event, then the parent application will receive the VKWebAppOpenAppResult event when VKWebAppClose is called. -
copyText(
String text) → Future< VKWebAppBoolResult> -
Raising the
VKWebAppCopyText
event allows you to copy text to the clipboard. -
denyNotifications(
) → Future< VKWebAppBoolResult> -
VKWebAppDenyNotifications
allows you to disable notifications from an app. -
donutIsDon(
{required int ownerId, required String accessToken, double version = 5.131}) → Future< DonutIsDonResult> -
Returns information about whether the user is subscribed to paid content (is a don)
ownerId
- community identifieraccessToken
- token from getAuthToken with Scope.groups scopeversion
- query version -
downloadFile(
{required String url, required String filename}) → Future< VKWebAppBoolResult> -
Raising the
VKWebAppDownloadFile
event allows you to download a file to the device. -
flashGetInfo(
) → Future< VKWebAppFlashGetInfoResult> -
VKWebAppFlashGetInfo
asks for information about the flashlight. -
flashSetLevel(
int level) → Future< VKWebAppBoolResult> -
VKWebAppFlashSetLevel
sets the brightness level of the flashlight. -
getAds(
) → Future< VKWebAppGetAdsResult> - Getting adblock data
-
getAuthToken(
{required int appId, required List< Scope> scope}) → Future<VKWebAppGetAuthTokenResult> -
VKWebAppGetAuthToken
allows you to request access rights from the user and get a key to work with the API. At the same time, you do not need to request a token to identify a user in the service. Use the signature of the launch parameters for this -
getClientVersion(
) → Future< VKWebAppGetClientVersionResult> -
VKWebAppGetClientVersion
returns the version number of the official VK application. -
getCommunityToken(
{required int appId, required int groupId, required String scope}) → Future< VKWebAppCommunityAccessTokenResult> -
VKWebAppGetCommunityToken
allows you to request access rights and get a key to work with the API on behalf of the community. Only the community administrator can obtain a community access token. -
getEmail(
) → Future< VKWebAppGetEmailResult> -
VKWebAppGetEmail
allows you to get the user's email address. After the call, it displays a screen asking for permission to access e-mail. -
getFriends(
[bool multi = false]) → Future< VKWebAppGetFriendsResult> -
VKWebAppGetFriends
brings up a selection window from the friends list. -
getGeodata(
) → Future< VKWebAppGetGeodataResult> -
VKWebAppGetGeodata
allows you to get data about the user's geolocation. The event takes no parameters. The official app shows a window asking for permission to transfer location. -
getGroupInfo(
int groupId) → Future< VKWebAppGetGroupInfoResult> -
VKWebAppGetGroupInfo
allows you to get information about the group. -
getPersonalCard(
List< String> type) → Future<VKWebAppGetPersonalCardResult> - "Contact card" is the place where the user indicates contact information (phone number, address, e-mail), which he is ready to share with third-party services.
-
getPhoneNumber(
) → Future< VKWebAppGetPhoneNumberResult> -
Calling the
VKWebAppSendToClient
event allows you to send a notification to open a service on a mobile device. -
getUserInfo(
) → Future< VKWebAppGetUserInfoResult> -
VKWebAppGetUserInfo
allows you to get basic data about the current user profile. -
init(
) → Future< VKWebAppBoolResult> -
VKWebAppInit
- the first event that your application must send to the official application to start working with VK Bridge. Otherwise, the service may not work on iOS and Android mobile clients. -
joinGroup(
int groupId) → Future< VKWebAppBoolResult> -
VKWebAppJoinGroup
allows the user to join the community. -
leaveGroup(
int groupId) → Future< VKWebAppBoolResult> -
VKWebAppLeaveGroup
allows the user to log out of the community. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openApp(
{required int appId, String location}) → Future< VKWebAppBoolResult> -
VKWebAppOpenApp
allows you to open another app from the current VK Mini Apps. -
openCodeReader(
) → Future< VKWebAppOpenCodeReaderResult> -
VKWebAppOpenCodeReader
allows you to open the camera to read the QR code and get the scan result. -
openContacts(
) → Future< VKWebAppContactsDone> -
VKWebAppOpenContacts
opens a window for selecting contacts from the phone book on the user's device. -
openWallPost(
{required int ownerId, required int postId}) → Future< VKWebAppBoolResult> -
Opens in a separate window the entry with the
postId
identifier, published on the wall of the user or community with theownerId
identifier.ownerId
- The ID of the community (negative number) or user (positive number) on whose wall the entry was publishedpostId
-The ID of the entry on the wall (a positive number)version
- query version -
resizeWindow(
{required int width, required int height}) → Future< VKWebAppResizeWindowResult> -
VKWebAppResizeWindow
initiates a change in the width and height of the IFrame. -
scroll(
{required int top, int speed = 0}) → Future< VKWebAppScrollResult> -
VKWebAppScroll
initiates vertical scrolling of the browser window. -
sendToClient(
[String? fragment]) → Future< VKWebAppBoolResult> -
Calling the
VKWebAppSendToClient
event allows you to send a notification to open a service on a mobile device. -
setLocation(
String location) → Future< VKWebAppBoolResult> -
VKWebAppSetLocation
allows you to set a new hash value (hash string after https://vk.com/app23456#, used for navigation within the application). -
setLogger(
Logger logger) → void -
Set the
logger
as logger The package can print debug and error logs at runtime -
setSwipeSettings(
bool history) → Future< VKWebAppBoolResult> -
VKWebAppSetSwipeSettings
enables the standard browser swipe behavior on the client. -
setViewSettings(
{required StatusBarStyle statusBarStyle, String? actionBarColor, }) → Future< VKWebAppBoolResult> -
VKWebAppSetViewSettings
-
VKWebAppShare
allows you to share a link. -
showCommunityWidgetPreviewBox(
{required int groupId, required String type, required String code}) → Future< VKWebAppBoolResult> -
Raising the
VKWebAppShowCommunityWidgetPreviewBox
event brings up the community widget preview screen. Community app widgets have a separate guide. ( https://vk.com/dev/apps_widgets ) -
showImages(
List< String> images, {int? startIndex}) → Future<VKWebAppBoolResult> -
VKWebAppShowImages
opens the native screen for viewing images. -
showNativeAds(
AdFormat adFormat, {bool? useWaterfall}) → Future< VKWebAppBoolResult> -
Shows full-screen ads to the user
adFormat
- type of advertisementuseWaterfall
- Only for adFormat = reward. Whether to use the interstitial advertising mechanism when there is no rewarded video -
showOrderBox(
String item) → Future< VKWebAppBoolResult> -
Opens a virtual value purchase window in a game or mini-app
item
- virtual value -
showStoryBox(
ShowStoryBoxOptions options) → Future -
VKWebAppShowStoryBox
opens the story editor -
showWallPostBox(
String message) → Future< VKWebAppShowWallPostBoxResult> -
VKWebAppShowWallPostBox
allows the user to post to the wall. -
storageGet(
List< String> keys) → Future<VKWebAppStorageGetResult> -
VKWebAppStorageGet
returns the values of the variables, the names of which were passed in the keys parameter. -
storageGetKeys(
{int? count, int offset = 0}) → Future< VKWebAppStorageGetKeysResult> -
Call
VKWebAppStorageGetKeys
returns the names of all variables. -
storageSet(
{required String key, String? value}) → Future< VKWebAppBoolResult> -
The
VKWebAppStorageSet
call stores the value of the variable whose name is passed in the key parameter. -
subscribeStoryApp(
{required int storyOwnerId, required int storyId, required int stickerId, String? accessKey}) → Future< VKWebAppSubscribeStoryAppResult> - VKWebAppSubscribeStoryApp allows the current user to subscribe to updates from an app in history. After successful completion, you can send a notification to the user about the reaction to the story using the stories.sendInteraction method. (https://vk.com/dev/stories.sendInteraction)
-
tapticImpactOccurred(
TapticStyle style) → Future< VKWebAppBoolResult> - The event to call impactOccurred (https://developer.apple.com/documentation/uikit/uiimpactfeedbackgenerator/2374287-impactoccurred) in the Taptic Engine.
-
tapticNotificationOccurred(
TapticType type) → Future< VKWebAppBoolResult> - An event for calling notificationOccurred (https://developer.apple.com/documentation/uikit/uinotificationfeedbackgenerator/2369826-notificationoccurred) in the Taptic Engine.
-
tapticSelectionChanged(
) → Future< VKWebAppBoolResult> - The event to call selectionChanged (https://developer.apple.com/documentation/uikit/uiselectionfeedbackgenerator/2374284-selectionchanged) on the Taptic Engine.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited