UNPKG

ionic-native

Version:

Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support

71 lines 2.85 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { Plugin, Cordova } from './plugin'; /** * @name Instagram * @description Share a photo with the instagram app * * @usage * ``` * import {Instagram} from 'ionic-native'; * * Instagram.share('data:image/png;uhduhf3hfif33', 'Caption') * .then(() => console.log('Shared!')) * .catch((error: any) => console.error(error)); * * ``` */ export var Instagram = (function () { function Instagram() { } /** * 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 */ Instagram.isInstalled = function () { return; }; /** * 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 canvasIdOrDataUrl The canvas element id or the dataURL of the image to share * @param caption The caption of the image * @returns {Promise<any>} Returns a promise that resolves if the image was shared */ Instagram.share = function (canvasIdOrDataUrl, caption) { return; }; /** * Share a library asset or video * @param assetLocalIdentifier A local fileURI * @returns {Promise<any>} Returns a promise that resolves if the image was shared */ Instagram.shareAsset = function (assetLocalIdentifier) { return; }; __decorate([ Cordova({ callbackStyle: 'node' }) ], Instagram, "isInstalled", null); __decorate([ Cordova({ callbackStyle: 'node' }) ], Instagram, "share", null); __decorate([ Cordova({ callbackOrder: 'reverse' }) ], Instagram, "shareAsset", null); Instagram = __decorate([ Plugin({ pluginName: 'Instagram', plugin: 'cordova-instagram-plugin', pluginRef: 'Instagram', repo: 'https://github.com/vstirbu/InstagramPlugin' }) ], Instagram); return Instagram; }()); //# sourceMappingURL=instagram.js.map