Skip to content

Commit

Permalink
chore: upgrade ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Mastersam07 committed Oct 4, 2024
1 parent 109e868 commit 7174b9a
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 39 deletions.
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/livechatt/ios"

SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
LiveChat: 63028afb59c57ae6771d59838b1097def6e560ed
livechatt: 1069cacc03bb67f5a230fbb11edcebe006f23ac7

PODFILE CHECKSUM: a5adfe7971131cf0589107393691ada35be2b45f
PODFILE CHECKSUM: afcec358f93eab0742ad2f52bde111b8350ed771

COCOAPODS: 1.11.2
COCOAPODS: 1.15.2
13 changes: 8 additions & 5 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -164,7 +164,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -208,10 +208,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down Expand Up @@ -244,6 +246,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -348,7 +351,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -430,7 +433,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -479,7 +482,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
4 changes: 4 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
5 changes: 1 addition & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MyApp extends StatelessWidget {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'LiveChat',
home: EmbeddedChatWidget(),
home: Support(),
);
}
}
Expand All @@ -37,9 +37,6 @@ class _SupportState extends State<Support> {
void initState() {
super.initState();
initPlatformState();
Livechat.chatEvents.listen((message) {
print('New message: $message');
});
}

// Platform messages are asynchronous, so we initialize in an async method.
Expand Down
54 changes: 31 additions & 23 deletions ios/Classes/SwiftLivechatPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,38 @@ public class SwiftLivechatPlugin: NSObject, FlutterPlugin {
case "beginChat":
let arguments = call.arguments as! [String:Any]

let licenseNo = (arguments["licenseNo"] as? String)
let groupId = (arguments["groupId"] as? String)
let visitorName = (arguments["visitorName"] as? String)
let visitorEmail = (arguments["visitorEmail"] as? String)
let customParams = (arguments["customParams"] as! [String:String])

if (licenseNo == ""){
result(FlutterError(code: "", message: "LICENSE NUMBER EMPTY", details: nil))
}else if (visitorName == ""){
result(FlutterError(code: "", message: "VISITOR NAME EMPTY", details: nil))
}else if (visitorEmail == ""){
result(FlutterError(code: "", message: "VISITOR EMAIL EMPTY", details: nil))
}else{
LiveChat.licenseId = licenseNo // Set your licence number here
LiveChat.groupId = groupId // Optionally, You can route your customers to specific group of agents by providing groupId
LiveChat.name = visitorName // You can provide customer name or email if they are known, so a customer will not need to fill out the pre-chat survey:
LiveChat.email = visitorEmail // You can provide customer name or email if they are known, so a customer will not need to fill out the pre-chat survey:
for (key, value) in customParams{
LiveChat.setVariable(withKey:key, value:value)
}

LiveChat.presentChat()
result(nil)
let licenseNo = arguments["licenseNo"] as? String
let groupId = arguments["groupId"] as? String
let visitorName = arguments["visitorName"] as? String
let visitorEmail = arguments["visitorEmail"] as? String
let customParams = arguments["customParams"] as? [String:String] ?? [:]

guard let licenseNo = licenseNo, !licenseNo.isEmpty else {
result(FlutterError(code: "LICENSE_ERROR", message: "License number cannot be empty", details: nil))
return
}

LiveChat.licenseId = licenseNo

if let groupId = groupId {
LiveChat.groupId = groupId
}

if let visitorName = visitorName {
LiveChat.name = visitorName
}

if let visitorEmail = visitorEmail {
LiveChat.email = visitorEmail
}

for (key, value) in customParams {
LiveChat.setVariable(withKey: key, value: value)
}

LiveChat.presentChat()
result(nil)

default:
result(FlutterMethodNotImplemented)
}
Expand Down

0 comments on commit 7174b9a

Please sign in to comment.