The translation was generated automatically and may contain mistakes
Stories in the user profile
Users can share achievements and other information with friends in stories. Adding the ability to share history entries is a powerful tool for distributing a mini-app. Even if your service is not entertaining, we recommend using this mechanic.
For example, a mini-app might show a button that says “Tell” or “Share a story.” Clicking this button will open a history editor with text and a screenshot of the application.
Example of a history editor
The user can change the picture or text and publish the story in his profile. Your friends will see this post.
To encourage users to create stories, the app can offer virtual values for creating them.
Take advantage of the opportunities offered by the library.. VK Bridge .
The story can also be told through an event..
VKWebAppShare. Only available for Android apps.
How to implement
- 1.
Prepare one or more templates to make it easier for users to create a story from scratch.
Stories can include one or more images, videos, texts, buttons, and other visual elements.
- 2.
To show the story editor on the screen, call the event
VKWebAppShowStoryBoxLibraries VK Bridge . In the event settings, specify a picture or video, text and other visual elements.
Pay attention. Some types of stickers and design attributes may not be supported on the platform on which the user runs the mini-app. Take this into account when creating templates. We recommend developing different templates for different platforms.
Example event call
bridge.send('VKWebAppShowStoryBox', {
// Задаёт фон истории
"background_type": "image", // Тип фона — картинка
"url": "https://example.com/v850136098/story-1.jpg", // Адрес картинки
"locked": true, // Блокируем изменение размеров и положения фона
// Кнопка внизу истории для перехода в приложении
"attachment": {
"type": "url", // Тип объекта — ссылка
"text": "open", // Константа, которая определяет текст ссылки
// "open" —« Открыть»
// "game" —« Играть»
"url": "https://vk.com/app12345" // Адрес приложения
},
// Дополнительные изобразительные элементы
"stickers": [
// Текст в верхней части экрана
{"sticker_type": "native",
"sticker": {
"action_type": "text",
"action": { // Текст и его атрибуты
"text": "Купи?1?» классные стикеры",
"style": "classic",
"background_style": "none",
"selection_color": "#FF8080"
},
"transform": { // Определяет положение текста
"gravity": "center_top",
"translation_y": 0.25
}}
},
// Текст в нижней части экрана
{"sticker_type": "native",
"sticker": {
"action_type": "text",
"action": { // Текст и его атрибуты
"text": "в приложении« Стикер дня»!",
"style": "classic",
"background_style": "none",
"selection_color": "#40FFF0"
},
"transform": { // Определяет положение текста
"gravity": "center_bottom",
"translation_y": -0.25
}}
}]
})
.then( (data) => {
// История размещена...
})
.catch( (e) => {
console.log("Ошибка!", e);
})If you have a VK Bridge library hTML code of the page , use the object name in the call vkBridge instead of bridge .
Features of use
- •If you create multiple stories, they will be displayed sequentially one after another.
- •In Classmates, you can publish only 1 moment per day.
- •Default stories and moments published through the event
VKWebAppShowStoryBoxavailable within 24 hours. At the same time, in the publication window, the user can set the display time - 48 hours. After the selected time, they are automatically deleted. - •Event
VKWebAppShowStoryBoxIt is not supported on iPad.
Content recommendations
- •
Think about possible story formats and offer users prepared templates with well-formulated phrases.
Please note that the story is published on behalf of the user. Texts should be written in the first person.
- •
Remember that many users who see the story probably don’t know anything about the mini-app yet. Therefore, images or text should give a basic idea of the application and its category.
- •
Provide a link or button so viewers can run the app from the story.
- •
When posting a story on behalf of a user, VK Mini Apps does not provide a separate permission, so remember that you are not allowed to use the app.. rules for hosting services And always make sure that the user knows exactly what will happen after pressing the button. Any posting without the user’s knowledge is a bad idea.
- •
Try to diversify the stories so that the user’s feed does not create a monotonous stream of messages and images. The minimal variability of texts and pictures will have a positive effect on the number of stories created and viewed.
Materials on the topic
- •
- •
- •