Skip to content
On this page

Share Image

shareImage

Shares image to a specific scene.

Type

typescript
function shareImage(request: {src: string; scene: number}): Promise<boolean>;

Parameters

NameTypeRequiredDefault ValueDescription
srcStringYes/URL for the image to be shared.
sceneNumberYes/Share to Chat:
NativeWechatConstants.WXSceneSession
Share on Moments:
NativeWechatConstants.WXSceneTimeline
Shared to Favorites:
NativeWechatConstants.WXSceneFavorite

Example

typescript
import {shareImage, NativeWechatConstants} from 'native-wechat';

shareImage({
      url:'https://hector.im/logo.png',
      scene:NativeWechatConstants.WXSceneFavorite
})

Released under the MIT License.