Flutter iOS Embedder
FlutterDartVMServicePublisher Class Reference

#import <FlutterDartVMServicePublisher.h>

Inheritance diagram for FlutterDartVMServicePublisher:

Instance Methods

(instancetype) - initWithEnableVMServicePublication:
 
(instancetype) - NS_UNAVAILABLE
 

Class Methods

(instancetype) + NS_UNAVAILABLE
 

Properties

NSURL * url
 

Detailed Description

Definition at line 10 of file FlutterDartVMServicePublisher.h.

Method Documentation

◆ initWithEnableVMServicePublication:

- (instancetype) initWithEnableVMServicePublication: (BOOL)  NS_DESIGNATED_INITIALIZER
Initial value:
{
flutter::DartServiceIsolate::CallbackHandle _callbackHandle

Definition at line 146 of file FlutterDartVMServicePublisher.mm.

146  :(BOOL)enableVMServicePublication {
147  self = [super init];
148  NSAssert(self, @"Super must not return null on init.");
149 
150  _delegate = [[DartVMServiceDNSServiceDelegate alloc] init];
151  _enableVMServicePublication = enableVMServicePublication;
152  __weak __typeof(self) weakSelf = self;
153 
154  fml::MessageLoop::EnsureInitializedForCurrentThread();
155 
156  _callbackHandle = flutter::DartServiceIsolate::AddServerStatusCallback(
157  [weakSelf, runner = fml::MessageLoop::GetCurrent().GetTaskRunner()](const std::string& uri) {
158  if (!uri.empty()) {
159  runner->PostTask([weakSelf, uri]() {
160  FlutterDartVMServicePublisher* strongSelf = weakSelf;
161  // uri comes in as something like 'http://127.0.0.1:XXXXX/' where XXXXX is the port
162  // number.
163  if (strongSelf) {
164  NSURL* url =
165  [[NSURL alloc] initWithString:[NSString stringWithUTF8String:uri.c_str()]];
166  strongSelf.url = url;
167  if (strongSelf.enableVMServicePublication) {
168  [[strongSelf delegate] publishServiceProtocolPort:url];
169  }
170  }
171  });
172  }
173  });
174 
175  return self;
176 }

◆ NS_UNAVAILABLE [1/2]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE [2/2]

- (instancetype) NS_UNAVAILABLE

Property Documentation

◆ url

- (NSURL*) url
readnonatomicassign

Definition at line 17 of file FlutterDartVMServicePublisher.h.


The documentation for this class was generated from the following files:
self
return self
Definition: FlutterTextureRegistryRelay.mm:19
FlutterDartVMServicePublisher::url
NSURL * url
Definition: FlutterDartVMServicePublisher.h:17
flutter
Definition: accessibility_bridge.h:28
DartVMServiceDNSServiceDelegate
Definition: FlutterDartVMServicePublisher.mm:65
FlutterDartVMServicePublisher
Definition: FlutterDartVMServicePublisher.h:10