├── .DS_Store ├── Example ├── .DS_Store ├── Demo_pod │ ├── .DS_Store │ ├── Demo_pod │ │ ├── Assets.xcassets │ │ │ ├── Contents.json │ │ │ ├── AccentColor.colorset │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Ext-Str.swift │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── ViewController.swift │ ├── Pods │ │ ├── Target Support Files │ │ │ ├── HaptikCommerceLib │ │ │ │ ├── HaptikCommerceLib-xcframeworks-output-files.xcfilelist │ │ │ │ ├── HaptikCommerceLib-copy-dsyms-output-files.xcfilelist │ │ │ │ ├── HaptikCommerceLib-xcframeworks-input-files.xcfilelist │ │ │ │ ├── HaptikCommerceLib-copy-dsyms-input-files.xcfilelist │ │ │ │ ├── HaptikCommerceLib.debug.xcconfig │ │ │ │ ├── HaptikCommerceLib.release.xcconfig │ │ │ │ ├── HaptikCommerceLib-xcframeworks.sh │ │ │ │ └── HaptikCommerceLib-copy-dsyms.sh │ │ │ ├── Starscream │ │ │ │ ├── Starscream.modulemap │ │ │ │ ├── Starscream-dummy.m │ │ │ │ ├── Starscream-prefix.pch │ │ │ │ ├── Starscream-umbrella.h │ │ │ │ ├── Starscream.debug.xcconfig │ │ │ │ ├── Starscream.release.xcconfig │ │ │ │ └── Starscream-Info.plist │ │ │ └── Pods-Demo_pod │ │ │ │ ├── Pods-Demo_pod.modulemap │ │ │ │ ├── Pods-Demo_pod-dummy.m │ │ │ │ ├── Pods-Demo_pod-frameworks-Debug-output-files.xcfilelist │ │ │ │ ├── Pods-Demo_pod-frameworks-Release-output-files.xcfilelist │ │ │ │ ├── Pods-Demo_pod-frameworks-Debug-input-files.xcfilelist │ │ │ │ ├── Pods-Demo_pod-frameworks-Release-input-files.xcfilelist │ │ │ │ ├── Pods-Demo_pod-umbrella.h │ │ │ │ ├── Pods-Demo_pod-Info.plist │ │ │ │ ├── Pods-Demo_pod.debug.xcconfig │ │ │ │ └── Pods-Demo_pod.release.xcconfig │ │ ├── Manifest.lock │ │ ├── Starscream │ │ │ └── Sources │ │ │ │ ├── Engine │ │ │ │ ├── Engine.swift │ │ │ │ └── NativeEngine.swift │ │ │ │ ├── Compression │ │ │ │ └── Compression.swift │ │ │ │ ├── Security │ │ │ │ ├── Security.swift │ │ │ │ └── FoundationSecurity.swift │ │ │ │ ├── Server │ │ │ │ ├── Server.swift │ │ │ │ └── WebSocketServer.swift │ │ │ │ ├── Transport │ │ │ │ ├── Transport.swift │ │ │ │ └── TCPTransport.swift │ │ │ │ ├── DataBytes │ │ │ │ └── Data+Extensions.swift │ │ │ │ ├── Framer │ │ │ │ ├── FoundationHTTPServerHandler.swift │ │ │ │ ├── FrameCollector.swift │ │ │ │ ├── FoundationHTTPHandler.swift │ │ │ │ ├── StringHTTPHandler.swift │ │ │ │ └── HTTPHandler.swift │ │ │ │ └── Starscream │ │ │ │ └── WebSocket.swift │ │ └── Local Podspecs │ │ │ └── HaptikCommerceLib.podspec.json │ ├── Demo_pod.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Demo_pod.xcscheme │ ├── Demo_pod.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── Podfile.lock │ └── Podfile └── Demo_Manual │ ├── .DS_Store │ ├── Demo_Manual │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Starscream.framework │ │ ├── Info.plist │ │ ├── Starscream │ │ ├── Modules │ │ │ ├── Starscream.swiftmodule │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ ├── x86_64.swiftmodule │ │ │ │ ├── Project │ │ │ │ │ ├── x86_64.swiftsourceinfo │ │ │ │ │ └── x86_64-apple-ios-simulator.swiftsourceinfo │ │ │ │ ├── x86_64-apple-ios-simulator.swiftdoc │ │ │ │ └── x86_64-apple-ios-simulator.swiftmodule │ │ │ └── module.modulemap │ │ ├── Headers │ │ │ └── Starscream-umbrella.h │ │ └── _CodeSignature │ │ │ └── CodeResources │ ├── AppDelegate.swift │ ├── ViewController.swift │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ └── Info.plist │ └── Demo_Manual.xcodeproj │ └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Frameworks ├── .DS_Store └── HaptikCommerceLib │ ├── HaptikCommerce.xcframework │ ├── ios-arm64 │ │ └── HaptikCommerce.framework │ │ │ ├── Info.plist │ │ │ ├── HaptikCommerce │ │ │ ├── record_error.mp3 │ │ │ ├── record_start.mp3 │ │ │ ├── record_stop.mp3 │ │ │ ├── Modules │ │ │ ├── HaptikCommerce.swiftmodule │ │ │ │ ├── arm64-apple-ios.swiftdoc │ │ │ │ ├── arm64-apple-ios.swiftinterface │ │ │ │ └── arm64-apple-ios.private.swiftinterface │ │ │ └── module.modulemap │ │ │ ├── PrivacyInfo.xcprivacy │ │ │ ├── Headers │ │ │ └── HaptikCommerce.h │ │ │ └── _CodeSignature │ │ │ └── CodeResources │ ├── ios-arm64_x86_64-simulator │ │ └── HaptikCommerce.framework │ │ │ ├── Info.plist │ │ │ ├── HaptikCommerce │ │ │ ├── record_stop.mp3 │ │ │ ├── record_error.mp3 │ │ │ ├── record_start.mp3 │ │ │ ├── Modules │ │ │ ├── module.modulemap │ │ │ └── HaptikCommerce.swiftmodule │ │ │ │ ├── arm64-apple-ios-simulator.swiftdoc │ │ │ │ ├── x86_64-apple-ios-simulator.swiftdoc │ │ │ │ ├── arm64-apple-ios-simulator.swiftinterface │ │ │ │ ├── x86_64-apple-ios-simulator.swiftinterface │ │ │ │ ├── arm64-apple-ios-simulator.private.swiftinterface │ │ │ │ └── x86_64-apple-ios-simulator.private.swiftinterface │ │ │ ├── PrivacyInfo.xcprivacy │ │ │ └── Headers │ │ │ └── HaptikCommerce.h │ └── Info.plist │ ├── HaptikCommerce.dSYMs │ ├── HaptikCommerce.framework.ios-arm64.dSYM │ │ ├── Contents │ │ │ ├── Resources │ │ │ │ └── DWARF │ │ │ │ │ └── HaptikCommerce │ │ │ └── Info.plist │ │ └── HaptikCommerce.framework.dSYM │ │ │ └── Contents │ │ │ ├── Resources │ │ │ └── DWARF │ │ │ │ └── HaptikCommerce │ │ │ └── Info.plist │ └── HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM │ │ ├── Contents │ │ ├── Resources │ │ │ └── DWARF │ │ │ │ └── HaptikCommerce │ │ └── Info.plist │ │ └── HaptikCommerce.framework.dSYM │ │ └── Contents │ │ ├── Resources │ │ └── DWARF │ │ │ └── HaptikCommerce │ │ └── Info.plist │ └── archives │ ├── 0_HaptikCommerce.xcarchive │ ├── dSYMs │ │ └── HaptikCommerce.framework.dSYM │ │ │ └── Contents │ │ │ ├── Resources │ │ │ └── DWARF │ │ │ │ └── HaptikCommerce │ │ │ └── Info.plist │ └── Info.plist │ └── 1_HaptikCommerce.xcarchive │ ├── dSYMs │ └── HaptikCommerce.framework.dSYM │ │ └── Contents │ │ ├── Resources │ │ └── DWARF │ │ │ └── HaptikCommerce │ │ └── Info.plist │ └── Info.plist ├── .github ├── pull_request_template.md ├── PULL_REQUEST_TEMPLATE │ └── release_pull_request.md ├── release-drafter.yml └── mergeable.yml ├── README.md ├── CHANGELOG.md ├── HaptikCommerceLib.podspec └── .gitignore /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/.DS_Store -------------------------------------------------------------------------------- /Example/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/.DS_Store -------------------------------------------------------------------------------- /Frameworks/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/.DS_Store -------------------------------------------------------------------------------- /Example/Demo_pod/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_pod/.DS_Store -------------------------------------------------------------------------------- /Example/Demo_Manual/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/.DS_Store -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/Demo_Manual/Starscream.framework/Info.plist -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Starscream: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/Demo_Manual/Starscream.framework/Starscream -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/HaptikCommerceLib/HaptikCommerceLib-xcframeworks-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_XCFRAMEWORKS_BUILD_DIR}/HaptikCommerceLib/HaptikCommerce.framework -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Starscream/Starscream.modulemap: -------------------------------------------------------------------------------- 1 | framework module Starscream { 2 | umbrella header "Starscream-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Starscream/Starscream-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Starscream : NSObject 3 | @end 4 | @implementation PodsDummy_Starscream 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Demo_pod { 2 | umbrella header "Pods-Demo_pod-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Demo_pod : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Demo_pod 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HaptikCommerce.framework -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HaptikCommerce.framework -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/HaptikCommerceLib/HaptikCommerceLib-copy-dsyms-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${DWARF_DSYM_FOLDER_PATH}/HaptikCommerce.framework.ios-arm64.dSYM 2 | ${DWARF_DSYM_FOLDER_PATH}/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/Info.plist -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/HaptikCommerce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/HaptikCommerce -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/record_error.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/record_error.mp3 -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/record_start.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/record_start.mp3 -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/record_stop.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/record_stop.mp3 -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/HaptikCommerceLib/HaptikCommerceLib-xcframeworks-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/HaptikCommerceLib/HaptikCommerceLib-xcframeworks.sh 2 | ${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/Project/x86_64.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/Project/x86_64.swiftsourceinfo -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Info.plist -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/HaptikCommerce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/HaptikCommerce -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/record_stop.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/record_stop.mp3 -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/record_error.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/record_error.mp3 -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/record_start.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/record_start.mp3 -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Starscream { 2 | umbrella header "Starscream-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Starscream.Swift { 9 | header "Starscream-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64.dSYM/Contents/Resources/DWARF/HaptikCommerce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64.dSYM/Contents/Resources/DWARF/HaptikCommerce -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Example/Demo_Manual/Demo_Manual/Starscream.framework/Modules/Starscream.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Starscream/Starscream-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework 3 | ${PODS_XCFRAMEWORKS_BUILD_DIR}/HaptikCommerceLib/HaptikCommerce.framework/HaptikCommerce -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework 3 | ${PODS_XCFRAMEWORKS_BUILD_DIR}/HaptikCommerceLib/HaptikCommerce.framework/HaptikCommerce -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/archives/0_HaptikCommerce.xcarchive/dSYMs/HaptikCommerce.framework.dSYM/Contents/Resources/DWARF/HaptikCommerce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/archives/0_HaptikCommerce.xcarchive/dSYMs/HaptikCommerce.framework.dSYM/Contents/Resources/DWARF/HaptikCommerce -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/archives/1_HaptikCommerce.xcarchive/dSYMs/HaptikCommerce.framework.dSYM/Contents/Resources/DWARF/HaptikCommerce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/archives/1_HaptikCommerce.xcarchive/dSYMs/HaptikCommerce.framework.dSYM/Contents/Resources/DWARF/HaptikCommerce -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/HaptikCommerceLib/HaptikCommerceLib-copy-dsyms-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64.dSYM 2 | ${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM/Contents/Resources/DWARF/HaptikCommerce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM/Contents/Resources/DWARF/HaptikCommerce -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftdoc -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module HaptikCommerce { 2 | umbrella header "HaptikCommerce.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | 8 | module HaptikCommerce.Swift { 9 | header "HaptikCommerce-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | **(REMOVE ME)** Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. 4 | 5 | Fixes # (issue) 6 | - Change 1 7 | - Change 2 8 | 9 | ## JIRA Ticket Number 10 | 11 | [PSA-XXXX]() 12 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Haptik Commerce 2 | 3 | The Buzzo SDK enables brands to turn their app into a Shopping and Ordering Assistant. It enables users to search, filter and sort products by voice, get personalised recommendations and buying guidance, ask product specific questions as well as to discover reviews based product insights. 4 | For more information visit www.buzzo.ai -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64.dSYM/HaptikCommerce.framework.dSYM/Contents/Resources/DWARF/HaptikCommerce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64.dSYM/HaptikCommerce.framework.dSYM/Contents/Resources/DWARF/HaptikCommerce -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module HaptikCommerce { 2 | umbrella header "HaptikCommerce.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | 8 | module HaptikCommerce.Swift { 9 | header "HaptikCommerce-Swift.h" 10 | requires objc 11 | } 12 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM/HaptikCommerce.framework.dSYM/Contents/Resources/DWARF/HaptikCommerce: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM/HaptikCommerce.framework.dSYM/Contents/Resources/DWARF/HaptikCommerce -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/arm64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/arm64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/x86_64-apple-ios-simulator.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellohaptik/BuzzoLib-iOS/master/Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/x86_64-apple-ios-simulator.swiftdoc -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/release_pull_request.md: -------------------------------------------------------------------------------- 1 | # Release Version : X.X.X 2 | Date :\ 3 | Sprint: 4 | 5 | ## Changelog 6 | - Change 1 7 | - Change 2 8 | - Change 3 9 | 10 | ## Checklist: 11 | 12 | - [ ] Changelog Updated 13 | - [ ] Release date, Sprint name updated 14 | - [ ] Build number updated, Marketing Version 15 | - [ ] Marketing version updated 16 | 17 | ## JIRA Ticket Number 18 | 19 | [PSA-XXXX]() 20 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Starscream/Starscream-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double StarscreamVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char StarscreamVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/Headers/Starscream-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double StarscreamVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char StarscreamVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_Demo_podVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_Demo_podVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/archives/0_HaptikCommerce.xcarchive/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ArchiveVersion 6 | 2 7 | CreationDate 8 | 2024-05-08T10:42:46Z 9 | Name 10 | HaptikCommerce 11 | SchemeName 12 | HaptikCommerce 13 | 14 | 15 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/archives/1_HaptikCommerce.xcarchive/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ArchiveVersion 6 | 2 7 | CreationDate 8 | 2024-05-08T10:43:02Z 9 | Name 10 | HaptikCommerce 11 | SchemeName 12 | HaptikCommerce 13 | 14 | 15 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Demo_Manual 4 | // 5 | // Created by Ketan on 13/11/20. 6 | // 7 | 8 | import UIKit 9 | 10 | @main 11 | class AppDelegate: UIResponder, UIApplicationDelegate { 12 | 13 | var window: UIWindow? 14 | 15 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 16 | // Override point for customization after application launch. 17 | return true 18 | } 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Example/Demo_pod/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - HaptikCommerceLib (3.1.1) 3 | - Starscream (4.0.4) 4 | 5 | DEPENDENCIES: 6 | - HaptikCommerceLib (from `../../`) 7 | - Starscream (= 4.0.4) 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - Starscream 12 | 13 | EXTERNAL SOURCES: 14 | HaptikCommerceLib: 15 | :path: "../../" 16 | 17 | SPEC CHECKSUMS: 18 | HaptikCommerceLib: 92faf1af377052764974e6bde3db61e5e6f70b95 19 | Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9 20 | 21 | PODFILE CHECKSUM: fd1094f7bc78606ee817808dc77c81ea4c60edad 22 | 23 | COCOAPODS: 1.14.2 24 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - HaptikCommerceLib (3.1.1) 3 | - Starscream (4.0.4) 4 | 5 | DEPENDENCIES: 6 | - HaptikCommerceLib (from `../../`) 7 | - Starscream (= 4.0.4) 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - Starscream 12 | 13 | EXTERNAL SOURCES: 14 | HaptikCommerceLib: 15 | :path: "../../" 16 | 17 | SPEC CHECKSUMS: 18 | HaptikCommerceLib: 92faf1af377052764974e6bde3db61e5e6f70b95 19 | Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9 20 | 21 | PODFILE CHECKSUM: fd1094f7bc78606ee817808dc77c81ea4c60edad 22 | 23 | COCOAPODS: 1.14.2 24 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryUserDefaults 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C56D.1 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: $NEXT_PATCH_VERSION 2 | tag-template: $NEXT_PATCH_VERSION 3 | branches: master 4 | template: | 5 | # What's Changed 6 | $CHANGES 7 | categories: 8 | - title: 🚀 Features 9 | label: new-feature 10 | - title: 🐛 Bug Fixes 11 | label: bug-fixes 12 | - title: 📖 Documentation 13 | label: documentation 14 | - title: 💯 Enhancements 15 | label: enhancement 16 | - title: 🚒 Migrations 17 | label: needs-migration 18 | - title: 📦 Packages Updated 19 | label: packages-updated 20 | - title: 👺 Miscellaneous 21 | label: miscellaneous 22 | exclude-labels: 23 | - miscellaneous 24 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryUserDefaults 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C56D.1 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/Headers/HaptikCommerce.h: -------------------------------------------------------------------------------- 1 | // 2 | // HaptikCommerce.h 3 | // HaptikCommerce 4 | // 5 | // Created by Ketan on 28/09/20. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for HaptikCommerce. 11 | FOUNDATION_EXPORT double HaptikCommerceVersionNumber; 12 | 13 | //! Project version string for HaptikCommerce. 14 | FOUNDATION_EXPORT const unsigned char HaptikCommerceVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Engine/Engine.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Engine.swift 3 | // Starscream 4 | // 5 | // Created by Dalton Cherry on 6/15/19. 6 | // Copyright © 2019 Vluxe. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol EngineDelegate: class { 12 | func didReceive(event: WebSocketEvent) 13 | } 14 | 15 | public protocol Engine { 16 | func register(delegate: EngineDelegate) 17 | func start(request: URLRequest) 18 | func stop(closeCode: UInt16) 19 | func forceStop() 20 | func write(data: Data, opcode: FrameOpCode, completion: (() -> ())?) 21 | func write(string: String, completion: (() -> ())?) 22 | } 23 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Headers/HaptikCommerce.h: -------------------------------------------------------------------------------- 1 | // 2 | // HaptikCommerce.h 3 | // HaptikCommerce 4 | // 5 | // Created by Ketan on 28/09/20. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for HaptikCommerce. 11 | FOUNDATION_EXPORT double HaptikCommerceVersionNumber; 12 | 13 | //! Project version string for HaptikCommerce. 14 | FOUNDATION_EXPORT const unsigned char HaptikCommerceVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | -------------------------------------------------------------------------------- /Example/Demo_pod/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'Demo_pod' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for Demo_pod 9 | pod 'HaptikCommerceLib', :path => '../../' 10 | pod 'Starscream', '4.0.4' 11 | end 12 | 13 | post_install do |installer| 14 | installer.generated_projects.each do |project| 15 | project.targets.each do |target| 16 | target.build_configurations.each do |config| 17 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' 18 | end 19 | end 20 | end 21 | end -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.haptik.HaptikCommerce 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 2.2.0 17 | CFBundleVersion 18 | 19 19 | 20 | 21 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/archives/0_HaptikCommerce.xcarchive/dSYMs/HaptikCommerce.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.haptik.HaptikCommerce 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 3.1.1 17 | CFBundleVersion 18 | 21 19 | 20 | 21 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/archives/1_HaptikCommerce.xcarchive/dSYMs/HaptikCommerce.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.haptik.HaptikCommerce 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 3.1.1 17 | CFBundleVersion 18 | 21 19 | 20 | 21 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.haptik.HaptikCommerce 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 2.2.0 17 | CFBundleVersion 18 | 19 19 | 20 | 21 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64.dSYM/HaptikCommerce.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.haptik.HaptikCommerce 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 3.1.1 17 | CFBundleVersion 18 | 21 19 | 20 | 21 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM/HaptikCommerce.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.haptik.HaptikCommerce 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 3.1.1 17 | CFBundleVersion 18 | 21 19 | 20 | 21 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Demo_pod 4 | // 5 | // Created by Ketan on 13/11/20. 6 | // 7 | 8 | import UIKit 9 | import HaptikCommerce 10 | 11 | @main 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | // Setup Google Services 19 | HaptikCommerceLib.sharedSDK.setupGoogle(apiKey: "Your_Google_Key"); 20 | 21 | // Setup Reverie Services 22 | HaptikCommerceLib.sharedSDK.setupReverie(apiKey: "Your_Reverie_Key", appId: "Reverie_AppId", domain: "Reverie_Domain") 23 | 24 | return true 25 | } 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /.github/mergeable.yml: -------------------------------------------------------------------------------- 1 | mergeable: 2 | pull_requests: 3 | stale: 4 | days: 14 5 | message: 'This PR is stale. Please follow up!' 6 | 7 | label: 8 | must_include: 9 | regex: '(new-feature)|(documentation)|(bug-fixes)|(enhancement)|(needs-migration)|(packages-updated)|(miscellaneous)|(chore)' 10 | message: 'Can you please add a valid label! [One of (new-feature) / (documentation) / (bug-fixes) / (enhancement) / (needs-migration) / (packages-updated) / (miscellaneous) / (chore) ]' 11 | must_exclude: 12 | regex: '(do-not-merge)' 13 | message: 'This PR is work in progress. Cannot be merged yet.' 14 | 15 | description: 16 | no_empty: 17 | enabled: true 18 | message: 'Can you please add a description!' 19 | must_exclude: 20 | regex: 'do not merge' 21 | message: 'This PR is work in progress. Cannot be merged yet.' 22 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Starscream/Starscream.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Starscream 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Starscream 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Starscream/Starscream.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Starscream 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 5 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Starscream 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Starscream/Starscream-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${PODS_DEVELOPMENT_LANGUAGE} 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/HaptikCommerceLib/HaptikCommerceLib.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/HaptikCommerceLib 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib" "${PODS_XCFRAMEWORKS_BUILD_DIR}/HaptikCommerceLib" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "Foundation" -framework "Speech" -framework "UIKit" -framework "WebKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../.. 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/HaptikCommerceLib/HaptikCommerceLib.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/HaptikCommerceLib 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib" "${PODS_XCFRAMEWORKS_BUILD_DIR}/HaptikCommerceLib" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "Foundation" -framework "Speech" -framework "UIKit" -framework "WebKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_DEVELOPMENT_LANGUAGE = ${DEVELOPMENT_LANGUAGE} 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../.. 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Local Podspecs/HaptikCommerceLib.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "HaptikCommerceLib", 3 | "version": "3.1.1", 4 | "summary": "The Buzzo SDK enables brands to turn their app into a Shopping and Ordering Assistant.", 5 | "description": "The Buzzo SDK enables brands to turn their app into a Shopping and Ordering Assistant. It enables users to search, filter and sort products by voice, get personalised recommendations and buying guidance, ask product specific questions as well as to discover reviews based product insights.", 6 | "homepage": "https://www.buzzo.ai", 7 | "license": { 8 | "type": "Commercial", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "Ketan Doiphode": "ketan@haptik.ai" 13 | }, 14 | "social_media_url": "https://twitter.com/haptik", 15 | "vendored_frameworks": "Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework", 16 | "platforms": { 17 | "ios": "11.0" 18 | }, 19 | "source": { 20 | "git": "https://github.com/hellohaptik/BuzzoLib-iOS.git", 21 | "tag": "3.1.1" 22 | }, 23 | "frameworks": [ 24 | "WebKit", 25 | "Speech", 26 | "UIKit", 27 | "AVFoundation", 28 | "Foundation" 29 | ], 30 | "requires_arc": true 31 | } 32 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Compression/Compression.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Compression.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 2/4/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public protocol CompressionHandler { 26 | func load(headers: [String: String]) 27 | func decompress(data: Data, isFinal: Bool) -> Data? 28 | func compress(data: Data) -> Data? 29 | } 30 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Demo_Manual 4 | // 5 | // Created by Ketan on 13/11/20. 6 | // 7 | 8 | import UIKit 9 | import HaptikCommerce 10 | 11 | class ViewController: UIViewController, HPExternalEvent { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view. 16 | } 17 | 18 | @IBAction func launchPressed(_ sender: Any) { 19 | 20 | let attributes = HPAttributesBuilder.build { (builder) in 21 | 22 | builder.category = "grocery" 23 | builder.voiceFirst = true 24 | builder.TTSEngine = .appleNative 25 | builder.TTSVoiceType = .wavenet 26 | builder.ASREngine = .appleNative 27 | } 28 | 29 | HaptikCommerceLib.sharedSDK.loadConversation(launchController: self, attributes: attributes) 30 | } 31 | 32 | // Haptik Delegates 33 | func didReceiveHaptikError(_ error: NSError) { 34 | print("Demo:: received event : \(error.localizedDescription)") 35 | } 36 | 37 | func didReceiveHaptikEvent(_ eventData : String) { 38 | print("Demo:: received event : \(eventData)") 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" "${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib" "${PODS_XCFRAMEWORKS_BUILD_DIR}/HaptikCommerceLib" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "Foundation" -framework "HaptikCommerce" -framework "Speech" -framework "Starscream" -framework "UIKit" -framework "WebKit" 9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 10 | PODS_BUILD_DIR = ${BUILD_DIR} 11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/Pods-Demo_pod/Pods-Demo_pod.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Starscream" "${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib" "${PODS_XCFRAMEWORKS_BUILD_DIR}/HaptikCommerceLib" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) /usr/lib/swift '@executable_path/Frameworks' '@loader_path/Frameworks' 7 | LIBRARY_SEARCH_PATHS = $(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift 8 | OTHER_LDFLAGS = $(inherited) -framework "AVFoundation" -framework "Foundation" -framework "HaptikCommerce" -framework "Speech" -framework "Starscream" -framework "UIKit" -framework "WebKit" 9 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 10 | PODS_BUILD_DIR = ${BUILD_DIR} 11 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | BinaryPath 9 | HaptikCommerce.framework/HaptikCommerce 10 | LibraryIdentifier 11 | ios-arm64_x86_64-simulator 12 | LibraryPath 13 | HaptikCommerce.framework 14 | SupportedArchitectures 15 | 16 | arm64 17 | x86_64 18 | 19 | SupportedPlatform 20 | ios 21 | SupportedPlatformVariant 22 | simulator 23 | 24 | 25 | BinaryPath 26 | HaptikCommerce.framework/HaptikCommerce 27 | LibraryIdentifier 28 | ios-arm64 29 | LibraryPath 30 | HaptikCommerce.framework 31 | SupportedArchitectures 32 | 33 | arm64 34 | 35 | SupportedPlatform 36 | ios 37 | 38 | 39 | CFBundlePackageType 40 | XFWK 41 | XCFrameworkFormatVersion 42 | 1.0 43 | 44 | 45 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/Ext-Str.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Ext-Str.swift 3 | // Demo_pod 4 | // 5 | // Created by Ketan Doiphode on 20/12/23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension String { 11 | 12 | /// Converts string json to Dictionary 13 | /// - Returns: returns dictionary object if json is valid 14 | func toJSON() -> [String: Any]? { 15 | if let data = self.data(using: .utf8) { 16 | do { 17 | return try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] 18 | } catch { 19 | print(error.localizedDescription) 20 | } 21 | } 22 | return nil 23 | } 24 | 25 | /// Retrieves stores value against provided key 26 | /// - Parameter key: string key 27 | init?(key: String) { 28 | guard let str = UserDefaults.standard.string(forKey: key) else { 29 | return nil 30 | } 31 | self.init(str) 32 | } 33 | 34 | /// Stores string value in `UserDefaults` 35 | /// - Parameter key: Key against stored value 36 | func storeUserDefault(key: String) { 37 | UserDefaults.standard.set(self, forKey: key) 38 | UserDefaults.standard.synchronize() 39 | } 40 | 41 | 42 | /// Validates if string is valid URL 43 | /// - Returns: Validation result 44 | func isValidUrl() -> Bool { 45 | let urlRegEx = "^(https?://)?(www\\.)?([-a-z0-9]{1,63}\\.)*?[a-z0-9][-a-z0-9]{0,61}[a-z0-9]\\.[a-z]{2,6}(/[-\\w@\\+\\.~#\\?&/=%]*)?$" 46 | let urlTest = NSPredicate(format:"SELF MATCHES %@", urlRegEx) 47 | let result = urlTest.evaluate(with: self) 48 | return result 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Security/Security.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Security.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 3/16/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public enum SecurityErrorCode: UInt16 { 26 | case acceptFailed = 1 27 | case pinningFailed = 2 28 | } 29 | 30 | public enum PinningState { 31 | case success 32 | case failed(CFError?) 33 | } 34 | 35 | // CertificatePinning protocol provides an interface for Transports to handle Certificate 36 | // or Public Key Pinning. 37 | public protocol CertificatePinning: class { 38 | func evaluateTrust(trust: SecTrust, domain: String?, completion: ((PinningState) -> ())) 39 | } 40 | 41 | // validates the "Sec-WebSocket-Accept" header as defined 1.3 of the RFC 6455 42 | // https://tools.ietf.org/html/rfc6455#section-1.3 43 | public protocol HeaderValidator: class { 44 | func validate(headers: [String: String], key: String) -> Error? 45 | } 46 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Server/Server.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Server.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 4/2/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public enum ConnectionEvent { 26 | case connected([String: String]) 27 | case disconnected(String, UInt16) 28 | case text(String) 29 | case binary(Data) 30 | case pong(Data?) 31 | case ping(Data?) 32 | case error(Error) 33 | } 34 | 35 | public protocol Connection { 36 | func write(data: Data, opcode: FrameOpCode) 37 | } 38 | 39 | public protocol ConnectionDelegate: class { 40 | func didReceive(event: ServerEvent) 41 | } 42 | 43 | public enum ServerEvent { 44 | case connected(Connection, [String: String]) 45 | case disconnected(Connection, String, UInt16) 46 | case text(Connection, String) 47 | case binary(Connection, Data) 48 | case pong(Connection, Data?) 49 | case ping(Connection, Data?) 50 | } 51 | 52 | public protocol Server { 53 | func start(address: String, port: UInt16) -> Error? 54 | } 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Transport/Transport.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | ////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // 5 | // Transport.swift 6 | // Starscream 7 | // 8 | // Created by Dalton Cherry on 1/23/19. 9 | // Copyright © 2019 Vluxe. All rights reserved. 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the "License"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an "AS IS" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | // See the License for the specific language governing permissions and 21 | // limitations under the License. 22 | // 23 | ////////////////////////////////////////////////////////////////////////////////////////////////// 24 | 25 | import Foundation 26 | 27 | public enum ConnectionState { 28 | case connected 29 | case waiting 30 | case cancelled 31 | case failed(Error?) 32 | 33 | //the viability (connection status) of the connection has updated 34 | //e.g. connection is down, connection came back up, etc 35 | case viability(Bool) 36 | 37 | //the connection has upgrade to wifi from cellular. 38 | //you should consider reconnecting to take advantage of this 39 | case shouldReconnect(Bool) 40 | 41 | //the connection receive data 42 | case receive(Data) 43 | } 44 | 45 | public protocol TransportEventClient: class { 46 | func connectionChanged(state: ConnectionState) 47 | } 48 | 49 | public protocol Transport: class { 50 | func register(delegate: TransportEventClient) 51 | func connect(url: URL, timeout: Double, certificatePinning: CertificatePinning?) 52 | func disconnect() 53 | func write(data: Data, completion: @escaping ((Error?) -> ())) 54 | var usingTLS: Bool { get } 55 | } 56 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 4 | 5 | ## [3.1.1] - (08/05/24) 6 | ### Enhanncement 7 | - Xcode 15 compatibility 8 | 9 | ## [3.0.0] - (26/12/23) 10 | ### Bug Fixes 11 | - Add External ASR Interfaces 12 | - Remove Reverie internal support 13 | - Update Demo 14 | 15 | ## [2.1.0] - (26/07/23) 16 | ### Bug Fixes 17 | - Fixed Crashes 18 | 19 | ## [2.0.0)] - (23/03/23) 20 | ### Enhancements 21 | - Update SDK integration 22 | 23 | ## [1.2.0)] - (17/02/23) 24 | ### Enhancements 25 | - Update notifications 26 | 27 | ## [1.1.0)] - (18/11/22) 28 | ### Enhancements 29 | - Update reverie headers 30 | 31 | ## [1.0.0)] - (02/06/22) 32 | ### Enhancements 33 | - Fix conflicts with other haptik modules 34 | - Reduce reverie TTS voice 35 | 36 | ## [0.2.8] - (08/03/22) 37 | 38 | ### Enhancements 39 | - Minor Enhancements 40 | 41 | ## [0.2.7] - (28/10/21) - Sprint 18 iOS 42 | 43 | ### Enhancements 44 | - Update for ios15 support. Updated Xcode12 to xcode13 45 | 46 | ## [0.2.6] - (22/09/21) - Sprint 13 iOS 47 | 48 | ### Bug Fixes 49 | - crash fix while mic is being used by any other app 50 | - Voice response was not entirely spoken 51 | 52 | ## [0.2.5] - (05/08/21) - Sprint 13 iOS 53 | - crash fixes 54 | 55 | ## [0.2.3] - (05/08/21) - Sprint 13 iOS 56 | 57 | ### Bugs 58 | - Fixes for Voice module Crash 59 | 60 | ## [0.2.2] - (30/07/21) - Sprint 12 iOS 61 | 62 | ### Enhancement 63 | - Update Microphone Permission flow 64 | - Change Audio channels 65 | 66 | ### Bugs 67 | - Fixed Mute status for non-voice first 68 | 69 | ## [0.2.1] - (14/06/21) - Sprint 9 iOS 70 | 71 | ### Enhancement 72 | - Added Debug Event 73 | 74 | ## [0.2.0] - (31/05/21) - Sprint 8 iOS 75 | 76 | ### Features 77 | - Add Google TTS support 78 | - Add Reverie TTS support 79 | - Add Reverie ASR support 80 | - Handle Language change event 81 | 82 | ### Bugs 83 | - Increase TTS volume 84 | - Fix ASR language change 85 | - Fix TTS/ASR session conflicts 86 | 87 | ## [0.1.0] - (17/11/20) - X iOS 88 | 89 | ### Features 90 | - Add TTS support 91 | - Add ASR support 92 | - Add Language Support for Hindi, Eng-US, Eng-UK 93 | - Add`HPExternalEvent` 94 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/DataBytes/Data+Extensions.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Data+Extensions.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 3/27/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Fix for deprecation warnings 10 | // 11 | // Licensed under the Apache License, Version 2.0 (the "License"); 12 | // you may not use this file except in compliance with the License. 13 | // You may obtain a copy of the License at 14 | // 15 | // http://www.apache.org/licenses/LICENSE-2.0 16 | // 17 | // Unless required by applicable law or agreed to in writing, software 18 | // distributed under the License is distributed on an "AS IS" BASIS, 19 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | // See the License for the specific language governing permissions and 21 | // limitations under the License. 22 | // 23 | ////////////////////////////////////////////////////////////////////////////////////////////////// 24 | 25 | import Foundation 26 | 27 | internal extension Data { 28 | struct ByteError: Swift.Error {} 29 | 30 | #if swift(>=5.0) 31 | func withUnsafeBytes(_ completion: (UnsafePointer) throws -> ResultType) rethrows -> ResultType { 32 | return try withUnsafeBytes { 33 | if let baseAddress = $0.baseAddress, $0.count > 0 { 34 | return try completion(baseAddress.assumingMemoryBound(to: ContentType.self)) 35 | } else { 36 | throw ByteError() 37 | } 38 | } 39 | } 40 | #endif 41 | 42 | #if swift(>=5.0) 43 | mutating func withUnsafeMutableBytes(_ completion: (UnsafeMutablePointer) throws -> ResultType) rethrows -> ResultType { 44 | return try withUnsafeMutableBytes { 45 | if let baseAddress = $0.baseAddress, $0.count > 0 { 46 | return try completion(baseAddress.assumingMemoryBound(to: ContentType.self)) 47 | } else { 48 | throw ByteError() 49 | } 50 | } 51 | } 52 | #endif 53 | } 54 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSupportsIndirectInputEvents 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | HaptikCommerceLib 47 | 48 | baseUrl 49 | your_base_url 50 | clientID 51 | your_client_id 52 | runEnvironment 53 | 1 54 | 55 | NSAppTransportSecurity 56 | 57 | NSAllowsArbitraryLoads 58 | 59 | 60 | NSMicrophoneUsageDescription 61 | Microphone Speech permission 62 | NSSpeechRecognitionUsageDescription 63 | Microphone Speech permission 64 | 65 | 66 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Demo_pod 4 | // 5 | // Created by Ketan on 13/11/20. 6 | // 7 | 8 | import UIKit 9 | import HaptikCommerce 10 | import AVFAudio 11 | import AVFoundation 12 | 13 | class ViewController: UIViewController, HPExternalEvent { 14 | 15 | let revAsr = ReverieASR() 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | // Do any additional setup after loading the view. 20 | HaptikCommerceLib.sharedSDK.delegate = self 21 | 22 | let permission = AVAudioSession.sharedInstance().recordPermission; 23 | AudioPermission() 24 | revAsr.setup() 25 | 26 | } 27 | 28 | func startRecording(_ status: Bool) { 29 | switch status { 30 | 31 | case true: 32 | revAsr.startRecording() 33 | print("{{{{-- Recording Start --}}}") 34 | 35 | case false: 36 | revAsr.stopRecording() 37 | print("||||-- Recording Stoppped --||||") 38 | } 39 | } 40 | 41 | func didReceiveHaptikError(_ error: NSError) { 42 | print("Demo:: received event : \(error.localizedDescription)") 43 | } 44 | 45 | func didReceiveHaptikEvent(_ eventData : String) { 46 | print("Demo:: received event : \(eventData)") 47 | } 48 | 49 | @IBAction func launchPressed(_ sender: Any) { 50 | 51 | let attributes = HPCommerceAttributesBuilder.build { (builder) in 52 | 53 | builder.category = "grocery" 54 | builder.voiceFirst = true 55 | builder.TTSEngine = .reverieTTS 56 | builder.TTSVoiceType = .standard 57 | builder.ASREngine = .thirdParty 58 | } 59 | 60 | HaptikCommerceLib.sharedSDK.loadConversation(launchController: self, attributes: attributes) 61 | } 62 | } 63 | 64 | func AudioPermission() { 65 | AVCaptureDevice.requestAccess(for: .audio) { granted in 66 | if granted { 67 | // Access to the microphone is granted 68 | print("Microphone access granted") 69 | // You can start using the microphone here 70 | } else { 71 | // Access to the microphone is denied 72 | print("Microphone access denied") 73 | // Handle denial - perhaps show an alert to the user explaining why access is needed 74 | } 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSupportsIndirectInputEvents 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | HaptikCommerceLib 47 | 48 | baseUrl 49 | Your_Base_URL 50 | clientID 51 | Your_Clien_ID 52 | runEnvironment 53 | 1 54 | google-api-key 55 | your_google-api-key 56 | reverie-api-key 57 | your_reverie-api-key 58 | reverie-app-id 59 | your_reverie_app_id 60 | reverie-domain 61 | ecomm 62 | 63 | NSMicrophoneUsageDescription 64 | Microphone Speech permission 65 | NSSpeechRecognitionUsageDescription 66 | Microphone Speech permission 67 | 68 | 69 | -------------------------------------------------------------------------------- /HaptikCommerceLib.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint HaptikCommerceLib.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |spec| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | spec.name = "HaptikCommerceLib" 19 | spec.version = "3.1.1" 20 | spec.summary = "The Buzzo SDK enables brands to turn their app into a Shopping and Ordering Assistant." 21 | 22 | spec.description = <<-DESC 23 | The Buzzo SDK enables brands to turn their app into a Shopping and Ordering Assistant. It enables users to search, filter and sort products by voice, get personalised recommendations and buying guidance, ask product specific questions as well as to discover reviews based product insights. 24 | DESC 25 | 26 | spec.homepage = "https://www.buzzo.ai" 27 | 28 | 29 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 30 | 31 | spec.license = { :type => "Commercial", :file => "LICENSE" } 32 | 33 | 34 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 35 | 36 | spec.author = { "Ketan Doiphode" => "ketan@haptik.ai" } 37 | spec.social_media_url = "https://twitter.com/haptik" 38 | 39 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 40 | 41 | spec.vendored_frameworks = "Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework" 42 | spec.platform = :ios 43 | spec.platform = :ios, "11.0" 44 | 45 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 46 | 47 | spec.source = { :git => "https://github.com/hellohaptik/BuzzoLib-iOS.git", :tag => "#{spec.version}" } 48 | 49 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 50 | 51 | spec.frameworks = "WebKit", "Speech", "UIKit", "AVFoundation", "Foundation" 52 | 53 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 54 | 55 | spec.requires_arc = true 56 | 57 | 58 | end 59 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod.xcodeproj/xcshareddata/xcschemes/Demo_pod.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Engine/NativeEngine.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NativeEngine.swift 3 | // Starscream 4 | // 5 | // Created by Dalton Cherry on 6/15/19. 6 | // Copyright © 2019 Vluxe. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) 12 | public class NativeEngine: NSObject, Engine, URLSessionDataDelegate, URLSessionWebSocketDelegate { 13 | private var task: URLSessionWebSocketTask? 14 | weak var delegate: EngineDelegate? 15 | 16 | public func register(delegate: EngineDelegate) { 17 | self.delegate = delegate 18 | } 19 | 20 | public func start(request: URLRequest) { 21 | let session = URLSession(configuration: URLSessionConfiguration.default, delegate: self, delegateQueue: nil) 22 | task = session.webSocketTask(with: request) 23 | doRead() 24 | task?.resume() 25 | } 26 | 27 | public func stop(closeCode: UInt16) { 28 | let closeCode = URLSessionWebSocketTask.CloseCode(rawValue: Int(closeCode)) ?? .normalClosure 29 | task?.cancel(with: closeCode, reason: nil) 30 | } 31 | 32 | public func forceStop() { 33 | stop(closeCode: UInt16(URLSessionWebSocketTask.CloseCode.abnormalClosure.rawValue)) 34 | } 35 | 36 | public func write(string: String, completion: (() -> ())?) { 37 | task?.send(.string(string), completionHandler: { (error) in 38 | completion?() 39 | }) 40 | } 41 | 42 | public func write(data: Data, opcode: FrameOpCode, completion: (() -> ())?) { 43 | switch opcode { 44 | case .binaryFrame: 45 | task?.send(.data(data), completionHandler: { (error) in 46 | completion?() 47 | }) 48 | case .textFrame: 49 | let text = String(data: data, encoding: .utf8)! 50 | write(string: text, completion: completion) 51 | case .ping: 52 | task?.sendPing(pongReceiveHandler: { (error) in 53 | completion?() 54 | }) 55 | default: 56 | break //unsupported 57 | } 58 | } 59 | 60 | private func doRead() { 61 | task?.receive { [weak self] (result) in 62 | switch result { 63 | case .success(let message): 64 | switch message { 65 | case .string(let string): 66 | self?.broadcast(event: .text(string)) 67 | case .data(let data): 68 | self?.broadcast(event: .binary(data)) 69 | @unknown default: 70 | break 71 | } 72 | break 73 | case .failure(let error): 74 | self?.broadcast(event: .error(error)) 75 | } 76 | self?.doRead() 77 | } 78 | } 79 | 80 | private func broadcast(event: WebSocketEvent) { 81 | delegate?.didReceive(event: event) 82 | } 83 | 84 | public func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didOpenWithProtocol protocol: String?) { 85 | let p = `protocol` ?? "" 86 | broadcast(event: .connected([HTTPWSHeader.protocolName: p])) 87 | } 88 | 89 | public func urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?) { 90 | var r = "" 91 | if let d = reason { 92 | r = String(data: d, encoding: .utf8) ?? "" 93 | } 94 | broadcast(event: .disconnected(r, UInt16(closeCode.rawValue))) 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Security/FoundationSecurity.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // FoundationSecurity.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 3/16/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | import CommonCrypto 25 | 26 | public enum FoundationSecurityError: Error { 27 | case invalidRequest 28 | } 29 | 30 | public class FoundationSecurity { 31 | var allowSelfSigned = false 32 | 33 | public init(allowSelfSigned: Bool = false) { 34 | self.allowSelfSigned = allowSelfSigned 35 | } 36 | 37 | 38 | } 39 | 40 | extension FoundationSecurity: CertificatePinning { 41 | public func evaluateTrust(trust: SecTrust, domain: String?, completion: ((PinningState) -> ())) { 42 | if allowSelfSigned { 43 | completion(.success) 44 | return 45 | } 46 | 47 | if let validateDomain = domain { 48 | SecTrustSetPolicies(trust, SecPolicyCreateSSL(true, validateDomain as NSString?)) 49 | } 50 | 51 | handleSecurityTrust(trust: trust, completion: completion) 52 | } 53 | 54 | private func handleSecurityTrust(trust: SecTrust, completion: ((PinningState) -> ())) { 55 | if #available(iOS 12.0, OSX 10.14, watchOS 5.0, tvOS 12.0, *) { 56 | var error: CFError? 57 | if SecTrustEvaluateWithError(trust, &error) { 58 | completion(.success) 59 | } else { 60 | completion(.failed(error)) 61 | } 62 | } else { 63 | handleOldSecurityTrust(trust: trust, completion: completion) 64 | } 65 | } 66 | 67 | private func handleOldSecurityTrust(trust: SecTrust, completion: ((PinningState) -> ())) { 68 | var result: SecTrustResultType = .unspecified 69 | SecTrustEvaluate(trust, &result) 70 | if result == .unspecified || result == .proceed { 71 | completion(.success) 72 | } else { 73 | let e = CFErrorCreate(kCFAllocatorDefault, "FoundationSecurityError" as NSString?, Int(result.rawValue), nil) 74 | completion(.failed(e)) 75 | } 76 | } 77 | } 78 | 79 | extension FoundationSecurity: HeaderValidator { 80 | public func validate(headers: [String: String], key: String) -> Error? { 81 | if let acceptKey = headers[HTTPWSHeader.acceptName] { 82 | let sha = "\(key)258EAFA5-E914-47DA-95CA-C5AB0DC85B11".sha1Base64() 83 | if sha != acceptKey { 84 | return WSError(type: .securityError, message: "accept header doesn't match", code: SecurityErrorCode.acceptFailed.rawValue) 85 | } 86 | } 87 | return nil 88 | } 89 | } 90 | 91 | private extension String { 92 | func sha1Base64() -> String { 93 | let data = self.data(using: .utf8)! 94 | let pointer = data.withUnsafeBytes { (bytes: UnsafeRawBufferPointer) -> [UInt8] in 95 | var digest = [UInt8](repeating: 0, count:Int(CC_SHA1_DIGEST_LENGTH)) 96 | CC_SHA1(bytes.baseAddress, CC_LONG(data.count), &digest) 97 | return digest 98 | } 99 | return Data(pointer).base64EncodedString() 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Framer/FoundationHTTPServerHandler.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // FoundationHTTPHandler.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 4/2/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public class FoundationHTTPServerHandler: HTTPServerHandler { 26 | var buffer = Data() 27 | weak var delegate: HTTPServerDelegate? 28 | let getVerb: NSString = "GET" 29 | 30 | public func register(delegate: HTTPServerDelegate) { 31 | self.delegate = delegate 32 | } 33 | 34 | public func createResponse(headers: [String: String]) -> Data { 35 | #if os(watchOS) 36 | //TODO: build response header 37 | return Data() 38 | #else 39 | let response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, HTTPWSHeader.switchProtocolCode, 40 | nil, kCFHTTPVersion1_1).takeRetainedValue() 41 | 42 | //TODO: add other values to make a proper response here... 43 | //TODO: also sec key thing (Sec-WebSocket-Key) 44 | for (key, value) in headers { 45 | CFHTTPMessageSetHeaderFieldValue(response, key as CFString, value as CFString) 46 | } 47 | guard let cfData = CFHTTPMessageCopySerializedMessage(response)?.takeRetainedValue() else { 48 | return Data() 49 | } 50 | return cfData as Data 51 | #endif 52 | } 53 | 54 | public func parse(data: Data) { 55 | buffer.append(data) 56 | if parseContent(data: buffer) { 57 | buffer = Data() 58 | } 59 | } 60 | 61 | //returns true when the buffer should be cleared 62 | func parseContent(data: Data) -> Bool { 63 | var pointer = [UInt8]() 64 | data.withUnsafeBytes { pointer.append(contentsOf: $0) } 65 | #if os(watchOS) 66 | //TODO: parse data 67 | return false 68 | #else 69 | let response = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, true).takeRetainedValue() 70 | if !CFHTTPMessageAppendBytes(response, pointer, data.count) { 71 | return false //not enough data, wait for more 72 | } 73 | if !CFHTTPMessageIsHeaderComplete(response) { 74 | return false //not enough data, wait for more 75 | } 76 | if let method = CFHTTPMessageCopyRequestMethod(response)?.takeRetainedValue() { 77 | if (method as NSString) != getVerb { 78 | delegate?.didReceive(event: .failure(HTTPUpgradeError.invalidData)) 79 | return true 80 | } 81 | } 82 | 83 | if let cfHeaders = CFHTTPMessageCopyAllHeaderFields(response) { 84 | let nsHeaders = cfHeaders.takeRetainedValue() as NSDictionary 85 | var headers = [String: String]() 86 | for (key, value) in nsHeaders { 87 | if let key = key as? String, let value = value as? String { 88 | headers[key] = value 89 | } 90 | } 91 | delegate?.didReceive(event: .success(headers)) 92 | return true 93 | } 94 | 95 | delegate?.didReceive(event: .failure(HTTPUpgradeError.invalidData)) 96 | return true 97 | #endif 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/HaptikCommerceLib/HaptikCommerceLib-xcframeworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | 12 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 13 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 14 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 15 | 16 | 17 | variant_for_slice() 18 | { 19 | case "$1" in 20 | "HaptikCommerce.xcframework/ios-arm64") 21 | echo "" 22 | ;; 23 | "HaptikCommerce.xcframework/ios-arm64_x86_64-simulator") 24 | echo "simulator" 25 | ;; 26 | esac 27 | } 28 | 29 | archs_for_slice() 30 | { 31 | case "$1" in 32 | "HaptikCommerce.xcframework/ios-arm64") 33 | echo "arm64" 34 | ;; 35 | "HaptikCommerce.xcframework/ios-arm64_x86_64-simulator") 36 | echo "arm64 x86_64" 37 | ;; 38 | esac 39 | } 40 | 41 | copy_dir() 42 | { 43 | local source="$1" 44 | local destination="$2" 45 | 46 | # Use filter instead of exclude so missing patterns don't throw errors. 47 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" \"${source}*\" \"${destination}\"" 48 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" "${source}"/* "${destination}" 49 | } 50 | 51 | SELECT_SLICE_RETVAL="" 52 | 53 | select_slice() { 54 | local xcframework_name="$1" 55 | xcframework_name="${xcframework_name##*/}" 56 | local paths=("${@:2}") 57 | # Locate the correct slice of the .xcframework for the current architectures 58 | local target_path="" 59 | 60 | # Split archs on space so we can find a slice that has all the needed archs 61 | local target_archs=$(echo $ARCHS | tr " " "\n") 62 | 63 | local target_variant="" 64 | if [[ "$PLATFORM_NAME" == *"simulator" ]]; then 65 | target_variant="simulator" 66 | fi 67 | if [[ ! -z ${EFFECTIVE_PLATFORM_NAME+x} && "$EFFECTIVE_PLATFORM_NAME" == *"maccatalyst" ]]; then 68 | target_variant="maccatalyst" 69 | fi 70 | for i in ${!paths[@]}; do 71 | local matched_all_archs="1" 72 | local slice_archs="$(archs_for_slice "${xcframework_name}/${paths[$i]}")" 73 | local slice_variant="$(variant_for_slice "${xcframework_name}/${paths[$i]}")" 74 | for target_arch in $target_archs; do 75 | if ! [[ "${slice_variant}" == "$target_variant" ]]; then 76 | matched_all_archs="0" 77 | break 78 | fi 79 | 80 | if ! echo "${slice_archs}" | tr " " "\n" | grep -F -q -x "$target_arch"; then 81 | matched_all_archs="0" 82 | break 83 | fi 84 | done 85 | 86 | if [[ "$matched_all_archs" == "1" ]]; then 87 | # Found a matching slice 88 | echo "Selected xcframework slice ${paths[$i]}" 89 | SELECT_SLICE_RETVAL=${paths[$i]} 90 | break 91 | fi 92 | done 93 | } 94 | 95 | install_xcframework() { 96 | local basepath="$1" 97 | local name="$2" 98 | local package_type="$3" 99 | local paths=("${@:4}") 100 | 101 | # Locate the correct slice of the .xcframework for the current architectures 102 | select_slice "${basepath}" "${paths[@]}" 103 | local target_path="$SELECT_SLICE_RETVAL" 104 | if [[ -z "$target_path" ]]; then 105 | echo "warning: [CP] $(basename ${basepath}): Unable to find matching slice in '${paths[@]}' for the current build architectures ($ARCHS) and platform (${EFFECTIVE_PLATFORM_NAME-${PLATFORM_NAME}})." 106 | return 107 | fi 108 | local source="$basepath/$target_path" 109 | 110 | local destination="${PODS_XCFRAMEWORKS_BUILD_DIR}/${name}" 111 | 112 | if [ ! -d "$destination" ]; then 113 | mkdir -p "$destination" 114 | fi 115 | 116 | copy_dir "$source/" "$destination" 117 | echo "Copied $source to $destination" 118 | } 119 | 120 | install_xcframework "${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework" "HaptikCommerceLib" "framework" "ios-arm64" "ios-arm64_x86_64-simulator" 121 | 122 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Objective-C ### 4 | # Xcode 5 | # 6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 7 | 8 | ## User settings 9 | xcuserdata/ 10 | 11 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 12 | *.xcscmblueprint 13 | *.xccheckout 14 | 15 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 16 | build/ 17 | DerivedData/ 18 | *.moved-aside 19 | *.pbxuser 20 | !default.pbxuser 21 | *.mode1v3 22 | !default.mode1v3 23 | *.mode2v3 24 | !default.mode2v3 25 | *.perspectivev3 26 | !default.perspectivev3 27 | 28 | ## Obj-C/Swift specific 29 | *.hmap 30 | 31 | ## App packaging 32 | *.ipa 33 | 34 | # CocoaPods 35 | # We recommend against adding the Pods directory to your .gitignore. However 36 | # you should judge for yourself, the pros and cons are mentioned at: 37 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 38 | Pods/ 39 | # Add this line if you want to avoid checking in source code from the Xcode workspace 40 | # *.xcworkspace 41 | 42 | # Carthage 43 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 44 | # Carthage/Checkouts 45 | 46 | Carthage/Build/ 47 | 48 | # fastlane 49 | # It is recommended to not store the screenshots in the git repo. 50 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 53 | 54 | fastlane/report.xml 55 | fastlane/Preview.html 56 | fastlane/screenshots/**/*.png 57 | fastlane/test_output 58 | 59 | # Code Injection 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | 65 | ### Objective-C Patch ### 66 | 67 | ### Swift ### 68 | # Xcode 69 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 70 | 71 | 72 | 73 | 74 | 75 | 76 | ## Playgrounds 77 | timeline.xctimeline 78 | playground.xcworkspace 79 | 80 | # Swift Package Manager 81 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 82 | # Packages/ 83 | # Package.pins 84 | # Package.resolved 85 | # *.xcodeproj 86 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 87 | # hence it is not needed unless you have added a package configuration file to your project 88 | # .swiftpm 89 | 90 | .build/ 91 | 92 | # CocoaPods 93 | # We recommend against adding the Pods directory to your .gitignore. However 94 | # you should judge for yourself, the pros and cons are mentioned at: 95 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 96 | Pods/ 97 | # Add this line if you want to avoid checking in source code from the Xcode workspace 98 | # *.xcworkspace 99 | 100 | # Carthage 101 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 102 | # Carthage/Checkouts 103 | 104 | 105 | # Accio dependency management 106 | Dependencies/ 107 | .accio/ 108 | 109 | # fastlane 110 | # It is recommended to not store the screenshots in the git repo. 111 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 112 | # For more information about the recommended setup visit: 113 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 114 | 115 | 116 | # Code Injection 117 | # After new code Injection tools there's a generated folder /iOSInjectionProject 118 | # https://github.com/johnno1962/injectionforxcode 119 | 120 | 121 | ### Xcode ### 122 | # Xcode 123 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 124 | 125 | 126 | 127 | 128 | ## Gcc Patch 129 | /*.gcno 130 | 131 | ### Xcode Patch ### 132 | *.xcodeproj/* 133 | !*.xcodeproj/project.pbxproj 134 | !*.xcodeproj/xcshareddata/ 135 | !*.xcworkspace/contents.xcworkspacedata 136 | **/xcshareddata/WorkspaceSettings.xcsettings 137 | 138 | ## Generated Frameworks 139 | Products/ 140 | 141 | # End of https://www.toptal.com/developers/gitignore/api/swift,xcode,objective-c 142 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Framer/FrameCollector.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // FrameCollector.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 1/24/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public protocol FrameCollectorDelegate: class { 26 | func didForm(event: FrameCollector.Event) 27 | func decompress(data: Data, isFinal: Bool) -> Data? 28 | } 29 | 30 | public class FrameCollector { 31 | public enum Event { 32 | case text(String) 33 | case binary(Data) 34 | case pong(Data?) 35 | case ping(Data?) 36 | case error(Error) 37 | case closed(String, UInt16) 38 | } 39 | weak var delegate: FrameCollectorDelegate? 40 | var buffer = Data() 41 | var frameCount = 0 42 | var isText = false //was the first frame a text frame or a binary frame? 43 | var needsDecompression = false 44 | 45 | public func add(frame: Frame) { 46 | //check single frame action and out of order frames 47 | if frame.opcode == .connectionClose { 48 | var code = frame.closeCode 49 | var reason = "connection closed by server" 50 | if let customCloseReason = String(data: frame.payload, encoding: .utf8) { 51 | reason = customCloseReason 52 | } else { 53 | code = CloseCode.protocolError.rawValue 54 | } 55 | delegate?.didForm(event: .closed(reason, code)) 56 | return 57 | } else if frame.opcode == .pong { 58 | delegate?.didForm(event: .pong(frame.payload)) 59 | return 60 | } else if frame.opcode == .ping { 61 | delegate?.didForm(event: .ping(frame.payload)) 62 | return 63 | } else if frame.opcode == .continueFrame && frameCount == 0 { 64 | let errCode = CloseCode.protocolError.rawValue 65 | delegate?.didForm(event: .error(WSError(type: .protocolError, message: "first frame can't be a continue frame", code: errCode))) 66 | reset() 67 | return 68 | } else if frameCount > 0 && frame.opcode != .continueFrame { 69 | let errCode = CloseCode.protocolError.rawValue 70 | delegate?.didForm(event: .error(WSError(type: .protocolError, message: "second and beyond of fragment message must be a continue frame", code: errCode))) 71 | reset() 72 | return 73 | } 74 | if frameCount == 0 { 75 | isText = frame.opcode == .textFrame 76 | needsDecompression = frame.needsDecompression 77 | } 78 | 79 | let payload: Data 80 | if needsDecompression { 81 | payload = delegate?.decompress(data: frame.payload, isFinal: frame.isFin) ?? frame.payload 82 | } else { 83 | payload = frame.payload 84 | } 85 | buffer.append(payload) 86 | frameCount += 1 87 | 88 | if frame.isFin { 89 | if isText { 90 | if let string = String(data: buffer, encoding: .utf8) { 91 | delegate?.didForm(event: .text(string)) 92 | } else { 93 | let errCode = CloseCode.protocolError.rawValue 94 | delegate?.didForm(event: .error(WSError(type: .protocolError, message: "not valid UTF-8 data", code: errCode))) 95 | } 96 | } else { 97 | delegate?.didForm(event: .binary(buffer)) 98 | } 99 | reset() 100 | } 101 | } 102 | 103 | func reset() { 104 | buffer = Data() 105 | frameCount = 0 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Example/Demo_pod/Demo_pod/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Target Support Files/HaptikCommerceLib/HaptikCommerceLib-copy-dsyms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | # Used as a return value for each invocation of `strip_invalid_archs` function. 12 | STRIP_BINARY_RETVAL=0 13 | 14 | # Strip invalid architectures 15 | strip_invalid_archs() { 16 | binary="$1" 17 | warn_missing_arch=${2:-true} 18 | # Get architectures for current target binary 19 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 20 | # Intersect them with the architectures we are building for 21 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 22 | # If there are no archs supported by this binary then warn the user 23 | if [[ -z "$intersected_archs" ]]; then 24 | if [[ "$warn_missing_arch" == "true" ]]; then 25 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 26 | fi 27 | STRIP_BINARY_RETVAL=1 28 | return 29 | fi 30 | stripped="" 31 | for arch in $binary_archs; do 32 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 33 | # Strip non-valid architectures in-place 34 | lipo -remove "$arch" -output "$binary" "$binary" 35 | stripped="$stripped $arch" 36 | fi 37 | done 38 | if [[ "$stripped" ]]; then 39 | echo "Stripped $binary of architectures:$stripped" 40 | fi 41 | STRIP_BINARY_RETVAL=0 42 | } 43 | 44 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 45 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 46 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 47 | 48 | # Copies and strips a vendored dSYM 49 | install_dsym() { 50 | local source="$1" 51 | warn_missing_arch=${2:-true} 52 | if [ -r "$source" ]; then 53 | # Copy the dSYM into the targets temp dir. 54 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 55 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 56 | 57 | local basename 58 | basename="$(basename -s .dSYM "$source")" 59 | binary_name="$(ls "$source/Contents/Resources/DWARF")" 60 | binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" 61 | 62 | # Strip invalid architectures from the dSYM. 63 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 64 | strip_invalid_archs "$binary" "$warn_missing_arch" 65 | fi 66 | if [[ $STRIP_BINARY_RETVAL == 0 ]]; then 67 | # Move the stripped file into its final destination. 68 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 69 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 70 | else 71 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 72 | mkdir -p "${DWARF_DSYM_FOLDER_PATH}" 73 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" 74 | fi 75 | fi 76 | } 77 | 78 | # Copies the bcsymbolmap files of a vendored framework 79 | install_bcsymbolmap() { 80 | local bcsymbolmap_path="$1" 81 | local destination="${BUILT_PRODUCTS_DIR}" 82 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 83 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 84 | } 85 | 86 | install_dsym "${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64.dSYM" 87 | install_dsym "${PODS_ROOT}/../../../Frameworks/HaptikCommerceLib/HaptikCommerce.dSYMs/HaptikCommerce.framework.ios-arm64_x86_64-simulator.dSYM" 88 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Framer/FoundationHTTPHandler.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // FoundationHTTPHandler.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 1/25/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | #if os(watchOS) 25 | public typealias FoundationHTTPHandler = StringHTTPHandler 26 | #else 27 | public class FoundationHTTPHandler: HTTPHandler { 28 | 29 | var buffer = Data() 30 | weak var delegate: HTTPHandlerDelegate? 31 | 32 | public init() { 33 | 34 | } 35 | 36 | public func convert(request: URLRequest) -> Data { 37 | let msg = CFHTTPMessageCreateRequest(kCFAllocatorDefault, request.httpMethod! as CFString, 38 | request.url! as CFURL, kCFHTTPVersion1_1).takeRetainedValue() 39 | if let headers = request.allHTTPHeaderFields { 40 | for (aKey, aValue) in headers { 41 | CFHTTPMessageSetHeaderFieldValue(msg, aKey as CFString, aValue as CFString) 42 | } 43 | } 44 | if let body = request.httpBody { 45 | CFHTTPMessageSetBody(msg, body as CFData) 46 | } 47 | guard let data = CFHTTPMessageCopySerializedMessage(msg) else { 48 | return Data() 49 | } 50 | return data.takeRetainedValue() as Data 51 | } 52 | 53 | public func parse(data: Data) -> Int { 54 | let offset = findEndOfHTTP(data: data) 55 | if offset > 0 { 56 | buffer.append(data.subdata(in: 0.. Bool { 68 | var pointer = [UInt8]() 69 | data.withUnsafeBytes { pointer.append(contentsOf: $0) } 70 | 71 | let response = CFHTTPMessageCreateEmpty(kCFAllocatorDefault, false).takeRetainedValue() 72 | if !CFHTTPMessageAppendBytes(response, pointer, data.count) { 73 | return false //not enough data, wait for more 74 | } 75 | if !CFHTTPMessageIsHeaderComplete(response) { 76 | return false //not enough data, wait for more 77 | } 78 | 79 | let code = CFHTTPMessageGetResponseStatusCode(response) 80 | if code != HTTPWSHeader.switchProtocolCode { 81 | delegate?.didReceiveHTTP(event: .failure(HTTPUpgradeError.notAnUpgrade(code))) 82 | return true 83 | } 84 | 85 | if let cfHeaders = CFHTTPMessageCopyAllHeaderFields(response) { 86 | let nsHeaders = cfHeaders.takeRetainedValue() as NSDictionary 87 | var headers = [String: String]() 88 | for (key, value) in nsHeaders { 89 | if let key = key as? String, let value = value as? String { 90 | headers[key] = value 91 | } 92 | } 93 | delegate?.didReceiveHTTP(event: .success(headers)) 94 | return true 95 | } 96 | 97 | delegate?.didReceiveHTTP(event: .failure(HTTPUpgradeError.invalidData)) 98 | return true 99 | } 100 | 101 | public func register(delegate: HTTPHandlerDelegate) { 102 | self.delegate = delegate 103 | } 104 | 105 | private func findEndOfHTTP(data: Data) -> Int { 106 | let endBytes = [UInt8(ascii: "\r"), UInt8(ascii: "\n"), UInt8(ascii: "\r"), UInt8(ascii: "\n")] 107 | var pointer = [UInt8]() 108 | data.withUnsafeBytes { pointer.append(contentsOf: $0) } 109 | var k = 0 110 | for i in 0.. Data { 35 | guard let url = request.url else { 36 | return Data() 37 | } 38 | 39 | var path = url.absoluteString 40 | let offset = (url.scheme?.count ?? 2) + 3 41 | path = String(path[path.index(path.startIndex, offsetBy: offset).. Int { 71 | let offset = findEndOfHTTP(data: data) 72 | if offset > 0 { 73 | buffer.append(data.subdata(in: 0.. Bool { 85 | guard let str = String(data: data, encoding: .utf8) else { 86 | delegate?.didReceiveHTTP(event: .failure(HTTPUpgradeError.invalidData)) 87 | return true 88 | } 89 | let splitArr = str.components(separatedBy: "\r\n") 90 | var code = -1 91 | var i = 0 92 | var headers = [String: String]() 93 | for str in splitArr { 94 | if i == 0 { 95 | let responseSplit = str.components(separatedBy: .whitespaces) 96 | guard responseSplit.count > 1 else { 97 | delegate?.didReceiveHTTP(event: .failure(HTTPUpgradeError.invalidData)) 98 | return true 99 | } 100 | if let c = Int(responseSplit[1]) { 101 | code = c 102 | } 103 | } else { 104 | guard let separatorIndex = str.firstIndex(of: ":") else { break } 105 | let key = str.prefix(upTo: separatorIndex).trimmingCharacters(in: .whitespaces) 106 | let val = str.suffix(from: str.index(after: separatorIndex)).trimmingCharacters(in: .whitespaces) 107 | headers[key.lowercased()] = val 108 | } 109 | i += 1 110 | } 111 | 112 | if code != HTTPWSHeader.switchProtocolCode { 113 | delegate?.didReceiveHTTP(event: .failure(HTTPUpgradeError.notAnUpgrade(code))) 114 | return true 115 | } 116 | 117 | delegate?.didReceiveHTTP(event: .success(headers)) 118 | return true 119 | } 120 | 121 | public func register(delegate: HTTPHandlerDelegate) { 122 | self.delegate = delegate 123 | } 124 | 125 | private func findEndOfHTTP(data: Data) -> Int { 126 | let endBytes = [UInt8(ascii: "\r"), UInt8(ascii: "\n"), UInt8(ascii: "\r"), UInt8(ascii: "\n")] 127 | var pointer = [UInt8]() 128 | data.withUnsafeBytes { pointer.append(contentsOf: $0) } 129 | var k = 0 130 | for i in 0.. 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 39 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Headers/HaptikCommerce-Swift.h 8 | 9 | rmwZj5hK0ii1tvwgycqThOKuCkU= 10 | 11 | Headers/HaptikCommerce.h 12 | 13 | 0Ak6/aCJO0EkUsodWqIOX5FeUOg= 14 | 15 | Info.plist 16 | 17 | B4VcV33+WUMil0Lzqlff5FlXapA= 18 | 19 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.abi.json 20 | 21 | 20rblH+W56w67Ttv6s2huo5NdoM= 22 | 23 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.private.swiftinterface 24 | 25 | ROkn+RqUgaum7+1w+t5WFyYSCgw= 26 | 27 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftdoc 28 | 29 | mmfj6QiNRjQ6MMJiEHqoocCcGXw= 30 | 31 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftinterface 32 | 33 | ROkn+RqUgaum7+1w+t5WFyYSCgw= 34 | 35 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftmodule 36 | 37 | XFLuI1M2e89Z5TIZ3K/jotrVc9c= 38 | 39 | Modules/module.modulemap 40 | 41 | kEZ2qfjc0Fe1wh79fQmSEBgkrUc= 42 | 43 | PrivacyInfo.xcprivacy 44 | 45 | VEhjocORkWieOuakGdzLrjoUDQU= 46 | 47 | record_error.mp3 48 | 49 | uqTvJbAM0KGaTTYWETAQO7liFc0= 50 | 51 | record_start.mp3 52 | 53 | qV1cC+0fCbTQ5/mOizPeWriaviU= 54 | 55 | record_stop.mp3 56 | 57 | gnEvoFfkOVNrdEVakSYXPmVmTmg= 58 | 59 | 60 | files2 61 | 62 | Headers/HaptikCommerce-Swift.h 63 | 64 | hash2 65 | 66 | hmNCQySsns3ggNefSzdZa0viZvovgadaPlCGX/yGSgA= 67 | 68 | 69 | Headers/HaptikCommerce.h 70 | 71 | hash2 72 | 73 | +LFGLikshxiyIX8AOxP2GpEZRH70AHNBHNin3sRaiI4= 74 | 75 | 76 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.abi.json 77 | 78 | hash2 79 | 80 | 7huGefqs48ARxC3lKi9OczD5kTQID6JKOs+imS9TvXE= 81 | 82 | 83 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.private.swiftinterface 84 | 85 | hash2 86 | 87 | +HPyWn3W7wFkvdIcDlna/g9Foil30jXpTt5VF6JXzBE= 88 | 89 | 90 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftdoc 91 | 92 | hash2 93 | 94 | XmAEih068kvUNn76i8+3UMDYe/TM/gCo1WbdlUXzmt8= 95 | 96 | 97 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftinterface 98 | 99 | hash2 100 | 101 | +HPyWn3W7wFkvdIcDlna/g9Foil30jXpTt5VF6JXzBE= 102 | 103 | 104 | Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftmodule 105 | 106 | hash2 107 | 108 | r+1LuYbMjwWrd/VhPMqwniA+wbkzOLw33XDAyiKQAwE= 109 | 110 | 111 | Modules/module.modulemap 112 | 113 | hash2 114 | 115 | gIQ+lD8rW/axB9ZSBIeZbKDbVqzNhdAA2p/wInaX/lE= 116 | 117 | 118 | PrivacyInfo.xcprivacy 119 | 120 | hash2 121 | 122 | yD2PxCzUPAFaup2cpjTM22p2XgM9aV1p8JRdDbbcDWQ= 123 | 124 | 125 | record_error.mp3 126 | 127 | hash2 128 | 129 | X7OcFrB9ZMPSqdGxx5QeWtARLY4qhHRoKwWfmCufS28= 130 | 131 | 132 | record_start.mp3 133 | 134 | hash2 135 | 136 | mlSPJ3ArrYm5sTir0a8OyVglbHPKH1+lrBx1qmBEapQ= 137 | 138 | 139 | record_stop.mp3 140 | 141 | hash2 142 | 143 | VqSpSmZaZVJWUg5Yq/ngoRjCIbBYfIxb7F/AJvlBRBI= 144 | 145 | 146 | 147 | rules 148 | 149 | ^.* 150 | 151 | ^.*\.lproj/ 152 | 153 | optional 154 | 155 | weight 156 | 1000 157 | 158 | ^.*\.lproj/locversion.plist$ 159 | 160 | omit 161 | 162 | weight 163 | 1100 164 | 165 | ^Base\.lproj/ 166 | 167 | weight 168 | 1010 169 | 170 | ^version.plist$ 171 | 172 | 173 | rules2 174 | 175 | .*\.dSYM($|/) 176 | 177 | weight 178 | 11 179 | 180 | ^(.*/)?\.DS_Store$ 181 | 182 | omit 183 | 184 | weight 185 | 2000 186 | 187 | ^.* 188 | 189 | ^.*\.lproj/ 190 | 191 | optional 192 | 193 | weight 194 | 1000 195 | 196 | ^.*\.lproj/locversion.plist$ 197 | 198 | omit 199 | 200 | weight 201 | 1100 202 | 203 | ^Base\.lproj/ 204 | 205 | weight 206 | 1010 207 | 208 | ^Info\.plist$ 209 | 210 | omit 211 | 212 | weight 213 | 20 214 | 215 | ^PkgInfo$ 216 | 217 | omit 218 | 219 | weight 220 | 20 221 | 222 | ^embedded\.provisionprofile$ 223 | 224 | weight 225 | 20 226 | 227 | ^version\.plist$ 228 | 229 | weight 230 | 20 231 | 232 | 233 | 234 | 235 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Framer/HTTPHandler.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // HTTPHandler.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 1/24/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public enum HTTPUpgradeError: Error { 26 | case notAnUpgrade(Int) 27 | case invalidData 28 | } 29 | 30 | public struct HTTPWSHeader { 31 | static let upgradeName = "Upgrade" 32 | static let upgradeValue = "websocket" 33 | static let hostName = "Host" 34 | static let connectionName = "Connection" 35 | static let connectionValue = "Upgrade" 36 | static let protocolName = "Sec-WebSocket-Protocol" 37 | static let versionName = "Sec-WebSocket-Version" 38 | static let versionValue = "13" 39 | static let extensionName = "Sec-WebSocket-Extensions" 40 | static let keyName = "Sec-WebSocket-Key" 41 | static let originName = "Origin" 42 | static let acceptName = "Sec-WebSocket-Accept" 43 | static let switchProtocolCode = 101 44 | static let defaultSSLSchemes = ["wss", "https"] 45 | 46 | /// Creates a new URLRequest based off the source URLRequest. 47 | /// - Parameter request: the request to "upgrade" the WebSocket request by adding headers. 48 | /// - Parameter supportsCompression: set if the client support text compression. 49 | /// - Parameter secKeyName: the security key to use in the WebSocket request. https://tools.ietf.org/html/rfc6455#section-1.3 50 | /// - returns: A URLRequest request to be converted to data and sent to the server. 51 | public static func createUpgrade(request: URLRequest, supportsCompression: Bool, secKeyValue: String) -> URLRequest { 52 | guard let url = request.url, let parts = url.getParts() else { 53 | return request 54 | } 55 | 56 | var req = request 57 | if request.value(forHTTPHeaderField: HTTPWSHeader.originName) == nil { 58 | var origin = url.absoluteString 59 | if let hostUrl = URL (string: "/", relativeTo: url) { 60 | origin = hostUrl.absoluteString 61 | origin.remove(at: origin.index(before: origin.endIndex)) 62 | } 63 | req.setValue(origin, forHTTPHeaderField: HTTPWSHeader.originName) 64 | } 65 | req.setValue(HTTPWSHeader.upgradeValue, forHTTPHeaderField: HTTPWSHeader.upgradeName) 66 | req.setValue(HTTPWSHeader.connectionValue, forHTTPHeaderField: HTTPWSHeader.connectionName) 67 | req.setValue(HTTPWSHeader.versionValue, forHTTPHeaderField: HTTPWSHeader.versionName) 68 | req.setValue(secKeyValue, forHTTPHeaderField: HTTPWSHeader.keyName) 69 | 70 | if let cookies = HTTPCookieStorage.shared.cookies(for: url), !cookies.isEmpty { 71 | let headers = HTTPCookie.requestHeaderFields(with: cookies) 72 | for (key, val) in headers { 73 | req.setValue(val, forHTTPHeaderField: key) 74 | } 75 | } 76 | 77 | if supportsCompression { 78 | let val = "permessage-deflate; client_max_window_bits; server_max_window_bits=15" 79 | req.setValue(val, forHTTPHeaderField: HTTPWSHeader.extensionName) 80 | } 81 | let hostValue = req.allHTTPHeaderFields?[HTTPWSHeader.hostName] ?? "\(parts.host):\(parts.port)" 82 | req.setValue(hostValue, forHTTPHeaderField: HTTPWSHeader.hostName) 83 | return req 84 | } 85 | 86 | // generateWebSocketKey 16 random characters between a-z and return them as a base64 string 87 | public static func generateWebSocketKey() -> String { 88 | return Data((0..<16).map{ _ in UInt8.random(in: 97...122) }).base64EncodedString() 89 | } 90 | } 91 | 92 | public enum HTTPEvent { 93 | case success([String: String]) 94 | case failure(Error) 95 | } 96 | 97 | public protocol HTTPHandlerDelegate: class { 98 | func didReceiveHTTP(event: HTTPEvent) 99 | } 100 | 101 | public protocol HTTPHandler { 102 | func register(delegate: HTTPHandlerDelegate) 103 | func convert(request: URLRequest) -> Data 104 | func parse(data: Data) -> Int 105 | } 106 | 107 | public protocol HTTPServerDelegate: class { 108 | func didReceive(event: HTTPEvent) 109 | } 110 | 111 | public protocol HTTPServerHandler { 112 | func register(delegate: HTTPServerDelegate) 113 | func parse(data: Data) 114 | func createResponse(headers: [String: String]) -> Data 115 | } 116 | 117 | public struct URLParts { 118 | let port: Int 119 | let host: String 120 | let isTLS: Bool 121 | } 122 | 123 | public extension URL { 124 | /// isTLSScheme returns true if the scheme is https or wss 125 | var isTLSScheme: Bool { 126 | guard let scheme = self.scheme else { 127 | return false 128 | } 129 | return HTTPWSHeader.defaultSSLSchemes.contains(scheme) 130 | } 131 | 132 | /// getParts pulls host and port from the url. 133 | func getParts() -> URLParts? { 134 | guard let host = self.host else { 135 | return nil // no host, this isn't a valid url 136 | } 137 | let isTLS = isTLSScheme 138 | var port = self.port ?? 0 139 | if self.port == nil { 140 | if isTLS { 141 | port = 443 142 | } else { 143 | port = 80 144 | } 145 | } 146 | return URLParts(port: port, host: host, isTLS: isTLS) 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Transport/TCPTransport.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // HTTPTransport.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 1/23/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | #if canImport(Network) 24 | import Foundation 25 | import Network 26 | 27 | public enum TCPTransportError: Error { 28 | case invalidRequest 29 | } 30 | 31 | @available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) 32 | public class TCPTransport: Transport { 33 | private var connection: NWConnection? 34 | private let queue = DispatchQueue(label: "com.vluxe.starscream.networkstream", attributes: []) 35 | private weak var delegate: TransportEventClient? 36 | private var isRunning = false 37 | private var isTLS = false 38 | 39 | public var usingTLS: Bool { 40 | return self.isTLS 41 | } 42 | 43 | public init(connection: NWConnection) { 44 | self.connection = connection 45 | start() 46 | } 47 | 48 | public init() { 49 | //normal connection, will use the "connect" method below 50 | } 51 | 52 | public func connect(url: URL, timeout: Double = 10, certificatePinning: CertificatePinning? = nil) { 53 | guard let parts = url.getParts() else { 54 | delegate?.connectionChanged(state: .failed(TCPTransportError.invalidRequest)) 55 | return 56 | } 57 | self.isTLS = parts.isTLS 58 | let options = NWProtocolTCP.Options() 59 | options.connectionTimeout = Int(timeout.rounded(.up)) 60 | 61 | let tlsOptions = isTLS ? NWProtocolTLS.Options() : nil 62 | if let tlsOpts = tlsOptions { 63 | sec_protocol_options_set_verify_block(tlsOpts.securityProtocolOptions, { (sec_protocol_metadata, sec_trust, sec_protocol_verify_complete) in 64 | let trust = sec_trust_copy_ref(sec_trust).takeRetainedValue() 65 | guard let pinner = certificatePinning else { 66 | sec_protocol_verify_complete(true) 67 | return 68 | } 69 | pinner.evaluateTrust(trust: trust, domain: parts.host, completion: { (state) in 70 | switch state { 71 | case .success: 72 | sec_protocol_verify_complete(true) 73 | case .failed(_): 74 | sec_protocol_verify_complete(false) 75 | } 76 | }) 77 | }, queue) 78 | } 79 | let parameters = NWParameters(tls: tlsOptions, tcp: options) 80 | let conn = NWConnection(host: NWEndpoint.Host.name(parts.host, nil), port: NWEndpoint.Port(rawValue: UInt16(parts.port))!, using: parameters) 81 | connection = conn 82 | start() 83 | } 84 | 85 | public func disconnect() { 86 | isRunning = false 87 | connection?.cancel() 88 | } 89 | 90 | public func register(delegate: TransportEventClient) { 91 | self.delegate = delegate 92 | } 93 | 94 | public func write(data: Data, completion: @escaping ((Error?) -> ())) { 95 | connection?.send(content: data, completion: .contentProcessed { (error) in 96 | completion(error) 97 | }) 98 | } 99 | 100 | private func start() { 101 | guard let conn = connection else { 102 | return 103 | } 104 | conn.stateUpdateHandler = { [weak self] (newState) in 105 | switch newState { 106 | case .ready: 107 | self?.delegate?.connectionChanged(state: .connected) 108 | case .waiting: 109 | self?.delegate?.connectionChanged(state: .waiting) 110 | case .cancelled: 111 | self?.delegate?.connectionChanged(state: .cancelled) 112 | case .failed(let error): 113 | self?.delegate?.connectionChanged(state: .failed(error)) 114 | case .setup, .preparing: 115 | break 116 | @unknown default: 117 | break 118 | } 119 | } 120 | 121 | conn.viabilityUpdateHandler = { [weak self] (isViable) in 122 | self?.delegate?.connectionChanged(state: .viability(isViable)) 123 | } 124 | 125 | conn.betterPathUpdateHandler = { [weak self] (isBetter) in 126 | self?.delegate?.connectionChanged(state: .shouldReconnect(isBetter)) 127 | } 128 | 129 | conn.start(queue: queue) 130 | isRunning = true 131 | readLoop() 132 | } 133 | 134 | //readLoop keeps reading from the connection to get the latest content 135 | private func readLoop() { 136 | if !isRunning { 137 | return 138 | } 139 | connection?.receive(minimumIncompleteLength: 2, maximumLength: 4096, completion: {[weak self] (data, context, isComplete, error) in 140 | guard let s = self else {return} 141 | if let data = data { 142 | s.delegate?.connectionChanged(state: .receive(data)) 143 | } 144 | 145 | // Refer to https://developer.apple.com/documentation/network/implementing_netcat_with_network_framework 146 | if let context = context, context.isFinal, isComplete { 147 | return 148 | } 149 | 150 | if error == nil { 151 | s.readLoop() 152 | } 153 | 154 | }) 155 | } 156 | } 157 | #else 158 | typealias TCPTransport = FoundationTransport 159 | #endif 160 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) 3 | // swift-module-flags: -target arm64-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name HaptikCommerce 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | import AVFoundation 6 | import Foundation 7 | @_exported import HaptikCommerce 8 | import Speech 9 | import Swift 10 | import UIKit 11 | import WebKit 12 | import _Concurrency 13 | import _StringProcessing 14 | import _SwiftConcurrencyShims 15 | extension Swift.String : Swift.Error { 16 | } 17 | @_inheritsConvenienceInitializers @objc public class HPCommerceAttributesBuilder : ObjectiveC.NSObject { 18 | @objc public var sessionID: Swift.String 19 | @objc public var sourceController: Swift.String 20 | @objc public var category: Swift.String 21 | @objc public var abExperiment: Swift.Bool 22 | @objc public var ASREngine: HaptikCommerce.ASRMode 23 | @objc public var controllerUUID: Swift.String? 24 | @objc public var posterDescription: Swift.String? 25 | @objc public var posterID: Swift.String? 26 | @objc public var posterTitle: Swift.String? 27 | @objc public var cart: Swift.String? 28 | @objc public var customerID: Swift.String 29 | @objc public var debug: Swift.Bool 30 | @objc public var geo: Swift.String 31 | @objc public var language: HaptikCommerce.HPLanguage 32 | @objc public var mode: Swift.String? 33 | @objc public var pageTitle: Swift.String? 34 | @objc public var pageType: Swift.String? 35 | @objc public var pincode: Swift.String 36 | @objc public var productID: Swift.String? 37 | @objc public var productName: Swift.String? 38 | @objc public var query: Swift.String? 39 | @objc public var realTime: Swift.Bool 40 | @objc public var removeOptionBackground: Swift.Bool 41 | @objc public var searchCriteria: Swift.String? 42 | @objc public var speak: HaptikCommerce.HPSpeechMode 43 | @objc public var storeApp: Swift.Bool 44 | @objc public var tags: Swift.String? 45 | @objc public var TTSEngine: HaptikCommerce.TTSMode 46 | @objc public var TTSVoice: HaptikCommerce.TTSVoice 47 | @objc public var TTSVoiceType: HaptikCommerce.TTSVoiceType 48 | @objc public var voiceFirst: Swift.Bool 49 | @objc public var headers: [Swift.String : Swift.String] 50 | @objc public var customQueryData: [Swift.String : Swift.String]? 51 | @objc public class func build(data builderData: @escaping (HaptikCommerce.HPCommerceAttributesBuilder) -> Swift.Void) -> Self 52 | @objc override dynamic public init() 53 | @objc deinit 54 | } 55 | @objc public protocol HPExternalEvent { 56 | @objc func didReceiveHaptikEvent(_ eventData: Swift.String) 57 | @objc func didReceiveHaptikError(_ error: Foundation.NSError) 58 | @objc func startRecording(_ status: Swift.Bool) 59 | } 60 | @objc public enum HPLanguage : Swift.Int { 61 | case englishUK 62 | case englishUS 63 | case englishIN 64 | case hindi 65 | public init?(rawValue: Swift.Int) 66 | public typealias RawValue = Swift.Int 67 | public var rawValue: Swift.Int { 68 | get 69 | } 70 | } 71 | @objc public enum HPSpeechMode : Swift.Int { 72 | case alwaysOn 73 | case alwaysOff 74 | case whenSpokenTo 75 | public init?(rawValue: Swift.Int) 76 | public typealias RawValue = Swift.Int 77 | public var rawValue: Swift.Int { 78 | get 79 | } 80 | } 81 | @objc public enum TTSMode : Swift.Int { 82 | case appleNative 83 | case googleTTS 84 | case reverieTTS 85 | public init?(rawValue: Swift.Int) 86 | public typealias RawValue = Swift.Int 87 | public var rawValue: Swift.Int { 88 | get 89 | } 90 | } 91 | @objc public enum TTSVoiceType : Swift.Int { 92 | case standard 93 | case wavenet 94 | public init?(rawValue: Swift.Int) 95 | public typealias RawValue = Swift.Int 96 | public var rawValue: Swift.Int { 97 | get 98 | } 99 | } 100 | @objc public enum TTSVoice : Swift.Int { 101 | case male 102 | case female 103 | public init?(rawValue: Swift.Int) 104 | public typealias RawValue = Swift.Int 105 | public var rawValue: Swift.Int { 106 | get 107 | } 108 | } 109 | @objc public enum ASRMode : Swift.Int { 110 | case appleNative 111 | @available(*, deprecated, message: "ASRMode.reverieASR is no longer supported. Implement ASRMode.thirdParty instead.") 112 | case reverieASR 113 | case thirdParty 114 | public init?(rawValue: Swift.Int) 115 | public typealias RawValue = Swift.Int 116 | public var rawValue: Swift.Int { 117 | get 118 | } 119 | } 120 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class HaptikCommerceLib : ObjectiveC.NSObject { 121 | @objc public static let sharedSDK: HaptikCommerce.HaptikCommerceLib 122 | @objc public var delegate: (any HaptikCommerce.HPExternalEvent)? 123 | @objc deinit 124 | } 125 | extension HaptikCommerce.HaptikCommerceLib { 126 | @objc dynamic public func loadConversation(launchController: UIKit.UIViewController, attributes: HaptikCommerce.HPCommerceAttributesBuilder) 127 | @objc dynamic public func unregister() 128 | @objc dynamic public func updateEventData(eventName: Swift.String, eventData: [Swift.String : Any]) 129 | @objc dynamic public func setupGoogle(apiKey: Swift.String) 130 | @objc dynamic public func setupReverie(apiKey: Swift.String, appId: Swift.String, domain: Swift.String) 131 | @objc dynamic public func updateSpeechInput(inputText: Swift.String, final: Swift.Bool) 132 | } 133 | extension HaptikCommerce.HPLanguage : Swift.Equatable {} 134 | extension HaptikCommerce.HPLanguage : Swift.Hashable {} 135 | extension HaptikCommerce.HPLanguage : Swift.RawRepresentable {} 136 | extension HaptikCommerce.HPSpeechMode : Swift.Equatable {} 137 | extension HaptikCommerce.HPSpeechMode : Swift.Hashable {} 138 | extension HaptikCommerce.HPSpeechMode : Swift.RawRepresentable {} 139 | extension HaptikCommerce.TTSMode : Swift.Equatable {} 140 | extension HaptikCommerce.TTSMode : Swift.Hashable {} 141 | extension HaptikCommerce.TTSMode : Swift.RawRepresentable {} 142 | extension HaptikCommerce.TTSVoiceType : Swift.Equatable {} 143 | extension HaptikCommerce.TTSVoiceType : Swift.Hashable {} 144 | extension HaptikCommerce.TTSVoiceType : Swift.RawRepresentable {} 145 | extension HaptikCommerce.TTSVoice : Swift.Equatable {} 146 | extension HaptikCommerce.TTSVoice : Swift.Hashable {} 147 | extension HaptikCommerce.TTSVoice : Swift.RawRepresentable {} 148 | extension HaptikCommerce.ASRMode : Swift.Equatable {} 149 | extension HaptikCommerce.ASRMode : Swift.Hashable {} 150 | extension HaptikCommerce.ASRMode : Swift.RawRepresentable {} 151 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/arm64-apple-ios.private.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) 3 | // swift-module-flags: -target arm64-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name HaptikCommerce 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | import AVFoundation 6 | import Foundation 7 | @_exported import HaptikCommerce 8 | import Speech 9 | import Swift 10 | import UIKit 11 | import WebKit 12 | import _Concurrency 13 | import _StringProcessing 14 | import _SwiftConcurrencyShims 15 | extension Swift.String : Swift.Error { 16 | } 17 | @_inheritsConvenienceInitializers @objc public class HPCommerceAttributesBuilder : ObjectiveC.NSObject { 18 | @objc public var sessionID: Swift.String 19 | @objc public var sourceController: Swift.String 20 | @objc public var category: Swift.String 21 | @objc public var abExperiment: Swift.Bool 22 | @objc public var ASREngine: HaptikCommerce.ASRMode 23 | @objc public var controllerUUID: Swift.String? 24 | @objc public var posterDescription: Swift.String? 25 | @objc public var posterID: Swift.String? 26 | @objc public var posterTitle: Swift.String? 27 | @objc public var cart: Swift.String? 28 | @objc public var customerID: Swift.String 29 | @objc public var debug: Swift.Bool 30 | @objc public var geo: Swift.String 31 | @objc public var language: HaptikCommerce.HPLanguage 32 | @objc public var mode: Swift.String? 33 | @objc public var pageTitle: Swift.String? 34 | @objc public var pageType: Swift.String? 35 | @objc public var pincode: Swift.String 36 | @objc public var productID: Swift.String? 37 | @objc public var productName: Swift.String? 38 | @objc public var query: Swift.String? 39 | @objc public var realTime: Swift.Bool 40 | @objc public var removeOptionBackground: Swift.Bool 41 | @objc public var searchCriteria: Swift.String? 42 | @objc public var speak: HaptikCommerce.HPSpeechMode 43 | @objc public var storeApp: Swift.Bool 44 | @objc public var tags: Swift.String? 45 | @objc public var TTSEngine: HaptikCommerce.TTSMode 46 | @objc public var TTSVoice: HaptikCommerce.TTSVoice 47 | @objc public var TTSVoiceType: HaptikCommerce.TTSVoiceType 48 | @objc public var voiceFirst: Swift.Bool 49 | @objc public var headers: [Swift.String : Swift.String] 50 | @objc public var customQueryData: [Swift.String : Swift.String]? 51 | @objc public class func build(data builderData: @escaping (HaptikCommerce.HPCommerceAttributesBuilder) -> Swift.Void) -> Self 52 | @objc override dynamic public init() 53 | @objc deinit 54 | } 55 | @objc public protocol HPExternalEvent { 56 | @objc func didReceiveHaptikEvent(_ eventData: Swift.String) 57 | @objc func didReceiveHaptikError(_ error: Foundation.NSError) 58 | @objc func startRecording(_ status: Swift.Bool) 59 | } 60 | @objc public enum HPLanguage : Swift.Int { 61 | case englishUK 62 | case englishUS 63 | case englishIN 64 | case hindi 65 | public init?(rawValue: Swift.Int) 66 | public typealias RawValue = Swift.Int 67 | public var rawValue: Swift.Int { 68 | get 69 | } 70 | } 71 | @objc public enum HPSpeechMode : Swift.Int { 72 | case alwaysOn 73 | case alwaysOff 74 | case whenSpokenTo 75 | public init?(rawValue: Swift.Int) 76 | public typealias RawValue = Swift.Int 77 | public var rawValue: Swift.Int { 78 | get 79 | } 80 | } 81 | @objc public enum TTSMode : Swift.Int { 82 | case appleNative 83 | case googleTTS 84 | case reverieTTS 85 | public init?(rawValue: Swift.Int) 86 | public typealias RawValue = Swift.Int 87 | public var rawValue: Swift.Int { 88 | get 89 | } 90 | } 91 | @objc public enum TTSVoiceType : Swift.Int { 92 | case standard 93 | case wavenet 94 | public init?(rawValue: Swift.Int) 95 | public typealias RawValue = Swift.Int 96 | public var rawValue: Swift.Int { 97 | get 98 | } 99 | } 100 | @objc public enum TTSVoice : Swift.Int { 101 | case male 102 | case female 103 | public init?(rawValue: Swift.Int) 104 | public typealias RawValue = Swift.Int 105 | public var rawValue: Swift.Int { 106 | get 107 | } 108 | } 109 | @objc public enum ASRMode : Swift.Int { 110 | case appleNative 111 | @available(*, deprecated, message: "ASRMode.reverieASR is no longer supported. Implement ASRMode.thirdParty instead.") 112 | case reverieASR 113 | case thirdParty 114 | public init?(rawValue: Swift.Int) 115 | public typealias RawValue = Swift.Int 116 | public var rawValue: Swift.Int { 117 | get 118 | } 119 | } 120 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class HaptikCommerceLib : ObjectiveC.NSObject { 121 | @objc public static let sharedSDK: HaptikCommerce.HaptikCommerceLib 122 | @objc public var delegate: (any HaptikCommerce.HPExternalEvent)? 123 | @objc deinit 124 | } 125 | extension HaptikCommerce.HaptikCommerceLib { 126 | @objc dynamic public func loadConversation(launchController: UIKit.UIViewController, attributes: HaptikCommerce.HPCommerceAttributesBuilder) 127 | @objc dynamic public func unregister() 128 | @objc dynamic public func updateEventData(eventName: Swift.String, eventData: [Swift.String : Any]) 129 | @objc dynamic public func setupGoogle(apiKey: Swift.String) 130 | @objc dynamic public func setupReverie(apiKey: Swift.String, appId: Swift.String, domain: Swift.String) 131 | @objc dynamic public func updateSpeechInput(inputText: Swift.String, final: Swift.Bool) 132 | } 133 | extension HaptikCommerce.HPLanguage : Swift.Equatable {} 134 | extension HaptikCommerce.HPLanguage : Swift.Hashable {} 135 | extension HaptikCommerce.HPLanguage : Swift.RawRepresentable {} 136 | extension HaptikCommerce.HPSpeechMode : Swift.Equatable {} 137 | extension HaptikCommerce.HPSpeechMode : Swift.Hashable {} 138 | extension HaptikCommerce.HPSpeechMode : Swift.RawRepresentable {} 139 | extension HaptikCommerce.TTSMode : Swift.Equatable {} 140 | extension HaptikCommerce.TTSMode : Swift.Hashable {} 141 | extension HaptikCommerce.TTSMode : Swift.RawRepresentable {} 142 | extension HaptikCommerce.TTSVoiceType : Swift.Equatable {} 143 | extension HaptikCommerce.TTSVoiceType : Swift.Hashable {} 144 | extension HaptikCommerce.TTSVoiceType : Swift.RawRepresentable {} 145 | extension HaptikCommerce.TTSVoice : Swift.Equatable {} 146 | extension HaptikCommerce.TTSVoice : Swift.Hashable {} 147 | extension HaptikCommerce.TTSVoice : Swift.RawRepresentable {} 148 | extension HaptikCommerce.ASRMode : Swift.Equatable {} 149 | extension HaptikCommerce.ASRMode : Swift.Hashable {} 150 | extension HaptikCommerce.ASRMode : Swift.RawRepresentable {} 151 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/arm64-apple-ios-simulator.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) 3 | // swift-module-flags: -target arm64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name HaptikCommerce 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | import AVFoundation 6 | import Foundation 7 | @_exported import HaptikCommerce 8 | import Speech 9 | import Swift 10 | import UIKit 11 | import WebKit 12 | import _Concurrency 13 | import _StringProcessing 14 | import _SwiftConcurrencyShims 15 | extension Swift.String : Swift.Error { 16 | } 17 | @_inheritsConvenienceInitializers @objc public class HPCommerceAttributesBuilder : ObjectiveC.NSObject { 18 | @objc public var sessionID: Swift.String 19 | @objc public var sourceController: Swift.String 20 | @objc public var category: Swift.String 21 | @objc public var abExperiment: Swift.Bool 22 | @objc public var ASREngine: HaptikCommerce.ASRMode 23 | @objc public var controllerUUID: Swift.String? 24 | @objc public var posterDescription: Swift.String? 25 | @objc public var posterID: Swift.String? 26 | @objc public var posterTitle: Swift.String? 27 | @objc public var cart: Swift.String? 28 | @objc public var customerID: Swift.String 29 | @objc public var debug: Swift.Bool 30 | @objc public var geo: Swift.String 31 | @objc public var language: HaptikCommerce.HPLanguage 32 | @objc public var mode: Swift.String? 33 | @objc public var pageTitle: Swift.String? 34 | @objc public var pageType: Swift.String? 35 | @objc public var pincode: Swift.String 36 | @objc public var productID: Swift.String? 37 | @objc public var productName: Swift.String? 38 | @objc public var query: Swift.String? 39 | @objc public var realTime: Swift.Bool 40 | @objc public var removeOptionBackground: Swift.Bool 41 | @objc public var searchCriteria: Swift.String? 42 | @objc public var speak: HaptikCommerce.HPSpeechMode 43 | @objc public var storeApp: Swift.Bool 44 | @objc public var tags: Swift.String? 45 | @objc public var TTSEngine: HaptikCommerce.TTSMode 46 | @objc public var TTSVoice: HaptikCommerce.TTSVoice 47 | @objc public var TTSVoiceType: HaptikCommerce.TTSVoiceType 48 | @objc public var voiceFirst: Swift.Bool 49 | @objc public var headers: [Swift.String : Swift.String] 50 | @objc public var customQueryData: [Swift.String : Swift.String]? 51 | @objc public class func build(data builderData: @escaping (HaptikCommerce.HPCommerceAttributesBuilder) -> Swift.Void) -> Self 52 | @objc override dynamic public init() 53 | @objc deinit 54 | } 55 | @objc public protocol HPExternalEvent { 56 | @objc func didReceiveHaptikEvent(_ eventData: Swift.String) 57 | @objc func didReceiveHaptikError(_ error: Foundation.NSError) 58 | @objc func startRecording(_ status: Swift.Bool) 59 | } 60 | @objc public enum HPLanguage : Swift.Int { 61 | case englishUK 62 | case englishUS 63 | case englishIN 64 | case hindi 65 | public init?(rawValue: Swift.Int) 66 | public typealias RawValue = Swift.Int 67 | public var rawValue: Swift.Int { 68 | get 69 | } 70 | } 71 | @objc public enum HPSpeechMode : Swift.Int { 72 | case alwaysOn 73 | case alwaysOff 74 | case whenSpokenTo 75 | public init?(rawValue: Swift.Int) 76 | public typealias RawValue = Swift.Int 77 | public var rawValue: Swift.Int { 78 | get 79 | } 80 | } 81 | @objc public enum TTSMode : Swift.Int { 82 | case appleNative 83 | case googleTTS 84 | case reverieTTS 85 | public init?(rawValue: Swift.Int) 86 | public typealias RawValue = Swift.Int 87 | public var rawValue: Swift.Int { 88 | get 89 | } 90 | } 91 | @objc public enum TTSVoiceType : Swift.Int { 92 | case standard 93 | case wavenet 94 | public init?(rawValue: Swift.Int) 95 | public typealias RawValue = Swift.Int 96 | public var rawValue: Swift.Int { 97 | get 98 | } 99 | } 100 | @objc public enum TTSVoice : Swift.Int { 101 | case male 102 | case female 103 | public init?(rawValue: Swift.Int) 104 | public typealias RawValue = Swift.Int 105 | public var rawValue: Swift.Int { 106 | get 107 | } 108 | } 109 | @objc public enum ASRMode : Swift.Int { 110 | case appleNative 111 | @available(*, deprecated, message: "ASRMode.reverieASR is no longer supported. Implement ASRMode.thirdParty instead.") 112 | case reverieASR 113 | case thirdParty 114 | public init?(rawValue: Swift.Int) 115 | public typealias RawValue = Swift.Int 116 | public var rawValue: Swift.Int { 117 | get 118 | } 119 | } 120 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class HaptikCommerceLib : ObjectiveC.NSObject { 121 | @objc public static let sharedSDK: HaptikCommerce.HaptikCommerceLib 122 | @objc public var delegate: (any HaptikCommerce.HPExternalEvent)? 123 | @objc deinit 124 | } 125 | extension HaptikCommerce.HaptikCommerceLib { 126 | @objc dynamic public func loadConversation(launchController: UIKit.UIViewController, attributes: HaptikCommerce.HPCommerceAttributesBuilder) 127 | @objc dynamic public func unregister() 128 | @objc dynamic public func updateEventData(eventName: Swift.String, eventData: [Swift.String : Any]) 129 | @objc dynamic public func setupGoogle(apiKey: Swift.String) 130 | @objc dynamic public func setupReverie(apiKey: Swift.String, appId: Swift.String, domain: Swift.String) 131 | @objc dynamic public func updateSpeechInput(inputText: Swift.String, final: Swift.Bool) 132 | } 133 | extension HaptikCommerce.HPLanguage : Swift.Equatable {} 134 | extension HaptikCommerce.HPLanguage : Swift.Hashable {} 135 | extension HaptikCommerce.HPLanguage : Swift.RawRepresentable {} 136 | extension HaptikCommerce.HPSpeechMode : Swift.Equatable {} 137 | extension HaptikCommerce.HPSpeechMode : Swift.Hashable {} 138 | extension HaptikCommerce.HPSpeechMode : Swift.RawRepresentable {} 139 | extension HaptikCommerce.TTSMode : Swift.Equatable {} 140 | extension HaptikCommerce.TTSMode : Swift.Hashable {} 141 | extension HaptikCommerce.TTSMode : Swift.RawRepresentable {} 142 | extension HaptikCommerce.TTSVoiceType : Swift.Equatable {} 143 | extension HaptikCommerce.TTSVoiceType : Swift.Hashable {} 144 | extension HaptikCommerce.TTSVoiceType : Swift.RawRepresentable {} 145 | extension HaptikCommerce.TTSVoice : Swift.Equatable {} 146 | extension HaptikCommerce.TTSVoice : Swift.Hashable {} 147 | extension HaptikCommerce.TTSVoice : Swift.RawRepresentable {} 148 | extension HaptikCommerce.ASRMode : Swift.Equatable {} 149 | extension HaptikCommerce.ASRMode : Swift.Hashable {} 150 | extension HaptikCommerce.ASRMode : Swift.RawRepresentable {} 151 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/x86_64-apple-ios-simulator.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) 3 | // swift-module-flags: -target x86_64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name HaptikCommerce 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | import AVFoundation 6 | import Foundation 7 | @_exported import HaptikCommerce 8 | import Speech 9 | import Swift 10 | import UIKit 11 | import WebKit 12 | import _Concurrency 13 | import _StringProcessing 14 | import _SwiftConcurrencyShims 15 | extension Swift.String : Swift.Error { 16 | } 17 | @_inheritsConvenienceInitializers @objc public class HPCommerceAttributesBuilder : ObjectiveC.NSObject { 18 | @objc public var sessionID: Swift.String 19 | @objc public var sourceController: Swift.String 20 | @objc public var category: Swift.String 21 | @objc public var abExperiment: Swift.Bool 22 | @objc public var ASREngine: HaptikCommerce.ASRMode 23 | @objc public var controllerUUID: Swift.String? 24 | @objc public var posterDescription: Swift.String? 25 | @objc public var posterID: Swift.String? 26 | @objc public var posterTitle: Swift.String? 27 | @objc public var cart: Swift.String? 28 | @objc public var customerID: Swift.String 29 | @objc public var debug: Swift.Bool 30 | @objc public var geo: Swift.String 31 | @objc public var language: HaptikCommerce.HPLanguage 32 | @objc public var mode: Swift.String? 33 | @objc public var pageTitle: Swift.String? 34 | @objc public var pageType: Swift.String? 35 | @objc public var pincode: Swift.String 36 | @objc public var productID: Swift.String? 37 | @objc public var productName: Swift.String? 38 | @objc public var query: Swift.String? 39 | @objc public var realTime: Swift.Bool 40 | @objc public var removeOptionBackground: Swift.Bool 41 | @objc public var searchCriteria: Swift.String? 42 | @objc public var speak: HaptikCommerce.HPSpeechMode 43 | @objc public var storeApp: Swift.Bool 44 | @objc public var tags: Swift.String? 45 | @objc public var TTSEngine: HaptikCommerce.TTSMode 46 | @objc public var TTSVoice: HaptikCommerce.TTSVoice 47 | @objc public var TTSVoiceType: HaptikCommerce.TTSVoiceType 48 | @objc public var voiceFirst: Swift.Bool 49 | @objc public var headers: [Swift.String : Swift.String] 50 | @objc public var customQueryData: [Swift.String : Swift.String]? 51 | @objc public class func build(data builderData: @escaping (HaptikCommerce.HPCommerceAttributesBuilder) -> Swift.Void) -> Self 52 | @objc override dynamic public init() 53 | @objc deinit 54 | } 55 | @objc public protocol HPExternalEvent { 56 | @objc func didReceiveHaptikEvent(_ eventData: Swift.String) 57 | @objc func didReceiveHaptikError(_ error: Foundation.NSError) 58 | @objc func startRecording(_ status: Swift.Bool) 59 | } 60 | @objc public enum HPLanguage : Swift.Int { 61 | case englishUK 62 | case englishUS 63 | case englishIN 64 | case hindi 65 | public init?(rawValue: Swift.Int) 66 | public typealias RawValue = Swift.Int 67 | public var rawValue: Swift.Int { 68 | get 69 | } 70 | } 71 | @objc public enum HPSpeechMode : Swift.Int { 72 | case alwaysOn 73 | case alwaysOff 74 | case whenSpokenTo 75 | public init?(rawValue: Swift.Int) 76 | public typealias RawValue = Swift.Int 77 | public var rawValue: Swift.Int { 78 | get 79 | } 80 | } 81 | @objc public enum TTSMode : Swift.Int { 82 | case appleNative 83 | case googleTTS 84 | case reverieTTS 85 | public init?(rawValue: Swift.Int) 86 | public typealias RawValue = Swift.Int 87 | public var rawValue: Swift.Int { 88 | get 89 | } 90 | } 91 | @objc public enum TTSVoiceType : Swift.Int { 92 | case standard 93 | case wavenet 94 | public init?(rawValue: Swift.Int) 95 | public typealias RawValue = Swift.Int 96 | public var rawValue: Swift.Int { 97 | get 98 | } 99 | } 100 | @objc public enum TTSVoice : Swift.Int { 101 | case male 102 | case female 103 | public init?(rawValue: Swift.Int) 104 | public typealias RawValue = Swift.Int 105 | public var rawValue: Swift.Int { 106 | get 107 | } 108 | } 109 | @objc public enum ASRMode : Swift.Int { 110 | case appleNative 111 | @available(*, deprecated, message: "ASRMode.reverieASR is no longer supported. Implement ASRMode.thirdParty instead.") 112 | case reverieASR 113 | case thirdParty 114 | public init?(rawValue: Swift.Int) 115 | public typealias RawValue = Swift.Int 116 | public var rawValue: Swift.Int { 117 | get 118 | } 119 | } 120 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class HaptikCommerceLib : ObjectiveC.NSObject { 121 | @objc public static let sharedSDK: HaptikCommerce.HaptikCommerceLib 122 | @objc public var delegate: (any HaptikCommerce.HPExternalEvent)? 123 | @objc deinit 124 | } 125 | extension HaptikCommerce.HaptikCommerceLib { 126 | @objc dynamic public func loadConversation(launchController: UIKit.UIViewController, attributes: HaptikCommerce.HPCommerceAttributesBuilder) 127 | @objc dynamic public func unregister() 128 | @objc dynamic public func updateEventData(eventName: Swift.String, eventData: [Swift.String : Any]) 129 | @objc dynamic public func setupGoogle(apiKey: Swift.String) 130 | @objc dynamic public func setupReverie(apiKey: Swift.String, appId: Swift.String, domain: Swift.String) 131 | @objc dynamic public func updateSpeechInput(inputText: Swift.String, final: Swift.Bool) 132 | } 133 | extension HaptikCommerce.HPLanguage : Swift.Equatable {} 134 | extension HaptikCommerce.HPLanguage : Swift.Hashable {} 135 | extension HaptikCommerce.HPLanguage : Swift.RawRepresentable {} 136 | extension HaptikCommerce.HPSpeechMode : Swift.Equatable {} 137 | extension HaptikCommerce.HPSpeechMode : Swift.Hashable {} 138 | extension HaptikCommerce.HPSpeechMode : Swift.RawRepresentable {} 139 | extension HaptikCommerce.TTSMode : Swift.Equatable {} 140 | extension HaptikCommerce.TTSMode : Swift.Hashable {} 141 | extension HaptikCommerce.TTSMode : Swift.RawRepresentable {} 142 | extension HaptikCommerce.TTSVoiceType : Swift.Equatable {} 143 | extension HaptikCommerce.TTSVoiceType : Swift.Hashable {} 144 | extension HaptikCommerce.TTSVoiceType : Swift.RawRepresentable {} 145 | extension HaptikCommerce.TTSVoice : Swift.Equatable {} 146 | extension HaptikCommerce.TTSVoice : Swift.Hashable {} 147 | extension HaptikCommerce.TTSVoice : Swift.RawRepresentable {} 148 | extension HaptikCommerce.ASRMode : Swift.Equatable {} 149 | extension HaptikCommerce.ASRMode : Swift.Hashable {} 150 | extension HaptikCommerce.ASRMode : Swift.RawRepresentable {} 151 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) 3 | // swift-module-flags: -target arm64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name HaptikCommerce 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | import AVFoundation 6 | import Foundation 7 | @_exported import HaptikCommerce 8 | import Speech 9 | import Swift 10 | import UIKit 11 | import WebKit 12 | import _Concurrency 13 | import _StringProcessing 14 | import _SwiftConcurrencyShims 15 | extension Swift.String : Swift.Error { 16 | } 17 | @_inheritsConvenienceInitializers @objc public class HPCommerceAttributesBuilder : ObjectiveC.NSObject { 18 | @objc public var sessionID: Swift.String 19 | @objc public var sourceController: Swift.String 20 | @objc public var category: Swift.String 21 | @objc public var abExperiment: Swift.Bool 22 | @objc public var ASREngine: HaptikCommerce.ASRMode 23 | @objc public var controllerUUID: Swift.String? 24 | @objc public var posterDescription: Swift.String? 25 | @objc public var posterID: Swift.String? 26 | @objc public var posterTitle: Swift.String? 27 | @objc public var cart: Swift.String? 28 | @objc public var customerID: Swift.String 29 | @objc public var debug: Swift.Bool 30 | @objc public var geo: Swift.String 31 | @objc public var language: HaptikCommerce.HPLanguage 32 | @objc public var mode: Swift.String? 33 | @objc public var pageTitle: Swift.String? 34 | @objc public var pageType: Swift.String? 35 | @objc public var pincode: Swift.String 36 | @objc public var productID: Swift.String? 37 | @objc public var productName: Swift.String? 38 | @objc public var query: Swift.String? 39 | @objc public var realTime: Swift.Bool 40 | @objc public var removeOptionBackground: Swift.Bool 41 | @objc public var searchCriteria: Swift.String? 42 | @objc public var speak: HaptikCommerce.HPSpeechMode 43 | @objc public var storeApp: Swift.Bool 44 | @objc public var tags: Swift.String? 45 | @objc public var TTSEngine: HaptikCommerce.TTSMode 46 | @objc public var TTSVoice: HaptikCommerce.TTSVoice 47 | @objc public var TTSVoiceType: HaptikCommerce.TTSVoiceType 48 | @objc public var voiceFirst: Swift.Bool 49 | @objc public var headers: [Swift.String : Swift.String] 50 | @objc public var customQueryData: [Swift.String : Swift.String]? 51 | @objc public class func build(data builderData: @escaping (HaptikCommerce.HPCommerceAttributesBuilder) -> Swift.Void) -> Self 52 | @objc override dynamic public init() 53 | @objc deinit 54 | } 55 | @objc public protocol HPExternalEvent { 56 | @objc func didReceiveHaptikEvent(_ eventData: Swift.String) 57 | @objc func didReceiveHaptikError(_ error: Foundation.NSError) 58 | @objc func startRecording(_ status: Swift.Bool) 59 | } 60 | @objc public enum HPLanguage : Swift.Int { 61 | case englishUK 62 | case englishUS 63 | case englishIN 64 | case hindi 65 | public init?(rawValue: Swift.Int) 66 | public typealias RawValue = Swift.Int 67 | public var rawValue: Swift.Int { 68 | get 69 | } 70 | } 71 | @objc public enum HPSpeechMode : Swift.Int { 72 | case alwaysOn 73 | case alwaysOff 74 | case whenSpokenTo 75 | public init?(rawValue: Swift.Int) 76 | public typealias RawValue = Swift.Int 77 | public var rawValue: Swift.Int { 78 | get 79 | } 80 | } 81 | @objc public enum TTSMode : Swift.Int { 82 | case appleNative 83 | case googleTTS 84 | case reverieTTS 85 | public init?(rawValue: Swift.Int) 86 | public typealias RawValue = Swift.Int 87 | public var rawValue: Swift.Int { 88 | get 89 | } 90 | } 91 | @objc public enum TTSVoiceType : Swift.Int { 92 | case standard 93 | case wavenet 94 | public init?(rawValue: Swift.Int) 95 | public typealias RawValue = Swift.Int 96 | public var rawValue: Swift.Int { 97 | get 98 | } 99 | } 100 | @objc public enum TTSVoice : Swift.Int { 101 | case male 102 | case female 103 | public init?(rawValue: Swift.Int) 104 | public typealias RawValue = Swift.Int 105 | public var rawValue: Swift.Int { 106 | get 107 | } 108 | } 109 | @objc public enum ASRMode : Swift.Int { 110 | case appleNative 111 | @available(*, deprecated, message: "ASRMode.reverieASR is no longer supported. Implement ASRMode.thirdParty instead.") 112 | case reverieASR 113 | case thirdParty 114 | public init?(rawValue: Swift.Int) 115 | public typealias RawValue = Swift.Int 116 | public var rawValue: Swift.Int { 117 | get 118 | } 119 | } 120 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class HaptikCommerceLib : ObjectiveC.NSObject { 121 | @objc public static let sharedSDK: HaptikCommerce.HaptikCommerceLib 122 | @objc public var delegate: (any HaptikCommerce.HPExternalEvent)? 123 | @objc deinit 124 | } 125 | extension HaptikCommerce.HaptikCommerceLib { 126 | @objc dynamic public func loadConversation(launchController: UIKit.UIViewController, attributes: HaptikCommerce.HPCommerceAttributesBuilder) 127 | @objc dynamic public func unregister() 128 | @objc dynamic public func updateEventData(eventName: Swift.String, eventData: [Swift.String : Any]) 129 | @objc dynamic public func setupGoogle(apiKey: Swift.String) 130 | @objc dynamic public func setupReverie(apiKey: Swift.String, appId: Swift.String, domain: Swift.String) 131 | @objc dynamic public func updateSpeechInput(inputText: Swift.String, final: Swift.Bool) 132 | } 133 | extension HaptikCommerce.HPLanguage : Swift.Equatable {} 134 | extension HaptikCommerce.HPLanguage : Swift.Hashable {} 135 | extension HaptikCommerce.HPLanguage : Swift.RawRepresentable {} 136 | extension HaptikCommerce.HPSpeechMode : Swift.Equatable {} 137 | extension HaptikCommerce.HPSpeechMode : Swift.Hashable {} 138 | extension HaptikCommerce.HPSpeechMode : Swift.RawRepresentable {} 139 | extension HaptikCommerce.TTSMode : Swift.Equatable {} 140 | extension HaptikCommerce.TTSMode : Swift.Hashable {} 141 | extension HaptikCommerce.TTSMode : Swift.RawRepresentable {} 142 | extension HaptikCommerce.TTSVoiceType : Swift.Equatable {} 143 | extension HaptikCommerce.TTSVoiceType : Swift.Hashable {} 144 | extension HaptikCommerce.TTSVoiceType : Swift.RawRepresentable {} 145 | extension HaptikCommerce.TTSVoice : Swift.Equatable {} 146 | extension HaptikCommerce.TTSVoice : Swift.Hashable {} 147 | extension HaptikCommerce.TTSVoice : Swift.RawRepresentable {} 148 | extension HaptikCommerce.ASRMode : Swift.Equatable {} 149 | extension HaptikCommerce.ASRMode : Swift.Hashable {} 150 | extension HaptikCommerce.ASRMode : Swift.RawRepresentable {} 151 | -------------------------------------------------------------------------------- /Frameworks/HaptikCommerceLib/HaptikCommerce.xcframework/ios-arm64_x86_64-simulator/HaptikCommerce.framework/Modules/HaptikCommerce.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface: -------------------------------------------------------------------------------- 1 | // swift-interface-format-version: 1.0 2 | // swift-compiler-version: Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) 3 | // swift-module-flags: -target x86_64-apple-ios11.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name HaptikCommerce 4 | // swift-module-flags-ignorable: -enable-bare-slash-regex 5 | import AVFoundation 6 | import Foundation 7 | @_exported import HaptikCommerce 8 | import Speech 9 | import Swift 10 | import UIKit 11 | import WebKit 12 | import _Concurrency 13 | import _StringProcessing 14 | import _SwiftConcurrencyShims 15 | extension Swift.String : Swift.Error { 16 | } 17 | @_inheritsConvenienceInitializers @objc public class HPCommerceAttributesBuilder : ObjectiveC.NSObject { 18 | @objc public var sessionID: Swift.String 19 | @objc public var sourceController: Swift.String 20 | @objc public var category: Swift.String 21 | @objc public var abExperiment: Swift.Bool 22 | @objc public var ASREngine: HaptikCommerce.ASRMode 23 | @objc public var controllerUUID: Swift.String? 24 | @objc public var posterDescription: Swift.String? 25 | @objc public var posterID: Swift.String? 26 | @objc public var posterTitle: Swift.String? 27 | @objc public var cart: Swift.String? 28 | @objc public var customerID: Swift.String 29 | @objc public var debug: Swift.Bool 30 | @objc public var geo: Swift.String 31 | @objc public var language: HaptikCommerce.HPLanguage 32 | @objc public var mode: Swift.String? 33 | @objc public var pageTitle: Swift.String? 34 | @objc public var pageType: Swift.String? 35 | @objc public var pincode: Swift.String 36 | @objc public var productID: Swift.String? 37 | @objc public var productName: Swift.String? 38 | @objc public var query: Swift.String? 39 | @objc public var realTime: Swift.Bool 40 | @objc public var removeOptionBackground: Swift.Bool 41 | @objc public var searchCriteria: Swift.String? 42 | @objc public var speak: HaptikCommerce.HPSpeechMode 43 | @objc public var storeApp: Swift.Bool 44 | @objc public var tags: Swift.String? 45 | @objc public var TTSEngine: HaptikCommerce.TTSMode 46 | @objc public var TTSVoice: HaptikCommerce.TTSVoice 47 | @objc public var TTSVoiceType: HaptikCommerce.TTSVoiceType 48 | @objc public var voiceFirst: Swift.Bool 49 | @objc public var headers: [Swift.String : Swift.String] 50 | @objc public var customQueryData: [Swift.String : Swift.String]? 51 | @objc public class func build(data builderData: @escaping (HaptikCommerce.HPCommerceAttributesBuilder) -> Swift.Void) -> Self 52 | @objc override dynamic public init() 53 | @objc deinit 54 | } 55 | @objc public protocol HPExternalEvent { 56 | @objc func didReceiveHaptikEvent(_ eventData: Swift.String) 57 | @objc func didReceiveHaptikError(_ error: Foundation.NSError) 58 | @objc func startRecording(_ status: Swift.Bool) 59 | } 60 | @objc public enum HPLanguage : Swift.Int { 61 | case englishUK 62 | case englishUS 63 | case englishIN 64 | case hindi 65 | public init?(rawValue: Swift.Int) 66 | public typealias RawValue = Swift.Int 67 | public var rawValue: Swift.Int { 68 | get 69 | } 70 | } 71 | @objc public enum HPSpeechMode : Swift.Int { 72 | case alwaysOn 73 | case alwaysOff 74 | case whenSpokenTo 75 | public init?(rawValue: Swift.Int) 76 | public typealias RawValue = Swift.Int 77 | public var rawValue: Swift.Int { 78 | get 79 | } 80 | } 81 | @objc public enum TTSMode : Swift.Int { 82 | case appleNative 83 | case googleTTS 84 | case reverieTTS 85 | public init?(rawValue: Swift.Int) 86 | public typealias RawValue = Swift.Int 87 | public var rawValue: Swift.Int { 88 | get 89 | } 90 | } 91 | @objc public enum TTSVoiceType : Swift.Int { 92 | case standard 93 | case wavenet 94 | public init?(rawValue: Swift.Int) 95 | public typealias RawValue = Swift.Int 96 | public var rawValue: Swift.Int { 97 | get 98 | } 99 | } 100 | @objc public enum TTSVoice : Swift.Int { 101 | case male 102 | case female 103 | public init?(rawValue: Swift.Int) 104 | public typealias RawValue = Swift.Int 105 | public var rawValue: Swift.Int { 106 | get 107 | } 108 | } 109 | @objc public enum ASRMode : Swift.Int { 110 | case appleNative 111 | @available(*, deprecated, message: "ASRMode.reverieASR is no longer supported. Implement ASRMode.thirdParty instead.") 112 | case reverieASR 113 | case thirdParty 114 | public init?(rawValue: Swift.Int) 115 | public typealias RawValue = Swift.Int 116 | public var rawValue: Swift.Int { 117 | get 118 | } 119 | } 120 | @_inheritsConvenienceInitializers @_hasMissingDesignatedInitializers @objc public class HaptikCommerceLib : ObjectiveC.NSObject { 121 | @objc public static let sharedSDK: HaptikCommerce.HaptikCommerceLib 122 | @objc public var delegate: (any HaptikCommerce.HPExternalEvent)? 123 | @objc deinit 124 | } 125 | extension HaptikCommerce.HaptikCommerceLib { 126 | @objc dynamic public func loadConversation(launchController: UIKit.UIViewController, attributes: HaptikCommerce.HPCommerceAttributesBuilder) 127 | @objc dynamic public func unregister() 128 | @objc dynamic public func updateEventData(eventName: Swift.String, eventData: [Swift.String : Any]) 129 | @objc dynamic public func setupGoogle(apiKey: Swift.String) 130 | @objc dynamic public func setupReverie(apiKey: Swift.String, appId: Swift.String, domain: Swift.String) 131 | @objc dynamic public func updateSpeechInput(inputText: Swift.String, final: Swift.Bool) 132 | } 133 | extension HaptikCommerce.HPLanguage : Swift.Equatable {} 134 | extension HaptikCommerce.HPLanguage : Swift.Hashable {} 135 | extension HaptikCommerce.HPLanguage : Swift.RawRepresentable {} 136 | extension HaptikCommerce.HPSpeechMode : Swift.Equatable {} 137 | extension HaptikCommerce.HPSpeechMode : Swift.Hashable {} 138 | extension HaptikCommerce.HPSpeechMode : Swift.RawRepresentable {} 139 | extension HaptikCommerce.TTSMode : Swift.Equatable {} 140 | extension HaptikCommerce.TTSMode : Swift.Hashable {} 141 | extension HaptikCommerce.TTSMode : Swift.RawRepresentable {} 142 | extension HaptikCommerce.TTSVoiceType : Swift.Equatable {} 143 | extension HaptikCommerce.TTSVoiceType : Swift.Hashable {} 144 | extension HaptikCommerce.TTSVoiceType : Swift.RawRepresentable {} 145 | extension HaptikCommerce.TTSVoice : Swift.Equatable {} 146 | extension HaptikCommerce.TTSVoice : Swift.Hashable {} 147 | extension HaptikCommerce.TTSVoice : Swift.RawRepresentable {} 148 | extension HaptikCommerce.ASRMode : Swift.Equatable {} 149 | extension HaptikCommerce.ASRMode : Swift.Hashable {} 150 | extension HaptikCommerce.ASRMode : Swift.RawRepresentable {} 151 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Starscream/WebSocket.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Websocket.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 7/16/14. 7 | // Copyright (c) 2014-2019 Dalton Cherry. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | import Foundation 24 | 25 | public enum ErrorType: Error { 26 | case compressionError 27 | case securityError 28 | case protocolError //There was an error parsing the WebSocket frames 29 | case serverError 30 | } 31 | 32 | public struct WSError: Error { 33 | public let type: ErrorType 34 | public let message: String 35 | public let code: UInt16 36 | 37 | public init(type: ErrorType, message: String, code: UInt16) { 38 | self.type = type 39 | self.message = message 40 | self.code = code 41 | } 42 | } 43 | 44 | public protocol WebSocketClient: class { 45 | func connect() 46 | func disconnect(closeCode: UInt16) 47 | func write(string: String, completion: (() -> ())?) 48 | func write(stringData: Data, completion: (() -> ())?) 49 | func write(data: Data, completion: (() -> ())?) 50 | func write(ping: Data, completion: (() -> ())?) 51 | func write(pong: Data, completion: (() -> ())?) 52 | } 53 | 54 | //implements some of the base behaviors 55 | extension WebSocketClient { 56 | public func write(string: String) { 57 | write(string: string, completion: nil) 58 | } 59 | 60 | public func write(data: Data) { 61 | write(data: data, completion: nil) 62 | } 63 | 64 | public func write(ping: Data) { 65 | write(ping: ping, completion: nil) 66 | } 67 | 68 | public func write(pong: Data) { 69 | write(pong: pong, completion: nil) 70 | } 71 | 72 | public func disconnect() { 73 | disconnect(closeCode: CloseCode.normal.rawValue) 74 | } 75 | } 76 | 77 | public enum WebSocketEvent { 78 | case connected([String: String]) 79 | case disconnected(String, UInt16) 80 | case text(String) 81 | case binary(Data) 82 | case pong(Data?) 83 | case ping(Data?) 84 | case error(Error?) 85 | case viabilityChanged(Bool) 86 | case reconnectSuggested(Bool) 87 | case cancelled 88 | } 89 | 90 | public protocol WebSocketDelegate: class { 91 | func didReceive(event: WebSocketEvent, client: WebSocket) 92 | } 93 | 94 | open class WebSocket: WebSocketClient, EngineDelegate { 95 | private let engine: Engine 96 | public weak var delegate: WebSocketDelegate? 97 | public var onEvent: ((WebSocketEvent) -> Void)? 98 | 99 | public var request: URLRequest 100 | // Where the callback is executed. It defaults to the main UI thread queue. 101 | public var callbackQueue = DispatchQueue.main 102 | public var respondToPingWithPong: Bool { 103 | set { 104 | guard let e = engine as? WSEngine else { return } 105 | e.respondToPingWithPong = newValue 106 | } 107 | get { 108 | guard let e = engine as? WSEngine else { return true } 109 | return e.respondToPingWithPong 110 | } 111 | } 112 | 113 | // serial write queue to ensure writes happen in order 114 | private let writeQueue = DispatchQueue(label: "com.vluxe.starscream.writequeue") 115 | private var canSend = false 116 | private let mutex = DispatchSemaphore(value: 1) 117 | 118 | public init(request: URLRequest, engine: Engine) { 119 | self.request = request 120 | self.engine = engine 121 | } 122 | 123 | public convenience init(request: URLRequest, certPinner: CertificatePinning? = FoundationSecurity(), compressionHandler: CompressionHandler? = nil, useCustomEngine: Bool = true) { 124 | if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *), !useCustomEngine { 125 | self.init(request: request, engine: NativeEngine()) 126 | } else if #available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) { 127 | self.init(request: request, engine: WSEngine(transport: TCPTransport(), certPinner: certPinner, compressionHandler: compressionHandler)) 128 | } else { 129 | self.init(request: request, engine: WSEngine(transport: FoundationTransport(), certPinner: certPinner, compressionHandler: compressionHandler)) 130 | } 131 | } 132 | 133 | public func connect() { 134 | engine.register(delegate: self) 135 | engine.start(request: request) 136 | } 137 | 138 | public func disconnect(closeCode: UInt16 = CloseCode.normal.rawValue) { 139 | engine.stop(closeCode: closeCode) 140 | } 141 | 142 | public func forceDisconnect() { 143 | engine.forceStop() 144 | } 145 | 146 | public func write(data: Data, completion: (() -> ())?) { 147 | write(data: data, opcode: .binaryFrame, completion: completion) 148 | } 149 | 150 | public func write(string: String, completion: (() -> ())?) { 151 | engine.write(string: string, completion: completion) 152 | } 153 | 154 | public func write(stringData: Data, completion: (() -> ())?) { 155 | write(data: stringData, opcode: .textFrame, completion: completion) 156 | } 157 | 158 | public func write(ping: Data, completion: (() -> ())?) { 159 | write(data: ping, opcode: .ping, completion: completion) 160 | } 161 | 162 | public func write(pong: Data, completion: (() -> ())?) { 163 | write(data: pong, opcode: .pong, completion: completion) 164 | } 165 | 166 | private func write(data: Data, opcode: FrameOpCode, completion: (() -> ())?) { 167 | engine.write(data: data, opcode: opcode, completion: completion) 168 | } 169 | 170 | // MARK: - EngineDelegate 171 | public func didReceive(event: WebSocketEvent) { 172 | callbackQueue.async { [weak self] in 173 | guard let s = self else { return } 174 | s.delegate?.didReceive(event: event, client: s) 175 | s.onEvent?(event) 176 | } 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /Example/Demo_Manual/Demo_Manual/Starscream.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Headers/Starscream-Swift.h 8 | 9 | u98nadvwJHy5lQqzot/+IkOT+Rc= 10 | 11 | Headers/Starscream-umbrella.h 12 | 13 | IPhBvO0wnp5Nc1N0CzN3fyjKBvA= 14 | 15 | Info.plist 16 | 17 | OHOtgJzyX7BsaOpp8O8yBtdFnRo= 18 | 19 | Modules/Starscream.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo 20 | 21 | 55prSIzk/w2lQtyrHwLp7jvOOLE= 22 | 23 | Modules/Starscream.swiftmodule/Project/x86_64.swiftsourceinfo 24 | 25 | 55prSIzk/w2lQtyrHwLp7jvOOLE= 26 | 27 | Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftdoc 28 | 29 | KSEyekZUnTvvqjFElio7kExfyJI= 30 | 31 | Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftinterface 32 | 33 | Sv+tqby1+mqgC3X//eD0QH/vYV8= 34 | 35 | Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule 36 | 37 | nAwUaK8DmC6skkvf2qtJ6VU0GZw= 38 | 39 | Modules/Starscream.swiftmodule/x86_64.swiftdoc 40 | 41 | KSEyekZUnTvvqjFElio7kExfyJI= 42 | 43 | Modules/Starscream.swiftmodule/x86_64.swiftinterface 44 | 45 | Sv+tqby1+mqgC3X//eD0QH/vYV8= 46 | 47 | Modules/Starscream.swiftmodule/x86_64.swiftmodule 48 | 49 | nAwUaK8DmC6skkvf2qtJ6VU0GZw= 50 | 51 | Modules/module.modulemap 52 | 53 | yyNUgOkPr8ym3UvMLQlv72hhQ78= 54 | 55 | 56 | files2 57 | 58 | Headers/Starscream-Swift.h 59 | 60 | hash 61 | 62 | u98nadvwJHy5lQqzot/+IkOT+Rc= 63 | 64 | hash2 65 | 66 | dgU+uz7hPH4jjXWIr/sZIa45zygh6peyorQXkwhnlCE= 67 | 68 | 69 | Headers/Starscream-umbrella.h 70 | 71 | hash 72 | 73 | IPhBvO0wnp5Nc1N0CzN3fyjKBvA= 74 | 75 | hash2 76 | 77 | LP7mg5UEuvJYcCeuR4hduxtHTsyNDfC/SuRf2jq/vaA= 78 | 79 | 80 | Modules/Starscream.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo 81 | 82 | hash 83 | 84 | 55prSIzk/w2lQtyrHwLp7jvOOLE= 85 | 86 | hash2 87 | 88 | sCEf5xlyNpS2YfkZywKlXb6bVPY7skQWhoF4+zGo2Go= 89 | 90 | 91 | Modules/Starscream.swiftmodule/Project/x86_64.swiftsourceinfo 92 | 93 | hash 94 | 95 | 55prSIzk/w2lQtyrHwLp7jvOOLE= 96 | 97 | hash2 98 | 99 | sCEf5xlyNpS2YfkZywKlXb6bVPY7skQWhoF4+zGo2Go= 100 | 101 | 102 | Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftdoc 103 | 104 | hash 105 | 106 | KSEyekZUnTvvqjFElio7kExfyJI= 107 | 108 | hash2 109 | 110 | JAJ9JcI1pVNZ7NPDnMbp0202/9aWogcSprq/sHw2K9U= 111 | 112 | 113 | Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftinterface 114 | 115 | hash 116 | 117 | Sv+tqby1+mqgC3X//eD0QH/vYV8= 118 | 119 | hash2 120 | 121 | RPOjh4lcz36J3SRSvBP48PZ2exBLGU93KWJH8NGZkRg= 122 | 123 | 124 | Modules/Starscream.swiftmodule/x86_64-apple-ios-simulator.swiftmodule 125 | 126 | hash 127 | 128 | nAwUaK8DmC6skkvf2qtJ6VU0GZw= 129 | 130 | hash2 131 | 132 | bgUFKG0bLj60chi2IUfyOyyElJ80MYBYct407PsEGIs= 133 | 134 | 135 | Modules/Starscream.swiftmodule/x86_64.swiftdoc 136 | 137 | hash 138 | 139 | KSEyekZUnTvvqjFElio7kExfyJI= 140 | 141 | hash2 142 | 143 | JAJ9JcI1pVNZ7NPDnMbp0202/9aWogcSprq/sHw2K9U= 144 | 145 | 146 | Modules/Starscream.swiftmodule/x86_64.swiftinterface 147 | 148 | hash 149 | 150 | Sv+tqby1+mqgC3X//eD0QH/vYV8= 151 | 152 | hash2 153 | 154 | RPOjh4lcz36J3SRSvBP48PZ2exBLGU93KWJH8NGZkRg= 155 | 156 | 157 | Modules/Starscream.swiftmodule/x86_64.swiftmodule 158 | 159 | hash 160 | 161 | nAwUaK8DmC6skkvf2qtJ6VU0GZw= 162 | 163 | hash2 164 | 165 | bgUFKG0bLj60chi2IUfyOyyElJ80MYBYct407PsEGIs= 166 | 167 | 168 | Modules/module.modulemap 169 | 170 | hash 171 | 172 | yyNUgOkPr8ym3UvMLQlv72hhQ78= 173 | 174 | hash2 175 | 176 | BQcMKd/ZrPl39wBt7DLqDbqurAIgvDoh00nN7q21Wis= 177 | 178 | 179 | 180 | rules 181 | 182 | ^.* 183 | 184 | ^.*\.lproj/ 185 | 186 | optional 187 | 188 | weight 189 | 1000 190 | 191 | ^.*\.lproj/locversion.plist$ 192 | 193 | omit 194 | 195 | weight 196 | 1100 197 | 198 | ^Base\.lproj/ 199 | 200 | weight 201 | 1010 202 | 203 | ^version.plist$ 204 | 205 | 206 | rules2 207 | 208 | .*\.dSYM($|/) 209 | 210 | weight 211 | 11 212 | 213 | ^(.*/)?\.DS_Store$ 214 | 215 | omit 216 | 217 | weight 218 | 2000 219 | 220 | ^.* 221 | 222 | ^.*\.lproj/ 223 | 224 | optional 225 | 226 | weight 227 | 1000 228 | 229 | ^.*\.lproj/locversion.plist$ 230 | 231 | omit 232 | 233 | weight 234 | 1100 235 | 236 | ^Base\.lproj/ 237 | 238 | weight 239 | 1010 240 | 241 | ^Info\.plist$ 242 | 243 | omit 244 | 245 | weight 246 | 20 247 | 248 | ^PkgInfo$ 249 | 250 | omit 251 | 252 | weight 253 | 20 254 | 255 | ^embedded\.provisionprofile$ 256 | 257 | weight 258 | 20 259 | 260 | ^version\.plist$ 261 | 262 | weight 263 | 20 264 | 265 | 266 | 267 | 268 | -------------------------------------------------------------------------------- /Example/Demo_pod/Pods/Starscream/Sources/Server/WebSocketServer.swift: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // WebSocketServer.swift 4 | // Starscream 5 | // 6 | // Created by Dalton Cherry on 4/5/19. 7 | // Copyright © 2019 Vluxe. All rights reserved. 8 | // 9 | // Licensed under the Apache License, Version 2.0 (the "License"); 10 | // you may not use this file except in compliance with the License. 11 | // You may obtain a copy of the License at 12 | // 13 | // http://www.apache.org/licenses/LICENSE-2.0 14 | // 15 | // Unless required by applicable law or agreed to in writing, software 16 | // distributed under the License is distributed on an "AS IS" BASIS, 17 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | // See the License for the specific language governing permissions and 19 | // limitations under the License. 20 | // 21 | ////////////////////////////////////////////////////////////////////////////////////////////////// 22 | 23 | #if canImport(Network) 24 | import Foundation 25 | import Network 26 | 27 | /// WebSocketServer is a Network.framework implementation of a WebSocket server 28 | @available(watchOS, unavailable) 29 | @available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) 30 | public class WebSocketServer: Server, ConnectionDelegate { 31 | public var onEvent: ((ServerEvent) -> Void)? 32 | private var connections = [String: ServerConnection]() 33 | private var listener: NWListener? 34 | private let queue = DispatchQueue(label: "com.vluxe.starscream.server.networkstream", attributes: []) 35 | 36 | public init() { 37 | 38 | } 39 | 40 | public func start(address: String, port: UInt16) -> Error? { 41 | //TODO: support TLS cert adding/binding 42 | let parameters = NWParameters(tls: nil, tcp: NWProtocolTCP.Options()) 43 | let p = NWEndpoint.Port(rawValue: port)! 44 | parameters.requiredLocalEndpoint = NWEndpoint.hostPort(host: NWEndpoint.Host.name(address, nil), port: p) 45 | 46 | guard let listener = try? NWListener(using: parameters, on: p) else { 47 | return WSError(type: .serverError, message: "unable to start the listener at: \(address):\(port)", code: 0) 48 | } 49 | listener.newConnectionHandler = {[weak self] conn in 50 | let transport = TCPTransport(connection: conn) 51 | let c = ServerConnection(transport: transport) 52 | c.delegate = self 53 | self?.connections[c.uuid] = c 54 | } 55 | // listener.stateUpdateHandler = { state in 56 | // switch state { 57 | // case .ready: 58 | // print("ready to get sockets!") 59 | // case .setup: 60 | // print("setup to get sockets!") 61 | // case .cancelled: 62 | // print("server cancelled!") 63 | // case .waiting(let error): 64 | // print("waiting error: \(error)") 65 | // case .failed(let error): 66 | // print("server failed: \(error)") 67 | // @unknown default: 68 | // print("wat?") 69 | // } 70 | // } 71 | self.listener = listener 72 | listener.start(queue: queue) 73 | return nil 74 | } 75 | 76 | public func didReceive(event: ServerEvent) { 77 | onEvent?(event) 78 | switch event { 79 | case .disconnected(let conn, _, _): 80 | guard let conn = conn as? ServerConnection else { 81 | return 82 | } 83 | connections.removeValue(forKey: conn.uuid) 84 | default: 85 | break 86 | } 87 | } 88 | } 89 | 90 | @available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) 91 | public class ServerConnection: Connection, HTTPServerDelegate, FramerEventClient, FrameCollectorDelegate, TransportEventClient { 92 | let transport: TCPTransport 93 | private let httpHandler = FoundationHTTPServerHandler() 94 | private let framer = WSFramer(isServer: true) 95 | private let frameHandler = FrameCollector() 96 | private var didUpgrade = false 97 | public var onEvent: ((ConnectionEvent) -> Void)? 98 | public weak var delegate: ConnectionDelegate? 99 | private let id: String 100 | var uuid: String { 101 | return id 102 | } 103 | 104 | init(transport: TCPTransport) { 105 | self.id = UUID().uuidString 106 | self.transport = transport 107 | transport.register(delegate: self) 108 | httpHandler.register(delegate: self) 109 | framer.register(delegate: self) 110 | frameHandler.delegate = self 111 | } 112 | 113 | public func write(data: Data, opcode: FrameOpCode) { 114 | let wsData = framer.createWriteFrame(opcode: opcode, payload: data, isCompressed: false) 115 | transport.write(data: wsData, completion: {_ in }) 116 | } 117 | 118 | // MARK: - TransportEventClient 119 | 120 | public func connectionChanged(state: ConnectionState) { 121 | switch state { 122 | case .connected: 123 | break 124 | case .waiting: 125 | break 126 | case .failed(let error): 127 | print("server connection error: \(error ?? WSError(type: .protocolError, message: "default error, no extra data", code: 0))") //handleError(error) 128 | case .viability(_): 129 | break 130 | case .shouldReconnect(_): 131 | break 132 | case .receive(let data): 133 | if didUpgrade { 134 | framer.add(data: data) 135 | } else { 136 | httpHandler.parse(data: data) 137 | } 138 | case .cancelled: 139 | print("server connection cancelled!") 140 | //broadcast(event: .cancelled) 141 | } 142 | } 143 | 144 | /// MARK: - HTTPServerDelegate 145 | 146 | public func didReceive(event: HTTPEvent) { 147 | switch event { 148 | case .success(let headers): 149 | didUpgrade = true 150 | let response = httpHandler.createResponse(headers: [:]) 151 | transport.write(data: response, completion: {_ in }) 152 | delegate?.didReceive(event: .connected(self, headers)) 153 | onEvent?(.connected(headers)) 154 | case .failure(let error): 155 | onEvent?(.error(error)) 156 | } 157 | } 158 | 159 | /// MARK: - FrameCollectorDelegate 160 | 161 | public func frameProcessed(event: FrameEvent) { 162 | switch event { 163 | case .frame(let frame): 164 | frameHandler.add(frame: frame) 165 | case .error(let error): 166 | onEvent?(.error(error)) 167 | } 168 | } 169 | 170 | public func didForm(event: FrameCollector.Event) { 171 | switch event { 172 | case .text(let string): 173 | delegate?.didReceive(event: .text(self, string)) 174 | onEvent?(.text(string)) 175 | case .binary(let data): 176 | delegate?.didReceive(event: .binary(self, data)) 177 | onEvent?(.binary(data)) 178 | case .pong(let data): 179 | delegate?.didReceive(event: .pong(self, data)) 180 | onEvent?(.pong(data)) 181 | case .ping(let data): 182 | delegate?.didReceive(event: .ping(self, data)) 183 | onEvent?(.ping(data)) 184 | case .closed(let reason, let code): 185 | delegate?.didReceive(event: .disconnected(self, reason, code)) 186 | onEvent?(.disconnected(reason, code)) 187 | case .error(let error): 188 | onEvent?(.error(error)) 189 | } 190 | } 191 | 192 | public func decompress(data: Data, isFinal: Bool) -> Data? { 193 | return nil 194 | } 195 | } 196 | #endif 197 | --------------------------------------------------------------------------------