brawlins4
brawlins4

Reputation: 322

Instagram iOS Plugin for Cordova/Phonegap

Has anyone used the Instagram Plugin for Cordova/Phonegap (https://github.com/vstirbu/InstagramPlugin) and have a sample implementation they would be willing to share with me?

Upvotes: 1

Views: 2815

Answers (1)

Naresh Ramoliya
Naresh Ramoliya

Reputation: 828

I have tried in my phonegap application steps as below,

Pre requisite : Instagram App installed in your device.

if you have installed phonegap using node js then

its simple to add plugin to app

  1. add plugin : cordova plugins add https://github.com/vstirbu/InstagramPlugin

  2. add to your index.html page.

  3. you can test instagram installed or not using below code,

    Instagram.isInstalled(function (err, installed) { if (installed) { console.log("Instagram is installed"); } else { console.log("Instagram is not installed"); } });

  4. then share your image (you need to pass base64 or canvas id)

    Instagram.share(canvas_id or base64, function (err) { if (err) { alert("not shared"); } else { alert("shared"); } });

  5. it open device default sharing popup then select instagram to share and that it.

Note : After sharing on instagram not redirect to phonegap app back this is the major issue with it.

Upvotes: 1

Related Questions