I am trying to return a boolean value from Swift native code however instead of returning the boolean it returns a String which contains the iOS version of my device and shows me the error -
Unhandled Exception: type 'String' is not a subtype of type 'bool' in type cast
This is where my dart code is causing the problem
static Future<bool> isLoaded() async {
return _channel.invokeMethod("isLoaded");
}
This is the iOS Swift native code :
case "isLoaded":
result(self.p.isContentReady) //returns a bool true or false
break;
This is what I am calling to print the bool -
print(await Tapjoy.isLoaded()) //returns iOS 14.4 as a 'String' instead of true/false