Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency updates #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,17 @@ android {
}

dependencies {

implementation 'com.google.android.flexbox:flexbox:3.0.0'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation group: 'com.zendesk', name: 'chat', version: '3.1.0'
implementation group: 'com.zendesk', name: 'messaging', version: '5.1.0'
implementation group: 'com.zendesk', name: 'chat-providers', version: '3.1.0'

implementation(group: 'com.zendesk', name: 'messaging', version: '5.1.0') {
exclude group: "com.google.android", module: "flexbox"
}
implementation(group: 'com.zendesk', name: 'chat', version: '3.1.0') {
exclude group: "com.google.android", module: "flexbox"
}

}
12 changes: 3 additions & 9 deletions ios/Classes/SwiftZendeskHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class SwiftZendeskHelper: NSObject, FlutterPlugin {
}
// Name for Bot messages
let messagingConfiguration = MessagingConfiguration()
messagingConfiguration.name = "Chat Bot"
messagingConfiguration.name = dictionary["botName"] as? String ?? "Answer Bot"

// Chat configuration
let chatConfiguration = ChatConfiguration()
Expand Down Expand Up @@ -120,20 +120,14 @@ public class SwiftZendeskHelper: NSObject, FlutterPlugin {


func presentViewController(rootViewController: UIViewController?, view: UIViewController) {
if (rootViewController is UINavigationController) {
(rootViewController as! UINavigationController).pushViewController(view, animated: true)
} else {
if #available(iOS 13.0, *) {
if var topController = UIApplication.shared.keyWindow?.rootViewController {
if var topController = UIApplication.shared.keyWindow?.rootViewController {
while let presentedViewController = topController.presentedViewController {
topController = presentedViewController
}
topController.present(view, animated: true, completion: nil)
}

}
}
}

func uiColorFromHex(rgbValue: Int) -> UIColor {
let red = CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0
let green = CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0
Expand Down
6 changes: 5 additions & 1 deletion lib/zendesk_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,24 @@ class Zendesk {
/// chat transcript at the end of the chat.
///
/// If [isOfflineFormEnabled] is true, the offline form will be shown to the user.
///
/// Optionally set bot's name using [botName]
static Future<void> startChat({bool? isDarkTheme,
Color? primaryColor,
bool isPreChatFormEnabled = true,
bool isAgentAvailabilityEnabled = true,
bool isChatTranscriptPromptEnabled = true,
bool isOfflineFormEnabled = true,
String? botName,
}) async {
await _channel.invokeMethod<void>('startChat', {
'isDarkTheme': isDarkTheme,
'primaryColor': primaryColor?.value,
'isPreChatFormEnabled': isPreChatFormEnabled,
'isAgentAvailabilityEnabled': isAgentAvailabilityEnabled,
'isChatTranscriptPromptEnabled': isChatTranscriptPromptEnabled,
'isOfflineFormEnabled': isOfflineFormEnabled
'isOfflineFormEnabled': isOfflineFormEnabled,
'botName': botName,
});
}

Expand Down