How to get inBytes and outBytes using control filter in IOS?

I was trying to fetch inBytes and outBytes in content filter. Each time it is logging 0 as inByte and outByte in handleNewFlow flow description. How to get inByte and outByte of the flow?

Answered by DTS Engineer in 820199022

IMPORTANT Unless explicitly documented otherwise, the descriptions that get logged by Apple types are not considered API. They can and do change regularly. For a classic example of this, see this thread. Do not write code that relies on the exact format of a description.

Having said that, the fact that the flow’s description indicates that zero bytes have been transferred doesn’t surprise me. The purpose of a filter is to either allow or deny a flow. If a flow were allowed to transfer bytes before your filter first sees it in its -handleNew… method, that’d undermine this purpose.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I was trying to fetch inBytes and outBytes in content filter.

What API are you using to get this information?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I am using handleNewFlow in control Filter and then logging the flow description. But the value of inByte and outByte is always zero there.

IMPORTANT Unless explicitly documented otherwise, the descriptions that get logged by Apple types are not considered API. They can and do change regularly. For a classic example of this, see this thread. Do not write code that relies on the exact format of a description.

Having said that, the fact that the flow’s description indicates that zero bytes have been transferred doesn’t surprise me. The purpose of a filter is to either allow or deny a flow. If a flow were allowed to transfer bytes before your filter first sees it in its -handleNew… method, that’d undermine this purpose.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to get inBytes and outBytes using control filter in IOS?
 
 
Q