测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | 商业 |
发布最后发布 | 2017年11月 |
SwiftSwift 版本 | 3.0 |
由 Charles von Lehe、Morphii Dev、Michael Wright 维护。
Morphii SDK 为开发者提供将 morphii 技术添加到 iOS 原生应用的能力。Morphii 允许用户操纵情绪的类型和强度。有几种不同的 morphii,以提供全面可能的情绪范围。开发者还可以选择添加一个与 morphii 一起的评论部分。然后开发者可以收集用户与 morphii 的交互的相关信息,用于分析目的。有关更多信息,请参阅Morphii 网站:
pod 'MorphiiSDK', :git => 'https://github.com/Vizbii/morphii-sdk-ios.git', :tag => '0.0.67'
import MorphiiSDK
添加到您想使用 SDK 的任何地方以下是使用 Morphii SDK 所需的导入。
// Swift
import MorphiiSDK
// Objective-C
#import <MorphiiSDK/MorphiiSDK.h>
MorphiiService 类是开发者将工作的主要类。这个类包含了进行身份验证、添加 MorphiiView 以及提交数据以接收包含用户输入数据的 Result Records(结果记录)的方法。所有 MorphiiService 方法都将从 sharedInstance 对象调用。示例
public func authenticate (username:String, password:String, accountId:String, completion:@escaping (_ results:MorphiiSDK.AuthenticationResults)->Void)
此方法通过 morphii 服务器身份验证开发者的账户。它需要一个 username
、password
和 account ID
。完成(completion)返回一个 AuthenticationResults 对象。在使用 SDK 的任何其他方法之前,必须成功验证用户。建议进行检查以确保身份验证结果没有返回一个包含 code
和 message
以提供开发者错误信息的错误对象,并且 isAuthenticated
为 true。如果有错误,则错误对象包含有关发生错误的 insight 的代码和消息。如果没有错误且身份验证成功,则建议在此回调内添加任何 morphii 视图。
// Swift
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let service = MorphiiService.sharedInstance()
service.authenticate(username: "user_name", password: "password", accountId: "account-id") { (result) in
if result.isAuthenticated {
// Authentication successful.
// Add morphii views.
}
else {
print("Authentication failed")
print("error code: \(result.error?.code)")
print("error message: \(result.error?.message)")
}
}
}
// Objective-C
- (void)viewDidLoad {
[super viewDidLoad];
MorphiiService *service = [MorphiiService sharedInstance];
[service authenticateWithUsername:@"user_name" password:@"password" accountId:@"account-id" completion:^(AuthenticationResults * _Nonnull results) {
if (results.isAuthenticated) {
// Authentication successful.
// Add morphii views.
}
else {
// There was an error.
NSLog(@"Error authenticating");
NSLog(@"error code: %@", results.error.code);
NSLog(@"error message: %@", results.error.message);
}
}];
}
public func add(containerView:UIView, config:BasicViewConfiguration, delegate:BasicViewDelegate?) -> BasicView
此方法向指定的容器布局添加一个 BasicView。此方法需要一个参数:一个 basicViewConfiguration
。为了创建一个 BasicViewConfiguration 的实例,您需要创建一些支持类,并将这些类作为参数传递到配置中。有关更多信息,请参阅“支持类”部分。如果成功,add
方法将返回一个 BasicView,如果出错,则返回 null
。
// Swift
func createBasicView(containerView: UIView) -> BasicView {
// Create Project
let project = Project(id: "my-project-id", description: "My Project Description")
// Create Target
let metadata: NSDictionary? = ["value-1" : "key1", "value-2" : "key2"]
let target = Target(id: "my-target-id", type: "question", metadata: metadata)
// Options configuration
let options = Options(stage: "live", initialIntensity: 0.5)
// Comment configuration
let comment = Comment(show: false, required: false, maxLength: 100, label: "Comment", hintText: "Enter comment")
// Create User
let properties: NSDictionary? = ["[email protected]" : "email", "value-2" : "key2", "value-3" : "key3"]
let user = User(id: "user-id", type: "external", properties: properties)
// Morphii configuration.
let morphiiConfig = MorphiiConfiguration(showName: true)
morphiiConfig.add(id: "6202184382145363968", name: nil, weight: 1)
// Create the BasicViewConfiguration and add to the service.
let config = BasicViewConfiguration(morphiiConfig: morphiiConfig, target: target, project: project, comment: comment, options: options, user: user)
let service = MorphiiService.sharedInstance()
let basicView = service.add(containerView: containerView, config: config, delegate: self)
return basicView
}
// Objective-C
-(BasicView*)createBasicView: (UIView *)container {
// Project information
Project *project = [[Project alloc] initWithId:@"my-project-id" description:@"My project description"];
// Target info
NSDictionary *metadata = @{@"value-1":@"key1", @"value-2":@"key2"};
Target *target = [[Target alloc] initWithId:@"my-target-id" type:@"question" metadata:metadata];
// Options info
Options *options = [[Options alloc] initWithStage:@"live" initialIntensity:0.5];
// Comment info
Comment *comment = [[Comment alloc] initWithShow:NO required:NO maxLength:100 label:@"Comment" hintText:@"Enter comment"];
// User data
NSDictionary *properties = @{@"[email protected]":@"email", @"value-2":@"key2", @"value-3":@"key3"};
User *user = [[User alloc] initWithId:@"user-id" type:@"external" properties:properties];
// Morphii information
MorphiiConfiguration *morphiiConfig = [[MorphiiConfiguration alloc] initWithShowName:YES];
[morphiiConfig addWithId:@"6202184382145363968" name:nil weight:1];
BasicViewConfiguration *config = [[BasicViewConfiguration alloc] initWithMorphiiConfig:morphiiConfig target:target project:project comment:comment options:options user:user];
MorphiiService *service = [MorphiiService sharedInstance];
BasicView *basicView = [service addWithContainerView:container config:config delegate:nil];
[container addSubview:basicView];
return basicView;
}
public func addSelectionView (初始强度:Double, 配置:MorphiiConfiguration, 代理:MorphiiSelectionViewDelegate) -> MorphiiSelectionView?
此方法返回一个 MorphiiSelectionView 对象,可以像 SingleMorphiiView
一样添加到您的容器布局中。此方法需要三个参数:初始强度
、MorphiiConfiguration
和 MorphiiSelectionViewDelegate
。MorphiiConfiguration
是一个 MorphiiConfiguration 对象的实例,它配置了 Morphi 的显示方式。初始强度
是一个 Double,它决定了渲染的 Morphi 的起始强度。《MorphiiSelectionViewDelegate 返回选定的 Morphi 的 MorphiiConfiguration
,可以用来创建一个新的 BasicViewConfiguration
,以添加一个新的 BasicView
来允许用户操纵和利用选定的 Morphi。
// Swift
func createSelectionView() -> MorphiiSelectionView? {
let service = MorphiiService.sharedInstance()
let morphiiConfig = MorphiiConfiguration(showName: true)
morphiiConfig.add(id: "6202185104333209600", name: nil, weight: 1)
morphiiConfig.add(id: "6202185110939238400", name: nil, weight: 2)
return service.addSelectionView(initialIntensity: 1.0, config: morphiiConfig, delegate: self)
}
// Objective-C
-(MorphiiSelectionView*)createSelectionView {
MorphiiService *service = [MorphiiService sharedInstance];
MorphiiConfiguration *morphiiConfig = [[MorphiiConfiguration alloc] initWithShowName:YES];
[morphiiConfig addWithId:@"6202185104333209600" name:nil weight:1];
[morphiiConfig addWithId:@"6202185110939238400" name:nil weight:2];
MorphiiSelectionView *morphiiSelectionView = [service addSelectionViewWithInitialIntensity:1.0 config:config delegate:nil];
return morphiiSelectionView;
}
public func submit (完成: (@escaping ([ReactionResultRecord]) -> Void))
如果还没有提交,此方法将提交所有当前在应用中的 BasicView
的数据。完成将返回一个 [ReactionResultRecord]
。此 Array
包含每个使用该方法提交的 BasicView
的 ReactionResultRecord。
//Swift
func submit () {
MorphiiService.sharedInstance().submit { (records) in
for record in records {
print("Results Record");
print("================================================");
print("targetId: \(record.targetId)")
print("viewId: \(record.viewId)")
if !record.isSubmitted {
// There was an error.
print("error code: \(record.error?.code)")
print("error message: \(record.error?.message)")
}
else {
print("reactionId: \(record.reactionId)")
if record.morphii != nil {
print("morphii-id: \(record.morphii?.id)")
print("morphii-name: \(record.morphii?.name)")
print("morphii-displayName: \(record.morphii?.displayName)")
print("morphii-intensity: \(record.morphii?.intensity)")
print("morphii-weight: \(record.morphii?.weight)")
}
else {
print("No morphii details provided.")
}
if record.comment != nil {
print("comment-text: \(record.comment?.text)")
print("comment-locale: \(record.comment?.locale)")
}
else {
print("No comment field")
}
}
print("================================================")
print("================================================")
}
}
}
// Objective-C
- (void)submit {
[[MorphiiService sharedInstance] submitWithCompletion:^(NSArray<ReactionResultRecord *> * _Nonnull records) {
for (ReactionResultRecord *record in records) {
NSLog(@"Results Record");
NSLog(@"================================================");
NSLog(@"targetId: %@",record.targetId);
NSLog(@"viewId: %@",record.viewId);
if (!record.isSubmitted) {
// There was an error.
NSLog(@"error code: %@",record.error.code);
NSLog(@"error message: %@",record.error.message);
}
else {
NSLog(@"reactionId: %@", record.reactionId);
if (record.morphii != nil) {
NSLog(@"morphii-id: %@", record.morphii.id);
NSLog(@"morphii-name: %@", record.morphii.name);
NSLog(@"morphii-displayName: %@", record.morphii.displayName);
NSLog(@"morphii-intensity: %f", record.morphii.intensity);
NSLog(@"morphii-weight: %ld", record.morphii.weight);
}
else {
NSLog(@"No morphii details provided.");
}
if (record.comment != nil) {
NSLog(@"comment-text: %@", record.comment.text);
NSLog(@"comment-locale: %@", record.comment.locale);
}
else {
NSLog(@"No comment field");
}
}
NSLog(@"================================================");
NSLog(@"================================================");
}
}];
}
public func reset (评论:Bool)
此方法将所有 BasicView
重置为其默认配置。该方法有一个参数:评论
。此参数是一个布尔值,如果为真,则将评论字段重置为其默认值,如果为假,则将保留用户所做的更改。
// Swift
func reset() {
MorphiiService.sharedInstance().reset(comment: true)
}
// Objective-C
- (void)reset {
[[MorphiiService sharedInstance] resetWithComment:YES];
}
这些方法类似于在 MorphiiService 类中找到的方法,但通常在调用时更改影响范围。
public func submit ( completion:@escaping (_ results:[ReactionResultRecord])->Void)
此方法从特定 BasicView
中获取数据并进行提交。它将返回一个 [ReactionResultRecord]
。此 Array
将只有一个 ReactionResultRecord,因为只提交了一个 BasicView
。
// Swift
func submit() {
basicView?.submit { (records) in
for record in records {
print("Results Record");
print("================================================");
print("targetId: \(record.targetId)")
print("viewId: \(record.viewId)")
if !record.isSubmitted {
// There was an error.
print("error code: \(record.error?.code)")
print("error message: \(record.error?.message)")
}
else {
print("reactionId: \(record.reactionId)")
if record.morphii != nil {
print("morphii-id: \(record.morphii?.id)")
print("morphii-name: \(record.morphii?.name)")
print("morphii-displayName: \(record.morphii?.displayName)")
print("morphii-intensity: \(record.morphii?.intensity)")
print("morphii-weight: \(record.morphii?.weight)")
}
else {
print("No morphii details provided.")
}
if record.comment != nil {
print("comment-text: \(record.comment?.text)")
print("comment-locale: \(record.comment?.locale)")
}
else {
print("No comment field")
}
}
print("================================================")
print("================================================")
}
}
}
// Objective-C
- (void)submit {
[_basicView submitWithCompletion:^(NSArray<ReactionResultRecord *> * _Nonnull records) {
for (ReactionResultRecord *record in records) {
NSLog(@"Results Record");
NSLog(@"================================================");
NSLog(@"targetId: %@",record.targetId);
NSLog(@"viewId: %@",record.viewId);
if (!record.isSubmitted) {
// There was an error.
NSLog(@"error code: %@",record.error.code);
NSLog(@"error message: %@",record.error.message);
}
else {
NSLog(@"reactionId: %@", record.reactionId);
if (record.morphii != nil) {
NSLog(@"morphii-id: %@", record.morphii.id);
NSLog(@"morphii-name: %@", record.morphii.name);
NSLog(@"morphii-displayName: %@", record.morphii.displayName);
NSLog(@"morphii-intensity: %f", record.morphii.intensity);
NSLog(@"morphii-weight: %ld", record.morphii.weight);
}
else {
NSLog(@"No morphii details provided.");
}
if (record.comment != nil) {
NSLog(@"comment-text: %@", record.comment.text);
NSLog(@"comment-locale: %@", record.comment.locale);
}
else {
NSLog(@"No comment field");
}
}
NSLog(@"================================================");
NSLog(@"================================================");
}
}];
}
public func png (大小:CGSize) -> UIImage?
此方法返回一个指定的 BasicView
中的 Morphi 的 UIImage
。此视图必须在调用此方法之前提交。
// Swift
func getPng() {
imageView.image = basicView?.png(size: CGSize(width: 60, height: 60))
}
// Objective-C
- (void)getPng {
UIImage *image = [_basicView pngWithSize:CGSizeMake(60, 60)];
[_imageView setImage: image];
}
public func reset (评论:Bool)
此方法将 BasicView
重置为其默认值。需要提供一个参数:评论
。如果标记为真,则将评论字段重置为其默认值,如果为假,则保留用户所做的更改。
// Swift
func reset() {
basicView?.reset(comment: true)
}
// Objective-C
- (void)reset {
[_basicView resetWithComment:YES];
}
MorphiiSelectionView 是一个包含 Morphi 列表的视图。此对象由 添加选择视图 返回。
这些是作为 MorphiiService、MorphiiSelectionView 和 BasicView 方法参数的支持类。
此类用于对不同的项目数据进行分组。它需要两个参数:id
和 描述
。`id` 是一个 String,用于标记项目。`描述` 是一个 String,简要描述项目。此对象用于构建 BasicViewConfiguration。
// Swift
// Project information
let project = Project(id: "my-project-id", description: "My Project Description")
// Objective-C
// Project information
Project *project = [[Project alloc] initWithId:@"my-project-id" description:@"My project description"];
Target
类用于描述形态ii相对于什么存在。该类需要三个参数:id
、type
和metadata
。其中id
是一个String,作为引用对象的标签。type
也是一个String,用于描述Target
是什么。例如:问题、图像、视频、文章等。metadata
是一个对象,包含开发人员希望记录的额外信息;该参数可以为nil
。该对象用于构建基本视图配置。
// Swift
// Target information
let metadata: NSDictionary? = ["value-1" : "key1", "value-2" : "key2", "value-3" : "key3"]
let target = Target(id: "test-target-id-1", type: "question", metadata: metadata)
// Objective-C
// Target info
NSDictionary *metadata = @{@"value-1":@"key1", @"value-2":@"key2"};
Target *target = [[Target alloc] initWithId:@"my-target-id" type:@"question" metadata:metadata];
这个类用于定义与形态ii交互的用户。它使用了三个参数:id
、type
和properties
。其中id
是一个String,作为用户的唯一标识。type
也是一个String,定义了用户的类型。包括的选项有:外部、Facebook、Twitter或Google。properties
参数是一个字典,开发人员可以用它来收集任何他们想要的额外信息;该参数可以为nil
。该对象用于构建基本视图配置。
// Swift
// User information
let properties: NSDictionary? = ["[email protected]" : "email", "value-2" : "key2", "value-3" : "key3"]
let user = User(id: "user-id", type: "external", properties: properties)
// Objective-C
// User information
NSDictionary *properties = @{@"[email protected]":@"email", @"value-2":@"key2", @"value-3":@"key3"};
User *user = [[User alloc] initWithId:@"user-id" type:@"external" properties:properties];
这个类用于配置基本视图的评论部分。该类需要五个参数:show
、required
、maxLength
、label
和hintText
。其中show
参数是一个布尔值,用于确定评论部分是否可见。required
参数是一个布尔值,用于确定用户是否必须提交评论才能提交基本视图。maxLength
参数是一个int,用于确定允许的评论字符的最大数量;如果设置为0,则允许无限数量的字符。label
参数是一个String,在评论字段上方显示。hintText
是一个String,将在评论字段中显示。该对象用于构建基本视图配置。
// Swift
// Comment configuration
let comment = Comment(show: false, required: false, maxLength: 100, label: "Post", hintText: "Post Here")
// Objective-C
// Comment info
Comment *comment = [[Comment alloc] initWithShow:NO required:NO maxLength:100 label:@"Comment" hintText:@"Enter comment"];
这个类用于定义额外的配置。它需要两个参数:stage
和initialIntensity
。stage
参数是一个String,有三个选项:test
、validation
和live
。其中test
选项将不会对数据进行分析处理。validation
选项将发送需要由分析代理处理的数据,但不会出现在任何报告数据中。live
选项将全部数据处理和数据报告参数。其中initialIntensity
参数是一个double,用于确定形态ii的起始强度。此值必须在0到1之间。该对象用于构建基本视图配置。
// Swift
// Options configuration
let options = Options(stage: "live", initialIntensity: 0.5)
// Objective-C
// Options configuration
Options *options = [[Options alloc] initWithStage:@"live" initialIntensity:0.5];
这个类用于定义形态ii的默认配置。MorphiiConfiguration
对象接受一个参数:showName
。这是一个布尔值,当为真时,将在形态ii下方显示名称。当为假时,名称不会显示。创建一个MorphiiConfiguration
对象后,需要调用其add
方法来添加配置信息。该方法需要三个参数:id
、name
和weight
。其中id
是一个String,用于确定添加哪个形态ii。其中name
是开发人员为形态ii定义的标签。该参数可以定义为null
。如果定义为null
,将使用默认的形态ii名称。weight
参数是一个int,用于分配给形态ii的权重。该对象用于构建基本视图配置并添加一个形态ii选择视图。
public func add(id: String, name: String?, weight: Int = 0)
: 此方法将特定的 morphii 添加到 MorphiiConfiguration 中。// Swift
// Morphii configuration.
let morphiiConfig = MorphiiConfiguration(showName: true)
morphiiConfig.add(id: "6202185104333209600", name: nil, weight: 1)
// Objective-C
MorphiiConfiguration *morphiiConfig = [[MorphiiConfiguration alloc] initWithShowName:YES];
[morphiiConfig addWithId:@"6202185104333209600" name:nil weight:1];
此类定义了 BasicView 的配置。用于创建一个新的 BasicView
。该对象需要六个参数:morphiiConfiguration
、target
、project
、comment
、options
和 user
。参考上文以辅助创建这些对象。
// Swift
// Project information
let project = Project(id: "my-project-id", description: "My Project Description")
// Target information
let metadata: NSDictionary? = ["value-1" : "key1", "value-2" : "key2"]
let target = Target(id: "test-target-id-1", type: "question", metadata: metadata)
// Options configuration
let options = Options(stage: "test", initialIntensity: 0.5)
// Comment configuration
let comment = Comment(show: true, required: true, maxLength: 100, label: "Post", hintText: "Post Here")
// User information
let properties: NSDictionary? = ["[email protected]" : "email", "value-2" : "key2", "value-3" : "key3"]
let user = User(id: "user-id", type: "external", properties: properties)
// Morphii configuration.
let morphiiConfig = MorphiiConfiguration(showName: true)
morphiiConfig.add(id: "6202185104333209600", name: nil, weight: 1)
let config = BasicViewConfiguration(morphiiConfig: morphiiConfig, target: target, project: project, comment: comment, options: options, user: user)
// Objective-C
// Project information
Project *project = [[Project alloc] initWithId:@"my-project-id" description:@"My project description"];
// Target info
NSDictionary *metadata = @{@"value-1":@"key1", @"value-2":@"key2"};
Target *target = [[Target alloc] initWithId:@"my-target-id" type:@"question" metadata:metadata];
// Options info
Options *options = [[Options alloc] initWithStage:@"live" initialIntensity:0.5];
// Comment info
Comment *comment = [[Comment alloc] initWithShow:NO required:NO maxLength:100 label:@"Comment" hintText:@"Enter comment"];
// User data
NSDictionary *properties = @{@"[email protected]":@"email", @"value-2":@"key2", @"value-3":@"key3"};
User *user = [[User alloc] initWithId:@"user-id" type:@"external" properties:properties];
// Morphii information
MorphiiConfiguration *morphiiConfig = [[MorphiiConfiguration alloc] initWithShowName:YES];
[morphiiConfig addWithId:@"6202185104333209600" name:nil weight:1];
BasicViewConfiguration *config = [[BasicViewConfiguration alloc] initWithMorphiiConfig:morphiiConfig target:target project:project comment:comment options:options user:user];
ReactionResultRecord 对象由 submit
方法返回。注意,如果账户订阅过期或达到记录限制,则不会在 ReactionMorphiiResultRecord 和 ReactionCommentRecord 对象中返回细节。
isSubmitted: Bool
: 如果成功提交反应,则为真。reactionId: String?
: 返回为此次反应生成的反应 ID。viewId: String
: 返回视图 ID。targetId: String
: 返回与此反应相关的目标 ID。comment: ReactionCommentRecord?
:返回一个 ReactionCommentRecord 对象,其中包含有关反应评论的更多详细信息。morphii: ReactionMorphiiResultRecord?
:返回一个 ReactionMorphiiResultRecord 对象,其中包含有关反应 morphii 的更多详细信息。error: ReactionError?
:返回一个 ReactionError 对象,其中包含有关反应错误的更多详细信息。// Swift
func submit() {
MorphiiService.sharedInstance().submit { (records) in
for record in records {
print("Results Record");
print("================================================");
print("targetId: \(record.targetId)")
print("viewId: \(record.viewId)")
if !record.isSubmitted {
// There was an error.
print("error code: \(record.error?.code)")
print("error message: \(record.error?.message)")
}
else {
print("reactionId: \(record.reactionId)")
if record.morphii != nil {
print("morphii-id: \(record.morphii?.id)")
print("morphii-name: \(record.morphii?.name)")
print("morphii-displayName: \(record.morphii?.displayName)")
print("morphii-intensity: \(record.morphii?.intensity)")
print("morphii-weight: \(record.morphii?.weight)")
}
else {
print("No morphii details provided.")
}
if record.comment != nil {
print("comment-text: \(record.comment?.text)")
print("comment-locale: \(record.comment?.locale)")
}
else {
print("No comment field")
}
}
print("================================================")
print("================================================")
}
}
}
// Objective-C
- (void)submit {
[[MorphiiService sharedInstance] submitWithCompletion:^(NSArray<ReactionResultRecord *> * _Nonnull records) {
for (ReactionResultRecord *record in records) {
NSLog(@"Results Record");
NSLog(@"================================================");
NSLog(@"targetId: %@",record.targetId);
NSLog(@"viewId: %@",record.viewId);
if (!record.isSubmitted) {
// There was an error.
NSLog(@"error code: %@",record.error.code);
NSLog(@"error message: %@",record.error.message);
}
else {
NSLog(@"reactionId: %@", record.reactionId);
if (record.morphii != nil) {
NSLog(@"morphii-id: %@", record.morphii.id);
NSLog(@"morphii-name: %@", record.morphii.name);
NSLog(@"morphii-displayName: %@", record.morphii.displayName);
NSLog(@"morphii-intensity: %f", record.morphii.intensity);
NSLog(@"morphii-weight: %ld", record.morphii.weight);
}
else {
NSLog(@"No morphii details provided.");
}
if (record.comment != nil) {
NSLog(@"comment-text: %@", record.comment.text);
NSLog(@"comment-locale: %@", record.comment.locale);
}
else {
NSLog(@"No comment field");
}
}
NSLog(@"================================================");
NSLog(@"================================================");
}
}];
}
此对象包含与ReactionResultRecord 相关的 morphii 的详细信息。
id: String
:返回与此次反应相关的唯一 morphii ID。name: String
:返回与此次反应相关的 morphii 名称。displayName: String
:返回与此次反应相关的 morphii 显示名称。intensity: Double
:返回与此次反应相关的 morphii 强度。weight: Int
:返回与此次反应相关的 morphii 重量。此对象包含与ReactionResultRecord 相关的用户输入注释的详细信息。
text: String
:返回与此次反应相关的注释文本。locale: String
:返回与此次反应相关的注释区域设置。此对象提供了在提交过程中可能发生的任何错误的详细信息。它包含两个属性:code
和 message
。code
属性是由数据分析管道定义的特定错误代码。与 code
属性相关的 message
属性解释了导致错误的原因。
code: String
:返回反应错误代码字符串。message: String
:返回反应错误消息字符串。此对象提供了认证结果的详细信息。此对象通过认证回调返回。
isAuthenticated: Bool
:返回认证是否成功。error: ReactionError?
:返回一个 AuthenticationError 对象,其中包含有关认证错误的更多详细信息。此对象提供了在认证过程中可能发生的任何错误的详细信息。它包含两个属性:code
和 message
。code
属性是由数据分析管道定义的特定错误代码。与 code
属性相关的 message
属性解释了导致错误的原因。
code: String
:此方法返回认证错误代码字符串。message: String
: 此方法返回认证错误信息字符串。