Phonegap's Facebook Connect plugin - making it work with web app as well as native apps? - facebook

I've got the FB Connect plugin working with my Phonegap project native apps, but now I'm wondering what the workflow is for making it work with the web-app version.
When I run the web-app version, I get the standard Phonegap FB Connect errors, the last one being 'FB variable does not exist. Check that you have included the Facebook JS SDK file.' - this makes sense, as my web app doesn't have those js files, as they get injected during the PG Build process.
So what is the typical way of moving forward at that point? Can I use that last error as a way of determining 'ok, this is the web-app version, not native', and then what do I do next? Should have the Facebook SDK installed on my web-app?
Cheers

The git repo has steps for including the plugin in web app
Web App
www/js/facebookConnectPlugin.js contains the JavaScript SDK and API file. The API matches as close as possible to the native APIs.
Setup Web App Example
Host the www folder on a server and configure your Facebook dashboard correctly to test the Web APIs. Most people use Parse for easy testing.
NOTE : Developers should call facebookConnectPlugin.browserInit() before login - Web App ONLY
https://github.com/phonegap/phonegap-facebook-plugin

Related

How to find my test Facebook Messenger App

I have a FB Messenger app and created a test app for me to point at my development server (using ngrok for the webhook). As far as I can tell, everything is set up for me to be able to access the test app following the instructions here:
https://developers.facebook.com/docs/apps/test-apps
However, I can only find the public production version of my chatbot on my FB messenger app. How can I find the test version so that I can play around with my dev server?

Phonegap Build using Phonegap Facebook Plugin

I'm using PhoneGap Build. I'm using this plugin here: https://github.com/Wizcorp/phonegap-facebook-plugin only to add install tracking for a Facebook ad I have setup for mobile ads when people install the app after clicking the mobile Facebook ad.
In the Facebook SDK here under "4. Enable Install Tracking": https://developers.facebook.com/docs/app-ads/sdk
it says: "To enable install tracking call the App Events logger once your application becomes active."
In this plugin's README under Events, it says:
"Activation events are automatically tracked for you in the plugin."
Does this mean that there is no code to write, that once I only have to add the plugin to the config xml and it will automatically call FB.AppEvents.activateApp() ?
I have attempted to call FB.AppEvents.activateApp() manually using the Facebook SDK for Javascript but get an error AppEvents undefined.
If you look at the Facebook JS SDK documentation you'll find that it says...
Note: App Launches and App Installs are now logged automatically. It's no longer necessary to call activateApp to log those events.
https://developers.facebook.com/docs/reference/javascript/FB.AppEvents.LogEvent
So the readme for that plugin is correct to say it is automatic.

Worklight Facebook platform selection?

For Facbook integration in Worklight which platform should we select Android or Website
,
right now i am developing for android environment but later i will be doing for iphone and windows as well
Also were do i place the Facebook integration code in index.html(main) or in android project which is separately created ?
i am confused do reply
It looks like you are developing a Worklight-based Hybrid application, so in this case you should actually opt for the Facebook JavaScript SDK.
You can add it to your common\js folder and reference it in the common\index.html (just follow the instructions Facebook probably provides). This way you could easily 'extend' it to whichever additional environments you will add in Worklight Studio in your project setup.
Of course, you can also choose to use Facebook's native SDKs for each environment in your Hybrid application. In this case, you'll need to add the SDK in the iphone-ipad-or-android\native folder and follow Facebook's integration instructions (note that for iPhone the actual integration will be done in Xcode, not Eclipse).
If you choose to create a native application and bundle it with the Worklight SDK, then you should opt for the Facebook SDK dedicated to the specific OS. Here, you will add the SDK, again, by following Facebook's instructions.

Call phonegap plugin function within web app

i am building my first phonegap app and when i open the app i instantly redirecting (window.location) the user to my server where my web app is hosted. Is it possible to load the phonegap plugins from there? Because the "deviceready" event is not firing and i cannot call any plugin functions.
I can confirm that loading remotely does appear to allow access to native components (when scripts are properly loaded) and that cordova.jsdoes not appear to need to be loaded by the local index.html bootstrap.
Short answer: Yes
Some 'gotcha's'
You will have to supply correct cordova.js version for the platform browsing to your site.
you can look here for more info https://github.com/apache/cordova-js. This project hosts the core js elements, and builds the platform specific cordova.js lib
Any plugin api's your app wants to interact with must be pre-installed into the Native App
any plugin with native code will have to be added to the project and deployed to device bundled inside the app. There is no way to lazyload native code. The js portions of the plugin could be hosted on your server, however.
More information, some apps that do this
The PhoneGap Developer App uses a similar technique to what is describe above and what you want. The only difference is that it is meant as a dev tool, and the server is a local dev machine.
The Cordova App Harness also uses this technique of pre-bundling an app package with plugins, to be consumed by remotely hosted resources
You cannot, deviceready only functioning if the app run on mobile phone environment only. If web based or dekstop application, it won't trigger.
No , dont do that . loading remote website will not able to intract with your plugins . and the app will get rejected on istore too

How to deploy Play! app to Google App Engine?

Via the Google app engine Eclipse plugin
If I need to create a web app first, how do I convert the google web app to a play project?
If I need to create a play project first, how do I convert the play project to a google web app?
Via command line and gae-module for play
If I use the this command play gae:deploy --gae=C:/appengine-sdk I get Http connection timeouts. It is not my firewall, because I can deploy a hello world google web app via the google eclipse plugin.
I've tried all three methods, and I still can't deploy my play project to google app engine.
I don't know about the Google App Engine plugin, but i managed to get it working through the command line. Apparently the problem was that although I disabled my firewall, it was still running a process that blocked the deployment without prompting. Fixed that