更新时间:2022-12-22 13:32:55
我在插件实现中挖了一下,注意到 activateApp 我克隆了repo并为Android添加了功能[在 FB guide for android ]:
代码所需的修改是:插件中的代码更改和:如何在JS代码中使用。这样我可以调用
facebookConnectPlugin.activateApp(fb_success,fb_fail);
其中回调只是虚空函数。
并且FB是SDK跟踪,当有安装时。但我注意到,只有当设备上安装了FB应用程序时才会生成事件[不知道这是否应该是这样的]。
UPDATE
可能我的解决方案是旧的,我想现在的Facebook官方插件已经直接实现的功能,而不需要任何额外的定制在JS文件或触摸Java文件。 p>
Related question: How do I implement Facebook Mobile Install Ad tracking in Phonegap/Cordova project?
I have a working cordova/phonegap application. I would like to track the APP install using the plugin facebook. I installed the cordova facebook connect plugin with:
cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="myappid" --variable APP_NAME="myappname"
The plugin is installed and usable as this report 'true':
alert('fb plugin usable: ' + typeof facebookConnectPlugin != 'undefined')
However I am no seeing anything in the "Most recently logged events" in the facebook developer section for this app. I added the correct Package Name and Class Name in the settings but the events are not just showing up.
Is there anything that I am missing or more info that I can provide ? I cannot find a good tutorial on this that explains the full process.
Should the APP install event just be logged by adding the plugin without any JS call in the app?
I dug a bit in the plugin implementation and noted the activateApp was not implement at all. I cloned the repo and add the functionality for Android [following the FB guide for android ]:
The modifications required on the code are: code changes in plugin and : how to use in the JS code. In this way I can just call
facebookConnectPlugin.activateApp(fb_success, fb_fail);
where the callbacks are just dummy empty function.
and the FB is SDK tracks when there is an installation. I noticed however that the events are generated only when there is a FB app installed on the device [do not know if this is supposed to be like that].
UPDATE Probably my solution is old, I guess that now the official plugin for Facebook has already the feature implemented directly without the need of any additional customization in the JS files or touching the Java files.