Facebook Native ads in recycler view android

Pranay Airan picture Pranay Airan · Nov 25, 2015 · Viewed 10k times · Source

I am wondering if anyone has tried to integrate facebook audience network native ads in recycler view ??

Is there any simple solution like mopub recycler view adapter https://github.com/mopub/mopub-android-sdk/wiki/Native-Ads-with-Recycler-View for facebook audience network native ads ??

Answer

thuanle picture thuanle · Feb 21, 2017

I create a lib for loading Facebook Native Ad in Adapter.

https://github.com/ldt116/FBNativeAdAdapter

You can check the example

MyAdapter adapter = new MyAdapter();
FBNativeAdAdapter fbAdapter = FBNativeAdAdapter.Builder.with(PLACEHOLDER_ID, adapter).build();

RecyclerView rv = (RecyclerView) findViewById(R.id.rv);
rv.setAdapter(fbAdapter);
rv.setLayoutManager(new LinearLayoutManager(this));

Any idea or comments are welcome