From 401710fd271a1861126a5c825fffd4dc99b839d4 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Sat, 18 Mar 2017 13:35:43 -0700 Subject: [PATCH] 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 --- .../darwin/ios/framework/Source/FlutterPlatformPlugin.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index 187cbf7c4e..77a20e9ad8 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -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); }