diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm index 0f26dd93e7e28..2f4cefa84d5d0 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm @@ -60,10 +60,21 @@ return; } - // TODO(amirh): decode and pass the creation args. - FlutterTouchInterceptingView* view = [[[FlutterTouchInterceptingView alloc] - initWithEmbeddedView:[factory createWithFrame:CGRectZero viewIdentifier:viewId arguments:nil] - flutterView:flutter_view_] autorelease]; + id params = nil; + if ([factory respondsToSelector:@selector(createArgsCodec)]) { + NSObject* codec = [factory createArgsCodec]; + if (codec != nil && args[@"params"] != nil) { + FlutterStandardTypedData* paramsData = args[@"params"]; + params = [codec decode:paramsData.data]; + } + } + + UIView* embedded_view = [factory createWithFrame:CGRectZero + viewIdentifier:viewId + arguments:params]; + FlutterTouchInterceptingView* view = + [[[FlutterTouchInterceptingView alloc] initWithEmbeddedView:embedded_view + flutterView:flutter_view_] autorelease]; views_[viewId] = fml::scoped_nsobject([view retain]); result(nil);