Good morning Appery team,
I've done some digging around on old posts - and found code to do a 'Facebook' like....
I've simply added this code (found in an old post) to an HTML element - and - it works great.... (the like is to like my client's facebook page)...
// -- iframe src="http://www.facebook.com/plugins/like...." scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:45px; width:200px;" allowTransparency="true"--/iframe--'
Replace my -- with '' as needed
The buttons will also do a share - which is great.
However, like most clients - we'd like to offer people who like us - an incentive, so we'd like to go out to facebook and validate that they've in fact liked us - before we post a credit to their account....
SO! - I've found a plugin to do this work:
https://github.com/Wizcorp/phonegap-f...
And the lookup process - and receipt of the data is described here:
https://github.com/Wizcorp/phonegap-f...
just a few lines down....:
When you display your page / button you have to call the getLoginStatus method first to know if the current user is connected to its Facebook account. If he is connected then call GET https://graph.facebook.com/me/og.like... with the Facebook Access Token returned by the getAccessToken method (if this returns data then style your like button with a red heart for example, a grey heart if the call returns an empty array).
So - I know you folks will not normally support plugins - but - I think the process of posting a like - and then ensuring the user has indeed liked it - is reasonably publicly needed here - so I thought I'd ask.
The gotcha is during install of this plugin - I get this error:
====================================================
Failed to install 'com.phonegap.plugins.facebookconnect':Error: Variable(s) missing: APP_ID, APP_NAME
at /usr/lib/node_modules/plugman/node_modules/cordova-lib/src/plugman/install.js:324:23
at fulfilled (/usr/lib/node_modules/plugman/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/lib/node_modules/plugman/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/lib/node_modules/plugman/node_modules/q/q.js:749:13)
at /usr/lib/node_modules/plugman/node_modules/q/q.js:557:44
at flush (/usr/lib/node_modules/plugman/node_modules/q/q.js:108:17)
at process.tickCallback (node.js:442:13)
stderr: Variable(s) missing: APP_ID, APP_NAME
====================================================
.
The docs for the plugin address this by telling you:
To install the plugin in your app, execute the following (replace variables where necessary):
Create initial Cordova app$ cordova create myApp
$ cd myApp/
$ cordova platform add ios
$ cordova -d plugin add /path/to/cloned/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myApplication"
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Is there any way to address this prior to installation in Appery in the source?? or does this error make the plugin - non-usable from Appery??
best,
Bruce