mahnuh / capacitor-plugin-app-tracking-transparency

Capacitor plugin to request user authorization to access app-related data for tracking the user or the device.
MIT License
33 stars 10 forks source link

Not getting status on permission clicked, received status before the click. #18

Closed vipinsaini0 closed 6 months ago

vipinsaini0 commented 7 months ago

Bug Report

Plugin version: [ ] 1.x [x] 2.x

Capacitor version: [ ] 2.x [x] 3.x

Current behavior:

the following getting before click any option ⚡️ TO JS {"status":"denied","value":"00000000-0000-0000-0000-000000000000"} ⚡️ TO JS {"status":"unrequested","value":"00000000-0000-0000-0000-000000000000"}

and on click no status received.

Expected behavior:

On click option, allow or not allow at that movement need to receive status, so according to that we can handle other process

Steps to reproduce:

once show default alert just wait 10 second and click any option, nothing receive.

Related code:

insert short code snippets here

Other information:

Ionic info:

insert the output from ionic info here
mahnuh commented 6 months ago

Please provide a repository where the issue is reproducible. Otherwise I won't be able to help.

vipinsaini0 commented 6 months ago

https://github.com/mahnuh/capacitor-plugin-app-tracking-transparency

mahnuh commented 6 months ago

I need a repo where you use this plugin and where I can reproduce the issue, not a link to the plugin repo...

vipinsaini0 commented 6 months ago
import {
  AppTrackingTransparency,
  AppTrackingStatusResponse,
} from 'capacitor-plugin-app-tracking-transparency';

...

public async getStatus(): Promise<AppTrackingStatusResponse> {
  const response = await AppTrackingTransparency.getStatus();

  console.log(response);
  // { status: 'authorized' } for example

  return response;
}

public async requestPermission(): Promise<AppTrackingStatusResponse> {
  const response = await AppTrackingTransparency.requestPermission();

  console.log(response);
  // { status: 'authorized' } for example

  return response;
}

the same code I copy-paste but not work as expected. On the first run direct getting following:

⚡️ TO JS {"status":"denied","value":"00000000-0000-0000-0000-000000000000"}
⚡️ TO JS {"status":"unrequested","value":"00000000-0000-0000-0000-000000000000"}

and on permission alert's option click, nothing happened.

mahnuh commented 6 months ago

Again, I need a complete repository to help you. And more information about your setup. Capacitor version? Check out this repo and verify if it is working there: https://github.com/mahnuh/capacitor-plugin-app-tracking-transparency-demo-app

mahnuh commented 6 months ago

I updated the demo app mentioned above to Capacitor 6 and everything still works. If you can not provide a repo then I will not be able to help you.

vipinsaini0 commented 6 months ago

Please check this repo- https://github.com/vipinsaini0/app-tracking-transparency

@mahnuh I'm still facing the same issue. Before clicking on "Allow" or "Don't Allow," it's giving the status, but after clicking on any option, it's not receiving the status.

Screenshot 2024-05-08 at 10 00 30 AM

altaidyn00 commented 6 months ago

@mahnuh Exactly the same issue I faced yesterday. Initially requestPermission method return status 'denied' before choosing one of the options Allow/Ask App Not to Track, but even after choosing it doesn't return status