floatinghotpot / cordova-plugin-facebookads

Cordova/PhoneGap plugin for Facebook Audience Network Ads
65 stars 71 forks source link

JS call to fire ad click event #33

Open theentirety opened 8 years ago

theentirety commented 8 years ago

With native ads, we have full control over the placement and style of the button that handles the click event. However, the plugin requires a scroll listener and a coordinates event to fire the click handler. It would be much more efficient and less weighty if there was a simple JS method that would directly call the fireAdEvent(EVENT_AD_LEAVEAPP, ADTYPE_BANNER); event. For example:

var clickHandler = document.getElementById('native_ad_button'); clickHandler.addEventListener('click', function() { FacebookAds.fireEvent(); });

If the coordinates are critical it could be updated to simply capture the x/y of the click event and pass that in as well.

unstableair commented 7 years ago

I would also love to see this feature. Is it technically feasible ?