班级 MCDRemoteSystemAppRegistration
@interface MCDRemoteSystemAppRegistration : NSObject
此类包含有关此应用程序可以发现和使用的所有信息。
备注
必须先发布 MCDRemoteSystemAppRegistration 信息,然后才能将任何传出通信发送到其他应用 possble。 这是为了使其他应用程序可以知道如何响应该通信。
属性
account
@property(nonatomic, readonly, nullable) MCDConnectedDevicesAccount* account;
此注册所属的帐户。
attributes
@property(nonatomic, copy, nullable) NSDictionary<NSString*, NSString*>* attributes;
描述此应用的属性的字符串字典。
appServiceProviders
@property(nonatomic, copy, nullable) NSArray<id<MCDAppServiceProvider>>* appServiceProviders;
此应用支持的 AppServiceProviders 数组。
备注
为了接收传入连接,此数组中必须存在应用服务提供程序。 不需要为应用服务提供商调用 MCDRemoteSystemAppRegistration publishAsync () 来接收请求。
launchUriProvider
@property(nonatomic, readwrite, nullable) id<MCDLaunchUriProvider> launchUriProvider;
启动此应用程序的 Uri 提供程序。
备注
为了接收传入的请求,必须在此属性中存储启动 uri 提供程序。 不需要为应用服务提供商调用 MCDRemoteSystemAppRegistration publishAsync () 来接收请求。
构造函数
getForAccount
+(nullable instancetype) getForAccount:(MCDConnectedDevicesAccount* _Nonnull) account platform:(MCDConnectedDevicesPlatform* _Nonnull) platform;
获取帐户的当前远程系统应用注册。
parameters
account
要为其检索注册的帐户。
platform
从中获取注册的平台。
返回
为提供的帐户返回 MCDRemoteSystemAppRegistration 对象。
方法
saveAsync
- (void)saveAsync:(nonnull void (^)(BOOL, NSError* _Nullable))callback __attribute__((deprecated("Use publishAsync instead")));
保存当前存储在 RemoteSystemAppRegistration 中的信息,以便其他应用程序能够发现它。
备注
必须注册 MCDConnectedDevicesNotificationRegistration 才能成功进行此调用。
警告
已弃用。 改用 publishAsync。
parameters
callback
回调指示保存信息的结果。
publishAsync
- (void)publishAsync:(nonnull void (^)(MCDRemoteSystemAppRegistrationPublishResult* _Nonnull, NSError* _Nullable))completionBlock;
发布当前存储在 MCDRemoteSystemAppRegistration 中的信息,以便其他应用程序能够发现它。
备注
必须注册 MCDConnectedDevicesNotificationRegistration 才能成功进行此调用。
parameters
callback
回调指示保存信息的结果。