Sharing
Configure share content for the user's share action and report business events for ad model optimization.
TTMinis.share(callback, options)
Triggers a share action. This API does not open the TikTok share panel; it configures the share content that will be used when the user taps the share button. This is similar to the onCopyUrl pattern in other platforms.
Parameters
Field | Type | Description | Required |
|
| The share title. | Yes |
|
| The share description. | No |
|
| The share image URL. | No |
|
| Custom share query parameters. | No |
Callback parameters
Field | Type | Description |
|
| Whether the share setup succeeded. |
|
| Returned on failure. |
Example
TTMinis.share(
function (res) {
if (res.error) {
console.error('share failed', res.error);
return;
}
console.log('share success');
},
{
title: 'Short Drama',
desc: 'Watch the latest episode now',
imageUrl: 'https://example.com/share-cover.png',
query: {
episodeId: 'ep_1001',
from: 'share_button',
},
},
);TTMinis.reportEvent(options)
Reports a business event for ad model optimization. The reported events are used by the monetization platform to optimize ad targeting.
Parameters
Field | Type | Description | Required |
|
| The event name. | Yes |
|
| The event parameters. | Yes |
|
| Callback invoked when the report completes. | No |
Callback parameters
Field | Type | Description |
|
| Whether the report succeeded. |
|
| Returned on failure. |
Example
TTMinis.reportEvent({
eventName: 'drama_episode_play',
params: {
episodeId: 'ep_1001',
position: 1,
},
callback: function (res) {
console.log('reportEvent:', res);
},
});