@essent/nativescript-iadvize
Advanced tools
Comparing version 2.9.0-alpha.0 to 2.9.0-alpha.1
@@ -66,2 +66,3 @@ import { IAdvizeCommon } from './common'; | ||
})); | ||
IAdvizeSDK().getTargetingController().setLanguage(new com.iadvize.conversation.sdk.feature.targeting.LanguageOption.Custom(com.iadvize.conversation.sdk.type.Language.nl)); | ||
IAdvizeSDK().getTargetingController().activateTargetingRule(this.buildTargetingRule(targetingRuleUUID)); | ||
@@ -68,0 +69,0 @@ IAdvize.activateChatbot(); |
@@ -9,3 +9,5 @@ import { ChatConfiguration, IAdvizeCommon } from './common'; | ||
static getInstance(): IAdvize; | ||
private buildGdprOption; | ||
activate(projectId: number, userId: string, legalUrl: string | undefined, onSuccess: () => void, onFailure: () => void): void; | ||
private buildTargetingRule; | ||
activateTargetingRule(targetingRuleUUID: string): void; | ||
@@ -12,0 +14,0 @@ logout(): void; |
@@ -14,12 +14,12 @@ import { Color, ImageSource } from '@nativescript/core'; | ||
} | ||
buildGdprOption(legalUrl) { | ||
if (!legalUrl) { | ||
return GDPROption.disabled(); | ||
} | ||
const url = NSURL.URLWithString(legalUrl); | ||
const gdprEnabledOption = new GDPREnabledOption({ legalInformationURL: url }); | ||
return new GDPROption({ gdprEnabledOption: gdprEnabledOption }); | ||
} | ||
activate(projectId, userId, legalUrl = undefined, onSuccess, onFailure) { | ||
let gdprOption; | ||
if (legalUrl) { | ||
const url = NSURL.URLWithString(legalUrl); | ||
const gdprEnabledOption = new GDPREnabledOption({ legalInformationURL: url }); | ||
gdprOption = new GDPROption({ gdprEnabledOption: gdprEnabledOption }); | ||
} | ||
else { | ||
gdprOption = GDPROption.disabled(); | ||
} | ||
const gdprOption = this.buildGdprOption(legalUrl); | ||
IAdvizeSDK.shared.activateWithProjectIdAuthenticationOptionGdprOptionCompletion(projectId, new AuthenticationOption({ simple: userId }), gdprOption, (success) => { | ||
@@ -36,2 +36,8 @@ if (success) { | ||
} | ||
buildTargetingRule(targetingRuleUUID) { | ||
const uuid = new NSUUID({ UUIDString: targetingRuleUUID }); | ||
const conversationChannel = ConversationChannel.alloc(); | ||
conversationChannel.initWithChat(); | ||
return TargetingRule.alloc().initWithIdObjcConversationChannel(uuid, conversationChannel); | ||
} | ||
activateTargetingRule(targetingRuleUUID) { | ||
@@ -43,4 +49,4 @@ this.targetingRuleDelegate = TargetingControllerDelegateImpl.initWithCallbacks((isActiveTargetingRuleAvailable) => { | ||
IAdvizeSDK.shared.targetingController.delegate = this.targetingRuleDelegate; | ||
IAdvizeSDK.shared.targetingController.activateTargetingRuleWithTargetingRule(TargetingRule.alloc().initWithIdObjcConversationChannel(new NSUUID({ UUIDString: targetingRuleUUID }), ConversationChannel.alloc().init())); | ||
IAdvizeSDK.shared.targetingController.setLanguage(SDKLanguageOption.customWithValue(119 /* GraphQLLanguage.Nl */)); | ||
IAdvizeSDK.shared.targetingController.activateTargetingRuleWithTargetingRule(this.buildTargetingRule(targetingRuleUUID)); | ||
} | ||
@@ -47,0 +53,0 @@ logout() { |
{ | ||
"name": "@essent/nativescript-iadvize", | ||
"version": "2.9.0-alpha.0", | ||
"version": "2.9.0-alpha.1", | ||
"description": "iAdvize plugin for NativeScript.", | ||
@@ -34,4 +34,3 @@ "main": "index", | ||
"readmeFilename": "README.md", | ||
"bootstrapper": "@nativescript/plugin-seed", | ||
"types": "./index.d.d.ts" | ||
"bootstrapper": "@nativescript/plugin-seed" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49407
425