android / privacy-sandbox-samples

Apache License 2.0
135 stars 56 forks source link

Attribution API fails on MeasurementSampleApp - Caller is not authorized #56

Closed ozadi3 closed 1 year ago

ozadi3 commented 1 year ago

Hi, We're trying to test the attribution API using:

On both cases, after following all the steps in the documentation, including running: adb shell device_config put adservices mdd_measurement_manifest_file_url "{ENROLLMENT_URL}"

After pressing the register click/view event buttons ends without any action, and we don't get data fired into the server URL we configured.

Logcat shows the following error: com.google.android.adservices.api E Caller is not authorized.

We follow some instructions on closed issues that look similar, like: https://github.com/android/privacy-sandbox-samples/issues/23 without success

Anything we're missing?

shen714 commented 1 year ago

We are also being blocked by the exact same issue on both developer preview and beta release. Wondering how could we further debug on this.

Appreciate for any guidance!

jose4gonzalez commented 1 year ago

This document encompasses the issues here and mitigation guidance https://docs.google.com/document/d/1TkPBsv498g0aCcPyTa8BSfxfYJBuJERiIOp29ufPjWs/edit?resourcekey=0-xxW5S4nmWwmokFX6xOEblw

Here is also a related bug https://buganizer.corp.google.com/issues/265648182

erintwalsh commented 1 year ago

Hi @ozadi3 and @shen714,

Would you mind following these steps and then try calling the API again?

  1. Make sure all necessary permissions are declared in the AndroidManifest as shown on lines 17, 18, and 19 here

  2. Reset your allow list by running the commands

    • adb shell device_config delete adservices ppapi_app_allow_list

Note: you will need to use the 'put' command for each app package name you are testing with.

shen714 commented 1 year ago

Hi @erintwalsh, thanks for the guidance, but I am still seeing the same error : (. Hi @ozadi3, I am wondering if you have resolved this issue. If yes, could you please let me know what you have changed. Really appreciated!

ozadi3 commented 1 year ago

Hi @shen714 The latest suggestions didn't work for us as well. We experience the same error as before

erintwalsh commented 1 year ago

Hi @shen714 and @ozadi3, we have recently pushed a new update to the sample app. Would you mind trying again and making sure the URLs entered match the ones registered during enrollment? Thank you!!

ozadi3 commented 1 year ago

Hi, We're able to get the source and trigger events while using real device/emulator with the preview of Android UpsideDown Cake. Just to verify - There is a time difference (~1hr) between calling register_source & register_trigger and the time the servers actually gets the POST requests - is it by design?

erintwalsh commented 1 year ago

@ozadi3 that's great to hear! Yes, the timing is intentional, and will be shortened with the next release. You can also run this command to send the requests faster - adb shell cmd jobscheduler run -f com.google.android.adservices.api 15