Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native ads in UITableView with multiple sections

I have integrated mopub-ios-sdk native ads for UITableView from this guide in my application. It works fine only for my first section, but doesn't work for other sections. On server i added repeat value. How can I fix this problem?

P.S. this pull request haven't helped for me.

like image 792
Richard Mazkewich Avatar asked Sep 28 '22 07:09

Richard Mazkewich


1 Answers

I've found a dirty hack for current version mopub-ios-sdk(3.9.0). You can post your data(repeat value, and fixed path) on your server and then work with methods from class MPClientAdPositioning.

- (void)addFixedIndexPath:(NSIndexPath *)indexPath;

- (void)enableRepeatingPositionsWithInterval:(NSUInteger)interval;

You must independently calculate indexPath for your UITableView, where you insert your native ads. Here you need these methods:

- (NSInteger)numberOfSections;

- (NSInteger)numberOfRowsInSection:(NSInteger)section;

It was helpful for me. Maybe someone know better solution?

like image 168
Richard Mazkewich Avatar answered Oct 04 '22 22:10

Richard Mazkewich