@emish89/instagram-sharer
v1.0.0
Published
Share an image as Instagram story - Capacitor Plugin
Maintainers
Readme
instagram-sharer
Instagram share on stories capacitor plugin.
You can share your images as IG story with new Open Graph API that needs the Facebook App ID.
Install
npm install @emish89/capacitor-instagram-sharer
npx cap syncand put in the Info.plist file :
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
<string>instagram-stories</string>
</array>and in the AndroidManifest.xml :
<queries>
<package android:name="com.instagram.android" />
</queries>Sample Usage
await InstagramSharer.shareToStory({
imageBase64: base64String,
appId: facebookAppId(),
});API
shareToStory(...)
shareToStory(options: { imageBase64: string; appId: string; }) => Promise<void>| Param | Type |
| ------------- | ---------------------------------------------------- |
| options | { imageBase64: string; appId: string; } |
Build in local
run this to set the env variables
export ANDROID_HOME="$HOME/Library/Android/sdk"
export ANDROID_SDK_ROOT="$ANDROID_HOME"
export PATH="$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools"then run the build or publish
npm run verifyPublishing
To publish this package to npm:
- Make sure you are logged in:
npm login(use OTP if your account has 2FA). - Run a dry run to verify what will be published:
npm publish --dry-run --access public- Publish the package (for scoped packages use
--access public):
npm publish --access publicIf you use CI, create an automation token on https://www.npmjs.com/ (Account → Access Tokens) and set it as NPM_TOKEN in your pipeline. For more details see the npm documentation.
