Facebook Audience Network - on Android

Test ads are showing fine on iOS, but on android I have a problem. There is a runtime error;

ERROR: fbAudienceNetwork.init() device hashed id table is empty

Understand that I need to add the hash device ID for testing, but…

believe that on load the device hash ID will be outputted to the log, but the init comes first, so how will I get it, if the program crash before the .load ?

How to get hash device ID for testing?

It’s all in the docs… not a fun process but this is how F.A.N. does things:

https://docs.coronalabs.com/plugin/fbAudienceNetwork/init.html#overview

Best regards,

Brent

@prographodeveloper

It looks like you may be specifying the testDevices option, but leaving it empty when calling init(), which will not work.

The first time you build your app you have 2 options when calling init():

  1. Specify no testDevices: fbAudienceNetwork.init(adListener)

  2. Specify testDevices with at least one placeholder string: fbAudienceNetwork.init(adListener, { testDevices={“xxxx”} })

After you get the device hash from the device log you simply add it to the testDevices array.

Also please note that testDevices is an array of strings, and not just a simple string.

I am calling it exactly like this; 

fbAudienceNetwork.init(adListener, { testDevices={“xxxx”} })

still gives error.

Is anyone using this on Android?

I just tried to do a beta release without testDevices and it still gives the error; device hashed id table is empty – but it should be empty for going live - right?

FYI. You must use Corona build 2017.3049 or later to get the latest plugin.

bingo, thx

It’s all in the docs… not a fun process but this is how F.A.N. does things:

https://docs.coronalabs.com/plugin/fbAudienceNetwork/init.html#overview

Best regards,

Brent

@prographodeveloper

It looks like you may be specifying the testDevices option, but leaving it empty when calling init(), which will not work.

The first time you build your app you have 2 options when calling init():

  1. Specify no testDevices: fbAudienceNetwork.init(adListener)

  2. Specify testDevices with at least one placeholder string: fbAudienceNetwork.init(adListener, { testDevices={“xxxx”} })

After you get the device hash from the device log you simply add it to the testDevices array.

Also please note that testDevices is an array of strings, and not just a simple string.

I am calling it exactly like this; 

fbAudienceNetwork.init(adListener, { testDevices={“xxxx”} })

still gives error.

Is anyone using this on Android?

I just tried to do a beta release without testDevices and it still gives the error; device hashed id table is empty – but it should be empty for going live - right?

FYI. You must use Corona build 2017.3049 or later to get the latest plugin.

bingo, thx