What can be used to tell if a thirdparty is using the app or its being run locally

Its C# code and I am running this using Browserstack the URI is different but It does not seem to be correctly identifying the 2 when I attempt to use it below is the code:

if ()
{
var foundElement = (_IOSdriver.FindElementsByXPath(elementXPath));
Assert.IsNotNull(foundElement);
// Browserstack Check;
}
else
{
IReadOnlyList allTextViewElements =
_IOSdriver.FindElementsByXPath(elementXPath);

            //Setting the status of test as 'passed' or 'failed' based on the condition if results are found for the search

            if ((allTextViewElements.Count > 0))
            {
                ((IJavaScriptExecutor)_IOSdriver).ExecuteScript("browserstack_executor: {\"action\": \"setSessionStatus\", \"arguments\": {\"status\":\"passed\", \"reason\": \" Results found! \"}}");
            }
            else
            {
                ((IJavaScriptExecutor)_IOSdriver).ExecuteScript("browserstack_executor: {\"action\": \"setSessionStatus\", \"arguments\": {\"status\":\"failed\", \"reason\": \" Results not found!\"}}");
            }