Hello
Did anyone manage to implement facebook plugin on release?
Release version is doing minification of js files and than facebook plugin cant get initialized.
On Debug it works fine.
Did anyone manage to run it?
Hello
Did anyone manage to implement facebook plugin on release?
Release version is doing minification of js files and than facebook plugin cant get initialized.
On Debug it works fine.
Did anyone manage to run it?
I have the same problem ?
Error from console :
Uncaught ReferenceError: FB is not defined
Part of code :
plugin.extend("facebook",{name:"",version:"",qk:null,oz:!1,osb:{GET:"get",POST:"post",DELETE:"delete"},zsa:0,Aqb:{ACTIVATED_APP:FB.zf.pm.bqb,COMPLETED_REGISTRATION:FB.zf.pm.QPa,VIEWED_CONTENT:
Some of the JS library will not working properly after compiled with Google Closure as the compiler rename the function in advanced mode.
I have found that we can pass in “extern” file to the compiler but i can’t find the way to do it with Cocos Console.
But I have success modify Parse Javascript SDK to work in Advanced Compilation but not sure is it the proper way. It use “underscore” library which would not work in advanced mode.
The modification would be troublesome because i can’t find guide on how to do this properly.
Although, i make the app run on web successfully.
Basically, i adding this before the line of a function to prevent compiler rename it.
/** @expose */
_.toArray = function(obj) {
Second modification is changing
object.key to object["key"]
This prevent key renamed to other as object["key"] become object.key but object.key may become object.ab
Then to prevent compiler remove “unused” function, you have to add
window["functionName"] = functionName;
after that function to tell compiler the function is not unused even you have use it in other files.
Hope this can help you to find a better way to make it work.
Thanks @Zinitter i tried to do it with facebook plugin, but it doesn’t work yet
.
If i find solution, i will post it here.
You may have a look on Google Closure Advanced Compilation guide
https://developers.google.com/closure/compiler/docs/api-tutorial3