As per Apple documentation , AuthorizationCenter API's.
func requestAuthorization(completionHandler:) is available on iOS 15.0 and deprecated on iOS16.0.
func requestAuthorization(for:) is available on iOS 16.0 and Later, but this API in still in Beta.
For an app that is targeting to release now(before 16.0 release), how do we code?
It appears that, if we use first api, it will deprecate when 16.0 comes and we don't know how it behave in 16.0. For second api,we can't use 16.0 API, as its a Beta API now.It is a subject to change.
For first API, it is deprecated, for the second api, it is still in beta.
Question is, What is the best way to handle this in code, with minimum future updates to App?
Anyone from Family Controls team, Pls guide. Thanks.
Answering myself
We cannot release a code with beta API like this, when it may change.So all we can do is just wait for Beta tag to go.
if #available(iOS 16.0, *) {
try await center.requestAuthorization(for: type)
} else {
center.requestAuthorization { result in
// code
}
If we hope for sept 2022 for 16.0 release, how soon, we can expect confirmation on beta API to production api release? Only FC team folks can answer this I guess.