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:
Adam Barth
2017-03-18 13:35:43 -07:00
committed by GitHub
parent ac754da610
commit 401710fd27

View File

@@ -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);
}