Conform to platform protocol (flutter/engine#3485)
The Android and iOS versions of this function had diverged. This patch makes the iOS version match the Android version (and what the framework expects). Fixes https://github.com/flutter/flutter/issues/8878
This commit is contained in:
@@ -13,12 +13,12 @@ namespace {
|
||||
|
||||
constexpr char kTextPlainFormat[] = "text/plain";
|
||||
|
||||
NSDictionary* GetDirectoryOfType(NSSearchPathDirectory dir) {
|
||||
NSString* GetDirectoryOfType(NSSearchPathDirectory dir) {
|
||||
NSArray* paths =
|
||||
NSSearchPathForDirectoriesInDomains(dir, NSUserDomainMask, YES);
|
||||
if (paths.count == 0)
|
||||
return nil;
|
||||
return @{ @"path": paths.firstObject };
|
||||
return paths.firstObject;
|
||||
}
|
||||
|
||||
} // namespaces
|
||||
@@ -191,11 +191,11 @@ using namespace shell;
|
||||
pasteboard.string = data[@"text"];
|
||||
}
|
||||
|
||||
- (NSDictionary*)getPathProviderTemporaryDirectory {
|
||||
- (NSString*)getPathProviderTemporaryDirectory {
|
||||
return GetDirectoryOfType(NSCachesDirectory);
|
||||
}
|
||||
|
||||
- (NSDictionary*)getPathProviderApplicationDocumentsDirectory {
|
||||
- (NSString*)getPathProviderApplicationDocumentsDirectory {
|
||||
return GetDirectoryOfType(NSDocumentDirectory);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user