0

I need to implement a logic for adding a big quantity of numbers into the Call Directory Extension.

I use this function for generating and adding numbers:

  func generatePhoneNumbers(from pattern: String, to context: CXCallDirectoryExtensionContext) {
    
    func generate(current: String, index: Int) {
      if index == pattern.count {
        
        if let number = Int64(current) {
          context.addBlockingEntry(withNextSequentialPhoneNumber: number)
        }
        return
      }
      
      let char = pattern[pattern.index(pattern.startIndex, offsetBy: index)]
      
      if char == "#" {
        for digit in 0...9 {
          generate(current: current + String(digit), index: index + 1)
        }
      } else {
        generate(current: current + String(char), index: index + 1)
      }
    }
    
    // Start generation
    generate(current: "", index: 0)
  }

This approach allows me to add maximum 2_000_000 numbers but I need more. After the 2000000th number I see an error

maximumEntriesExceeded

How could I load more? Are there any ways to expand the extension capacity?

1 Answer 1

0

You need to create multiple CXCallDirectoryExtensions.

After you install TrueCaller you will see that the app uses 4 extension instances. I presume it's a workaround for entries limit.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer. There is a Begone app, that has just one extension in settings after installing and can add up to 100 million numbers. I want the same behavior.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.