diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebsiteDataStoreHostApiTests.m b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebsiteDataStoreHostApiTests.m index 18bc21facd21..c518f55194c4 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebsiteDataStoreHostApiTests.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFWebsiteDataStoreHostApiTests.m @@ -70,6 +70,8 @@ - (void)testRemoveDataOfTypes { blockError = error; }]; XCTAssertEqualObjects(returnValue, @YES); + // Asserts whether the NSNumber will be deserialized by the standard codec as a boolean. + XCTAssertEqual(CFGetTypeID((__bridge CFTypeRef)(returnValue)), CFBooleanGetTypeID()); XCTAssertNil(blockError); } @end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFWebsiteDataStoreHostApi.m b/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFWebsiteDataStoreHostApi.m index 4587917ba640..0fd85e010a0a 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFWebsiteDataStoreHostApi.m +++ b/packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFWebsiteDataStoreHostApi.m @@ -60,7 +60,7 @@ - (void)createDefaultDataStoreWithIdentifier:(nonnull NSNumber *)identifier modifiedSince:[NSDate dateWithTimeIntervalSince1970: modificationTimeInSecondsSinceEpoch.doubleValue] completionHandler:^{ - completion(@(records.count > 0), nil); + completion([NSNumber numberWithBool:(records.count > 0)], nil); }]; }]; }