Is it fine to call System API function from iOS app? Whether apple review rejects App?

I wanted to know whether we can call fork() and system() function within an iOS application? Whether apple review rejects the application.
In order to identify whether the device is jailbroken. I wanted to include the following code in application
Code Block
let pid = fork()
if(!pid)
{
return true
}
else if(pid >= 0)
{
return false
}
OR
let system= system()
if(system == 1)
{
return true
}
else if(system == 0)
{
return false
}

Answered by DTS Engineer in 665473022

In order to identify whether the device is jailbroken.

I strongly recommend against this. Even if you ignore the App Store complications, checks like this always have binary compatibility impact, resulting in either false negatives or, worse yet, false positives.

A better option here is the DeviceCheck framework. See Establishing Your App’s Integrity.

Share and Enjoy

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

In order to identify whether the device is jailbroken.

I strongly recommend against this. Even if you ignore the App Store complications, checks like this always have binary compatibility impact, resulting in either false negatives or, worse yet, false positives.

A better option here is the DeviceCheck framework. See Establishing Your App’s Integrity.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Is it fine to call System API function from iOS app? Whether apple review rejects App?
 
 
Q