Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Instagram

Improve this doc

Share a photo with the instagram app

Repo: https://github.com/vstirbu/InstagramPlugin

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-instagram-plugin
    $ npm install --save @ionic-native/instagram@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { Instagram } from '@ionic-native/instagram';

constructor(private instagram: Instagram) { }

...

this.instagram.share('data:image/png;uhduhf3hfif33', 'Caption')
  .then(() => console.log('Shared!'))
  .catch((error: any) => console.error(error));

Instance Members

isInstalled()

Detect if the Instagram application is installed on the device.

Returns: Promise<boolean|string> Returns a promise that returns a boolean value if installed, or the app version on android

share(canvasIdOrDataUrl, caption)

Share an image on Instagram Note: Instagram app stopped accepting pre-filled captions on both iOS and Android. As a work-around, the caption is copied to the clipboard. You have to inform your users to paste the caption.

Param Type Details
canvasIdOrDataUrl

The canvas element id or the dataURL of the image to share

caption

The caption of the image

Returns: Promise<any> Returns a promise that resolves if the image was shared

shareAsset(assetLocalIdentifier)

Share a library asset or video

Param Type Details
assetLocalIdentifier

A local fileURI

Returns: Promise<any> Returns a promise that resolves if the image was shared

API

Native

General