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 120 of file FlutterDartVMServicePublisher.mm.

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

◆ 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: