How to install Facebook SDK for App Ads in Ionic project?

I’m working on an Android project where by I want to add Facebook SDK for App Ads inside it. I read the docs and Getting Started Android SDK docs but I couldn’t understand it because I don’t have native programming knowledge.

Can someone please show me a tutorial or step-by-step guide how to add Facebook SDK for App Ads inside Ionic Android project?


Thanks for the link @bengtler. But I couldn’t find any examples on how to activate the Facebook SDK for App Ads inside the docs page. Could you share some example?

I do not know how this works, but in the docs to facebook API they are mentioned that you can use the javascript sdk.
Maybe you use a cordova plugin as alternative:

Thanks @bengtler for pointing that out. I found some solutions on Stackoverflow:

The plugin inside the link you’ve shared is not what I want. That plugin is for adding ads in mobile app actually.

What I’m looking for right now is, the plugin that can help me track my app installs via Facebook Ads. But nevermind, I’ll do some more research about this. Thanks for helping. Really appreciate it!

1 Like

@zulhfreelancer a tip from Stackoverflow funcionoun for you?
I’m having this same problem to 1 month :’(

Still couldn’t find any simple solution for that. :cry:

I’m in the same situation. Any update about it?

Any update about this?

im also having exactly the same problem , did someone found any solution for this?

I think this plugin will be helpful to integrate facebook sdk in android and ios both:

1 Like

Ok, so has anyone successfully got Ionic2 and the Facebook AD SDK working (ie. tracking ads so you can tell how effective your facebook ad campaign is for driving mobile installs?)

1 Like

Yep. I used ngx-facebook in Ionic 2 and it worked like a charm!

  1. index.html -> include FB SDK:

script type=“text/javascript” src=“

  1. yourPage.ts ->

constructor(private fb: FacebookService);
const initParams: InitParams = {
appId: ‘yourAppId’,
xfbml: true,
version: ‘v2.8’

Of course, you have to register the FacebookService as a provider in your app.module.ts

can u share the whole code??

This does it all: Facebook Connect Plugin | Facebook Docs in Ionic Documentation

App Installs are tracked for you automatically, just go to Facebook Analytics -Redirecting...

You can add custom events too.

Please can I have all the code you used, I have been looking a way to integrate Social media sharing into an ionic app. The one in Ioinc component is not reliable. And as a newbie in Ioinc I can’t see from you code a way to implement it