Skip to content

Commit

Permalink
Update documentation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis committed Dec 2, 2024
1 parent 5301b12 commit 400774a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ import Intents

@MainActor
fileprivate func content() {
container {
@Injected(\.callKitAdapter) var callKitAdapter

callKitAdapter.availabilityPolicy = .always
}

container {
@Injected(\.callKitAdapter) var callKitAdapter

callKitAdapter.availabilityPolicy = .regionBased
}

container {
struct MyCustomAvailabilityPolicy: CallKitAvailabilityPolicyProtocol {
var isAvailable: Bool {
// Example: Enable CallKit only for premium users
return UserManager.currentUser?.isPremium == true
}
}

@Injected(\.callKitAdapter) var callKitAdapter
callKitAdapter.availabilityPolicy = .custom(MyCustomAvailabilityPolicy())
}

container {
@Injected(\.callKitAdapter) var callKitAdapter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,10 @@ var otherParticipant = CallParticipant(
audioLevels: [],
pin: nil
)

final class UserManager {
struct AppUser {
var isPremium: Bool
}
static var currentUser: AppUser?
}

0 comments on commit 400774a

Please sign in to comment.