app_tracking_transparency
app_tracking_transparency copied to clipboard
Function to check for enforcement version without requiring other libraries
Just in case it helps guys, I am personally using this fork. Sorry if too many PRs.
Here is stats about usage share for each version. (data from statcounter)
Version | Release Date | Usage (Jan 2021) | Usage (Feb 2021) | Usage (Mar 2021) |
---|---|---|---|---|
iOS 14.0 | September 16, 2020; 6 months ago | 3.72% | 2.52% | 1.96% |
iOS 14.1 | October 20, 2020; 5 months ago | 3.03% | 1.71% | 1.25% |
iOS 14.2 | November 5, 2020; 4 months ago | 28.73% | 6.65% | 4.19% |
iOS 14.3 | December 14, 2020; 3 months ago | 38.75% | 21.27% | 4.78% |
iOS 14.4 | January 26, 2021; 2 months ago | 1.24% | 45.8% | 67.63% |
Users upgrade their OS. After a few months, 14.0-14.5 versions will no longer be used. Also, after they upgraded to 14.5, you must show the tracking dialog.
With device_info
and version
packages, if (Platform.isIOS && Version.parse((await DeviceInfoPlugin().iosInfo).systemVersion) >= Version(14, 5, 0))
can be used instead of this. I see, your PR titled with without requiring other libraries
, but these libraries are small, you can use them safely.
I don't find it valuable adding a 14.5 version check function. Is it really important?
Thanks for the stats, I was looking for something like that and couldn't find it.
It's fine, it was just easier for me as I couldn't find any source telling me Apple will always use the semver standard (they probably will but I couldn't find anything on it).
Regarding the version check, I am doing it because we don't want to lose some earnings until the enforcement (just in the case the user rejects the prompt).
version
package is different from semver
. semver
requires MAJOR.MINOR.PATCH but version
package allows MAJOR.MINOR or MAJOR. You can check tests.
Also, this may cause problems with App Store review. Because, Apple rejects apps that don't show the dialog (1, 2, ...). They may reject your app if the app shows the dialog on 14.5+, not on 14.0-14.5. They may accept it, but you need to test this.
For this PR, I find isBeingEnforcedInThisVersion
too long. We can use isEnforced
instead and add Check authorization is enforced in this iOS version.
to doc. And method call should return Bool(true)
or Bool(false)
, not Int(1)
or Int(0)
.
version
package is different fromsemver
.semver
requires MAJOR.MINOR.PATCH butversion
package allows MAJOR.MINOR or MAJOR. You can check tests.Also, this may cause problems with App Store review. Because, Apple rejects apps that don't show the dialog (1, 2, ...). They may reject your app if the app shows the dialog on 14.5+, not on 14.0-14.5. They may accept it, but you need to test this.
For this PR, I find
isBeingEnforcedInThisVersion
too long. We can useisEnforced
instead and addCheck authorization is enforced in this iOS version.
to doc. And method call should returnBool(true)
orBool(false)
, notInt(1)
orInt(0)
.
Thanks for your explanation on semver, I overlooked the specifics.
BTW, I also received the rejection "Please provide us with steps to locate the AppTrackingTransperancy in the app." but the only thing I did was tell them that it only works in 14.5+ and then my update got accepted.
That is great. I thought Apple was very strict in their policies. It is awesome that they allow requesting dialog only on 14.5+. Thanks for reporting this.