Reputation: 322
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
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
add plugin : cordova plugins add https://github.com/vstirbu/InstagramPlugin
add to your index.html page.
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"); } });
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"); } });
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