Can't get device HASH ID from android devices. (Facebook Audience Network)

Hi,

I’m trying to use facebook audience network banner ad.

With iOS, it works successfully. I checked device hash ID for test, and now ‘test ad’ is shown.

But with android, I can’t get a device HASH ID from console log.

Please help.


Facebook Audience Network event: initialization successful with placementID: 58084050REMOVED08729981

I/Corona  (22684): banner

I/Corona  (22684): 580840REMOVED08729981

I/Corona  (22684): true

I/Corona  (22684): Error Code: 1001. Reason: No fill. We are not able to serve ads to this person. Please refer to https://developers.facebook.com/docs/audience-network/faq#a12. If you are integrating Audience Network for the first time, you can use test ads https://developers.facebook.com/docs/audience-network/testing.


 

 

Hi @junhyuncho,

Are you looking inside the Corona Simulator console for this? Instead, you need to check the device console log using the Android Debug Bridge (adb) logcat. This process is described in the following guide under “Device Debugging - Android”.

https://docs.coronalabs.com/guide/basics/debugging/index.html#consoledebugging

Best regards,

Brent

@Brent

That error message is from device console.

Did you read the notes for the “No fill” report on the following Facebook page? Apparently for testing, you may need to have the native Facebook app installed. However, this should not be required for serving live ads using the Corona plugin.

https://developers.facebook.com/docs/audience-network/testing

@Brent.

Thanks for your help.

After I install native facebook app, facebook ad is loaded successfully.

(Ad is successfully loaded but there’s no device HASH at the device console.

But at the facebook developer portal (facebook audience network - placement), the status of banner ad I made is ‘enabled for testing’.

So I guess(or hope) it is just OK to use without device HASH.

Can I see your basic code on how you’re calling init() and load() ?

Code below.


local function adListener_FB( event )

    – Successful initialization of the Facebook Audience Network

    if ( event.phase == “init” ) then

        print( "Facebook Audience Network event: initialization successful with placementID: " … placementID )

        fbAudienceNetwork.load( “banner”, placementID, “BANNER_HEIGHT_50” )

    – An ad loaded successfully

    elseif ( event.phase == “loaded” ) then  – The ad was successfully loaded

        print( event.type )

        print( event.placementId )

        – Show the ad

        fbAudienceNetwork.show( event.type, event.placementId, {y = screenH - 50}) – { yAlign=“bottom” } )

        transition.to (tabBar, { time=200, y = screenH - 75} )

print(“Facebook Ad loaded Successfully.”)

    elseif ( event.phase == “failed” ) then  – The ad failed to load

        print( event.type )

        print( event.placementId )

        print( event.isError )

        print( event.response )

        – show admob ad

        fbAudienceNetwork.hide( placementID )

        adType = “admob”

        showAd();

    elseif ( event.phase == “clicked” ) then  – The ad was clicked/tapped

        print( event.type )

        print( event.placementId )

    elseif ( event.phase == “closed” ) then  – The ad was closed (interstitial ads only)

        print( event.type )

        print( event.placementId )

    end

end

function initAds ()

– for Facebook Audience Network

if isAndroid then 

placementID = FBbannerPlacementID_android

else 

placementID = FBbannerPlacementID_iOS

end

local deviceHashID_junhyuniPhone6s = “4f1613XXXXXXXXXXXee092b91”

fbAudienceNetwork.init( adListener_FB ) 

end


current device console message

I/Corona  ( 1206): Facebook Audience Network event: initialization successful with placementID: 58084XXXXXXXXXX8729981

I/Corona  ( 1206): banner

I/Corona  ( 1206): 580840XXXXXXXXXXXXX8729981

I/Corona  ( 1206): Facebook Ad loaded Successfully.

@junhyuncho

Make sure you are not filtering your adb log output with the “Corona” log tag. The device hash does not output under that tag.

Also, search the log (un-filtered) for “hash”. That always finds it.

If your looking at the log via a terminal window, you might want to try using Android’s Monitor tool. Located under AndroidSDK_Install_Path > tools > monitor

It just makes viewing the log a little clearer and searching it a little easier visually also.

@Danny

I got the device hash ID (logcat without filtering corona), and now test ads are served. 

Thank you for your reply.

Hi @junhyuncho,

Are you looking inside the Corona Simulator console for this? Instead, you need to check the device console log using the Android Debug Bridge (adb) logcat. This process is described in the following guide under “Device Debugging - Android”.

https://docs.coronalabs.com/guide/basics/debugging/index.html#consoledebugging

Best regards,

Brent

@Brent

That error message is from device console.

Did you read the notes for the “No fill” report on the following Facebook page? Apparently for testing, you may need to have the native Facebook app installed. However, this should not be required for serving live ads using the Corona plugin.

https://developers.facebook.com/docs/audience-network/testing

@Brent.

Thanks for your help.

After I install native facebook app, facebook ad is loaded successfully.

(Ad is successfully loaded but there’s no device HASH at the device console.

But at the facebook developer portal (facebook audience network - placement), the status of banner ad I made is ‘enabled for testing’.

So I guess(or hope) it is just OK to use without device HASH.

Can I see your basic code on how you’re calling init() and load() ?

Code below.


local function adListener_FB( event )

    – Successful initialization of the Facebook Audience Network

    if ( event.phase == “init” ) then

        print( "Facebook Audience Network event: initialization successful with placementID: " … placementID )

        fbAudienceNetwork.load( “banner”, placementID, “BANNER_HEIGHT_50” )

    – An ad loaded successfully

    elseif ( event.phase == “loaded” ) then  – The ad was successfully loaded

        print( event.type )

        print( event.placementId )

        – Show the ad

        fbAudienceNetwork.show( event.type, event.placementId, {y = screenH - 50}) – { yAlign=“bottom” } )

        transition.to (tabBar, { time=200, y = screenH - 75} )

print(“Facebook Ad loaded Successfully.”)

    elseif ( event.phase == “failed” ) then  – The ad failed to load

        print( event.type )

        print( event.placementId )

        print( event.isError )

        print( event.response )

        – show admob ad

        fbAudienceNetwork.hide( placementID )

        adType = “admob”

        showAd();

    elseif ( event.phase == “clicked” ) then  – The ad was clicked/tapped

        print( event.type )

        print( event.placementId )

    elseif ( event.phase == “closed” ) then  – The ad was closed (interstitial ads only)

        print( event.type )

        print( event.placementId )

    end

end

function initAds ()

– for Facebook Audience Network

if isAndroid then 

placementID = FBbannerPlacementID_android

else 

placementID = FBbannerPlacementID_iOS

end

local deviceHashID_junhyuniPhone6s = “4f1613XXXXXXXXXXXee092b91”

fbAudienceNetwork.init( adListener_FB ) 

end


current device console message

I/Corona  ( 1206): Facebook Audience Network event: initialization successful with placementID: 58084XXXXXXXXXX8729981

I/Corona  ( 1206): banner

I/Corona  ( 1206): 580840XXXXXXXXXXXXX8729981

I/Corona  ( 1206): Facebook Ad loaded Successfully.

@junhyuncho

Make sure you are not filtering your adb log output with the “Corona” log tag. The device hash does not output under that tag.

Also, search the log (un-filtered) for “hash”. That always finds it.

If your looking at the log via a terminal window, you might want to try using Android’s Monitor tool. Located under AndroidSDK_Install_Path > tools > monitor

It just makes viewing the log a little clearer and searching it a little easier visually also.

@Danny

I got the device hash ID (logcat without filtering corona), and now test ads are served. 

Thank you for your reply.