floatinghotpot / cordova-plugin-facebookads

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

How to add multiple Native ads #35

Open Divyaadz opened 8 years ago

Divyaadz commented 8 years ago

Single Native ad is working, Thanks for nice plugin. I like to know how to create a multiple native ads in facebookads.

antonfire commented 8 years ago

Use separate ad ids

PeterVerm commented 6 years ago

Hi,

Do you use one ad instance (one clickarea) and exchange the ad id or do you use multiple ad instances such that you have to manage multiple click areas (for each ad one area)?

antonfire commented 6 years ago

I use a custom directive to generate multiple ad elements in a feed format, the click area for each one is set to follow the feed scroll using a jquery 'onScroll' event to check if the element is in view then provide the x,y source px location and width, height of the desired click area, when it moves out of view these params are set to 0,0,0,0. I'm assuming that the click area for each is unique in that multiple frames are created in Obj-C and so you could have multiple click areas on screen at the same time. My use case does not need this however so I have not tested this supposition.