问题
I can use the Facebook SDK for Android to login with Facebook and get user information. When doing this all of the code is in src/com.name/MainActivity.java
.
But when using Worklight, everything I code is in Worklight now, in assest/www/default
and nothing in MainActivity.java.
My question is, if I've used the Facebook SDK in MainActivity.java how can I use that in the Worklight app?
回答1:
First please familiarize yourself with creating Cordova plug-ins in Worklight (specifically, this training module and sample app).
That's how you should integrate your native code in a Worklight app, by using a Cordova plug-in.
Otherwise, there is also an official plug-in by Facebook for Cordova (which should be integrated in the same way as you learn in the training module).
来源:https://stackoverflow.com/questions/17637355/ibm-worklight-combine-facebook-sdk-java-code-in-worklight-application