Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get device id for Audience Network of Facebook in Flutter?

Using facebook_audience_network package of flutter I tried to integrate audience network ads to my app. But as soon as I initialize my app I get this error:

Rewarded Ad: RewardedVideoAdResult.ERROR --> {error_message: No fill, error_code: 1001, invalidated: true, placement_id: YOUR_PLACEMENT_ID}

According to the package:

For testing purposes you need to obtain the hashed ID of your testing device. To obtain the hashed ID:

Call FacebookAudienceNetwork.init() during app initialization. Place the FacebookBannerAd widget in your app. Run the app. The hased id will be in printed to the logcat. Paste that onto the testingId parameter.

FacebookAudienceNetwork.init(
  testingId: "37b1da9d-b48c-4103-a393-2e095e734bd6",
);

I have no idea how to get device Id, while I use real device as an emulator.

Anyone who can help?

like image 358
kamranbekirovyz Avatar asked Sep 06 '25 02:09

kamranbekirovyz


1 Answers

Maybe you solved it but if anyone else looking for the solution:

Check the Logcat in android studio, you'll see a test device id. Also if you put your ad code like this it will also show test ad:

IMG_16_9_APP_INSTALL#YOUR_PLACEMENT_ID

like image 79
MRN Avatar answered Sep 07 '25 21:09

MRN