chemerisuk / cordova-plugin-idfa

Cordova plugin to get Advertising ID (IDFA or AAID)
MIT License
24 stars 47 forks source link

requestPermission not showing dialog on iPad #26

Open bigreni opened 1 year ago

bigreni commented 1 year ago

The permission dialog works fine on iPhone but the dialog is not showing on the iPad simulators. I am using the sample code provided in the example.

    const idfaPlugin = cordova.plugins.idfa;

    idfaPlugin.getInfo()
        .then(info => {
            if (!info.trackingLimited) {
                return info.idfa || info.aaid;
            } else if (info.trackingPermission === idfaPlugin.TRACKING_PERMISSION_NOT_DETERMINED) {
                return idfaPlugin.requestPermission().then(result => {
                    if (result === idfaPlugin.TRACKING_PERMISSION_AUTHORIZED) {
                        return idfaPlugin.getInfo().then(info => {
                            return info.idfa || info.aaid;
                        });
                    }
                });
            }
        });

I am using Appetize.io for the simulator (iPad Air 2, iOS 14.5). Has anyone else had this problem?

Thanks for your help

timonmasberg commented 1 year ago

you may have disabled the "allow apps to request to track" flag in your ios settings (privacy & security => tracking)