@kaleyra/video-react-native-module 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +165 -0
- package/README.md +292 -0
- package/android/build.gradle +100 -0
- package/android/gradle.properties +9 -0
- package/android/settings.gradle +6 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/assets/kaleyra_video_wrapper_info.txt +1 -0
- package/android/src/main/java/com/kaleyra/video_react_native_module/ReactNativeAccessTokenProvider.kt +22 -0
- package/android/src/main/java/com/kaleyra/video_react_native_module/ReactNativeContextContainer.kt +9 -0
- package/android/src/main/java/com/kaleyra/video_react_native_module/ReactNativeVideoHybridBridge.kt +30 -0
- package/android/src/main/java/com/kaleyra/video_react_native_module/VideoNativeEmitter.kt +45 -0
- package/android/src/main/java/com/kaleyra/video_react_native_module/VideoNativeModule.kt +109 -0
- package/android/src/main/java/com/kaleyra/video_react_native_module/VideoReactPackage.kt +20 -0
- package/index.ts +47 -0
- package/ios/PluginInfo/_KaleyraVideoHybridVersionInfo.swift +31 -0
- package/ios/ReactEvents/ReactNativeEventEmitter.swift +31 -0
- package/ios/ReactEvents/VideoNativeEmitter.m +17 -0
- package/ios/ReactEvents/VideoNativeEmitter.swift +42 -0
- package/ios/ReactNativePlugin-Bridging-Header.h +5 -0
- package/ios/ReactNativePlugin.xcodeproj/project.pbxproj +301 -0
- package/ios/VideoNativeModule.m +45 -0
- package/ios/VideoNativeModule.swift +154 -0
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/native-bridge/TypeScript/Environments.js +41 -0
- package/lib/commonjs/native-bridge/TypeScript/Events.js +46 -0
- package/lib/commonjs/native-bridge/TypeScript/Regions.js +47 -0
- package/lib/commonjs/native-bridge/TypeScript/UserDetailsFormatValidator.js +32 -0
- package/lib/commonjs/native-bridge/TypeScript/errors/IllegalArgumentError.js +12 -0
- package/lib/commonjs/native-bridge/TypeScript/types/AccessTokenRequest.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/AccessTokenResponse.js +36 -0
- package/lib/commonjs/native-bridge/TypeScript/types/AudioCallOptions.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/AudioCallType.js +19 -0
- package/lib/commonjs/native-bridge/TypeScript/types/CallDisplayMode.js +23 -0
- package/lib/commonjs/native-bridge/TypeScript/types/CallKitConfiguration.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/CallOptions.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/CallType.js +23 -0
- package/lib/commonjs/native-bridge/TypeScript/types/ChatToolConfiguration.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/CreateCallOptions.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/Environment.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/IosConfiguration.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/KaleyraVideoConfiguration.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/RecordingType.js +23 -0
- package/lib/commonjs/native-bridge/TypeScript/types/Region.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/ScreenShareToolConfiguration.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/Session.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/Tools.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/UserDetails.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/UserDetailsFormat.js +4 -0
- package/lib/commonjs/native-bridge/TypeScript/types/VoipHandlingStrategy.js +19 -0
- package/lib/commonjs/src/KaleyraVideo.js +259 -0
- package/lib/commonjs/src/ReactNativeEventEmitter.js +40 -0
- package/lib/commonjs/src/events/Events.js +4 -0
- package/lib/module/index.js +2 -0
- package/lib/module/native-bridge/TypeScript/Environments.js +37 -0
- package/lib/module/native-bridge/TypeScript/Events.js +43 -0
- package/lib/module/native-bridge/TypeScript/Regions.js +43 -0
- package/lib/module/native-bridge/TypeScript/UserDetailsFormatValidator.js +28 -0
- package/lib/module/native-bridge/TypeScript/errors/IllegalArgumentError.js +8 -0
- package/lib/module/native-bridge/TypeScript/types/AccessTokenRequest.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/AccessTokenResponse.js +32 -0
- package/lib/module/native-bridge/TypeScript/types/AudioCallOptions.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/AudioCallType.js +16 -0
- package/lib/module/native-bridge/TypeScript/types/CallDisplayMode.js +20 -0
- package/lib/module/native-bridge/TypeScript/types/CallKitConfiguration.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/CallOptions.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/CallType.js +20 -0
- package/lib/module/native-bridge/TypeScript/types/ChatToolConfiguration.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/CreateCallOptions.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/Environment.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/IosConfiguration.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/KaleyraVideoConfiguration.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/RecordingType.js +20 -0
- package/lib/module/native-bridge/TypeScript/types/Region.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/ScreenShareToolConfiguration.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/Session.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/Tools.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/UserDetails.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/UserDetailsFormat.js +3 -0
- package/lib/module/native-bridge/TypeScript/types/VoipHandlingStrategy.js +16 -0
- package/lib/module/src/KaleyraVideo.js +249 -0
- package/lib/module/src/ReactNativeEventEmitter.js +36 -0
- package/lib/module/src/events/Events.js +3 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/native-bridge/TypeScript/Environments.d.ts +28 -0
- package/lib/typescript/native-bridge/TypeScript/Events.d.ts +40 -0
- package/lib/typescript/native-bridge/TypeScript/Regions.d.ts +32 -0
- package/lib/typescript/native-bridge/TypeScript/UserDetailsFormatValidator.d.ts +4 -0
- package/lib/typescript/native-bridge/TypeScript/errors/IllegalArgumentError.d.ts +6 -0
- package/lib/typescript/native-bridge/TypeScript/types/AccessTokenRequest.d.ts +4 -0
- package/lib/typescript/native-bridge/TypeScript/types/AccessTokenResponse.d.ts +12 -0
- package/lib/typescript/native-bridge/TypeScript/types/AudioCallOptions.d.ts +11 -0
- package/lib/typescript/native-bridge/TypeScript/types/AudioCallType.d.ts +13 -0
- package/lib/typescript/native-bridge/TypeScript/types/CallDisplayMode.d.ts +17 -0
- package/lib/typescript/native-bridge/TypeScript/types/CallKitConfiguration.d.ts +26 -0
- package/lib/typescript/native-bridge/TypeScript/types/CallOptions.d.ts +13 -0
- package/lib/typescript/native-bridge/TypeScript/types/CallType.d.ts +17 -0
- package/lib/typescript/native-bridge/TypeScript/types/ChatToolConfiguration.d.ts +15 -0
- package/lib/typescript/native-bridge/TypeScript/types/CreateCallOptions.d.ts +15 -0
- package/lib/typescript/native-bridge/TypeScript/types/Environment.d.ts +9 -0
- package/lib/typescript/native-bridge/TypeScript/types/IosConfiguration.d.ts +23 -0
- package/lib/typescript/native-bridge/TypeScript/types/KaleyraVideoConfiguration.d.ts +33 -0
- package/lib/typescript/native-bridge/TypeScript/types/RecordingType.d.ts +17 -0
- package/lib/typescript/native-bridge/TypeScript/types/Region.d.ts +9 -0
- package/lib/typescript/native-bridge/TypeScript/types/ScreenShareToolConfiguration.d.ts +19 -0
- package/lib/typescript/native-bridge/TypeScript/types/Session.d.ts +16 -0
- package/lib/typescript/native-bridge/TypeScript/types/Tools.d.ts +42 -0
- package/lib/typescript/native-bridge/TypeScript/types/UserDetails.d.ts +29 -0
- package/lib/typescript/native-bridge/TypeScript/types/UserDetailsFormat.d.ts +19 -0
- package/lib/typescript/native-bridge/TypeScript/types/VoipHandlingStrategy.d.ts +13 -0
- package/lib/typescript/src/KaleyraVideo.d.ts +125 -0
- package/lib/typescript/src/ReactNativeEventEmitter.d.ts +15 -0
- package/lib/typescript/src/events/Events.d.ts +37 -0
- package/native-bridge/LICENSE +165 -0
- package/native-bridge/TypeScript/Environments.ts +44 -0
- package/native-bridge/TypeScript/Events.ts +43 -0
- package/native-bridge/TypeScript/Regions.ts +51 -0
- package/native-bridge/TypeScript/UserDetailsFormatValidator.ts +35 -0
- package/native-bridge/TypeScript/errors/IllegalArgumentError.ts +9 -0
- package/native-bridge/TypeScript/types/AccessTokenRequest.ts +7 -0
- package/native-bridge/TypeScript/types/AccessTokenResponse.ts +41 -0
- package/native-bridge/TypeScript/types/AudioCallOptions.ts +15 -0
- package/native-bridge/TypeScript/types/AudioCallType.ts +17 -0
- package/native-bridge/TypeScript/types/CallDisplayMode.ts +22 -0
- package/native-bridge/TypeScript/types/CallKitConfiguration.ts +32 -0
- package/native-bridge/TypeScript/types/CallOptions.ts +18 -0
- package/native-bridge/TypeScript/types/CallType.ts +22 -0
- package/native-bridge/TypeScript/types/ChatToolConfiguration.ts +21 -0
- package/native-bridge/TypeScript/types/CreateCallOptions.ts +20 -0
- package/native-bridge/TypeScript/types/Environment.ts +12 -0
- package/native-bridge/TypeScript/types/IosConfiguration.ts +29 -0
- package/native-bridge/TypeScript/types/KaleyraVideoConfiguration.ts +42 -0
- package/native-bridge/TypeScript/types/RecordingType.ts +22 -0
- package/native-bridge/TypeScript/types/Region.ts +12 -0
- package/native-bridge/TypeScript/types/ScreenShareToolConfiguration.ts +24 -0
- package/native-bridge/TypeScript/types/Session.ts +20 -0
- package/native-bridge/TypeScript/types/Tools.ts +50 -0
- package/native-bridge/TypeScript/types/UserDetails.ts +37 -0
- package/native-bridge/TypeScript/types/UserDetailsFormat.ts +23 -0
- package/native-bridge/TypeScript/types/VoipHandlingStrategy.ts +17 -0
- package/native-bridge/android/build.gradle +72 -0
- package/native-bridge/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/native-bridge/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/native-bridge/android/gradle.properties +22 -0
- package/native-bridge/android/gradlew +234 -0
- package/native-bridge/android/gradlew.bat +89 -0
- package/native-bridge/android/settings.gradle +1 -0
- package/native-bridge/android/src/main/AndroidManifest.xml +1 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/AccessTokenProvider.kt +8 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/CallOptionsProxy.kt +9 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/ContextContainer.kt +10 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/DTOs.kt +407 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/SDKAccessTokenProviderProxy.kt +16 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/VideoHybridBridge.kt +21 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/VideoSDKHybridBridge.kt +64 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/configurator/CachedSDKConfigurator.kt +15 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/configurator/VideoSDKConfigurator.kt +46 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/connector/CachedUserConnector.kt +15 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/connector/VideoSDKCachedUserConnector.kt +60 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/Events.kt +29 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/EventsEmitter.kt +8 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/EventsReporter.kt +9 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/CallEventsReporter.kt +54 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/ChatEventsReporter.kt +43 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/CrossPlatformModuleStatus.kt +29 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/ModuleEventsReporter.kt +34 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/events/reporter/SDKEventsReporter.kt +63 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/CallDisplayExtension.kt +15 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ConfigurationExtension.kt +39 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/EnvironmentExtension.kt +12 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/RecordingTypeExtension.kt +15 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/RegionExtension.kt +13 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ScreenShareToolConfigurationExtension.kt +15 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/ToolsExtension.kt +95 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/extensions/UserExtensions.kt +35 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/notifications/KaleyraVideoNotificationReceiver.kt +139 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/notifications/KaleyraVideoNotificationService.kt +85 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/ConfigurationEntity.kt +27 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/ConnectedUserEntity.kt +30 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/Converters.kt +25 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/UserDetailsDao.kt +21 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/UserDetailsEntity.kt +22 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/repository/VideoHybridBridgeRepository.kt +39 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/ui/SDKUserInterfacePresenter.kt +49 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/ui/UserInterfacePresenter.kt +14 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/CachedUserDetails.kt +18 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/CachedUserDetailsFormatter.kt +59 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/user_details/SDKCachedUserDetails.kt +74 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/utils/CaseInsensitiveEnumTypeAdapterFactory.kt +48 -0
- package/native-bridge/android/src/main/java/com/kaleyra/video_hybrid_native_bridge/utils/TLSSocketFactoryCompat.kt +76 -0
- package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/project.pbxproj +1399 -0
- package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/xcshareddata/IDETemplateMacros.plist +9 -0
- package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcodeproj/xcshareddata/xcschemes/KaleyraVideoHybridNativeBridge.xcscheme +79 -0
- package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcworkspace/contents.xcworkspacedata +10 -0
- package/native-bridge/iOS/KaleyraVideoHybridNativeBridge.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/native-bridge/iOS/Podfile +28 -0
- package/native-bridge/iOS/Podfile.lock +20 -0
- package/native-bridge/iOS/Source/Abstractions/BandyerSDKProtocol.swift +24 -0
- package/native-bridge/iOS/Source/Abstractions/CallWindowProtocol.swift +18 -0
- package/native-bridge/iOS/Source/AccessToken/AccessTokenRequester.swift +9 -0
- package/native-bridge/iOS/Source/AccessToken/TokenProvider.swift +78 -0
- package/native-bridge/iOS/Source/Broadcast/BroadcastConfigurationPlistReader.swift +49 -0
- package/native-bridge/iOS/Source/Concurrency/DispatchQueue+isMain.swift +19 -0
- package/native-bridge/iOS/Source/Concurrency/Lock.swift +21 -0
- package/native-bridge/iOS/Source/Concurrency/MainQueueDispatcher.swift +23 -0
- package/native-bridge/iOS/Source/Concurrency/MainQueueRelay.swift +18 -0
- package/native-bridge/iOS/Source/DTOs/AccessTokenRequest+Encodable.swift +27 -0
- package/native-bridge/iOS/Source/DTOs/AccessTokenResponse+Decodable.swift +24 -0
- package/native-bridge/iOS/Source/DTOs/Array+JSON.swift +6 -0
- package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Bandyer.swift +14 -0
- package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Decodable.swift +18 -0
- package/native-bridge/iOS/Source/DTOs/AudioCallOptions+Equatable.swift +12 -0
- package/native-bridge/iOS/Source/DTOs/AudioCallType+Bandyer.swift +18 -0
- package/native-bridge/iOS/Source/DTOs/AudioCallType+Decodable.swift +25 -0
- package/native-bridge/iOS/Source/DTOs/CallKitConfiguration+Decodable.swift +20 -0
- package/native-bridge/iOS/Source/DTOs/CallOptions+Bandyer.swift +14 -0
- package/native-bridge/iOS/Source/DTOs/CallOptions+Decodable.swift +16 -0
- package/native-bridge/iOS/Source/DTOs/CallOptions+Equatable.swift +12 -0
- package/native-bridge/iOS/Source/DTOs/CallType+Bandyer.swift +20 -0
- package/native-bridge/iOS/Source/DTOs/CallType+Decodable.swift +27 -0
- package/native-bridge/iOS/Source/DTOs/ChatToolConfiguration+Decodable.swift +18 -0
- package/native-bridge/iOS/Source/DTOs/CreateCallOptions+Decodable.swift +22 -0
- package/native-bridge/iOS/Source/DTOs/CreateCallOptions+Equatable.swift +13 -0
- package/native-bridge/iOS/Source/DTOs/CreateCallOptions+Intent.swift +17 -0
- package/native-bridge/iOS/Source/DTOs/DTOs.swift +314 -0
- package/native-bridge/iOS/Source/DTOs/Environment+Bandyer.swift +20 -0
- package/native-bridge/iOS/Source/DTOs/Environment+Decodable.swift +16 -0
- package/native-bridge/iOS/Source/DTOs/IosConfiguration+Decodable.swift +18 -0
- package/native-bridge/iOS/Source/DTOs/JSONDecodable.swift +27 -0
- package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+Bandyer.swift +158 -0
- package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+Decodable.swift +28 -0
- package/native-bridge/iOS/Source/DTOs/KaleyraVideoConfiguration+UserInterfacePresenterConfiguration.swift +29 -0
- package/native-bridge/iOS/Source/DTOs/RecordingType+Bandyer.swift +33 -0
- package/native-bridge/iOS/Source/DTOs/RecordingType+Decodable.swift +27 -0
- package/native-bridge/iOS/Source/DTOs/Region+Bandyer.swift +22 -0
- package/native-bridge/iOS/Source/DTOs/Region+Decodable.swift +16 -0
- package/native-bridge/iOS/Source/DTOs/ScreenShareToolConfiguration+Decodable.swift +18 -0
- package/native-bridge/iOS/Source/DTOs/Tools+Decodable.swift +24 -0
- package/native-bridge/iOS/Source/DTOs/UserDetails+Bandyer.swift +18 -0
- package/native-bridge/iOS/Source/DTOs/UserDetails+Decodable.swift +28 -0
- package/native-bridge/iOS/Source/DTOs/UserDetailsFormat+Decodable.swift +19 -0
- package/native-bridge/iOS/Source/DTOs/VoipHandlingStrategy+Decodable.swift +25 -0
- package/native-bridge/iOS/Source/Events/Emitter/EventEmitter.swift +8 -0
- package/native-bridge/iOS/Source/Events/Events+CaseIterable.swift +18 -0
- package/native-bridge/iOS/Source/Events/Events+Description.swift +28 -0
- package/native-bridge/iOS/Source/Events/Events.swift +21 -0
- package/native-bridge/iOS/Source/Events/Reporters/CallClientEventsReporter.swift +46 -0
- package/native-bridge/iOS/Source/Events/Reporters/ChatClientEventsReporter.swift +46 -0
- package/native-bridge/iOS/Source/Events/Reporters/ClientState.swift +61 -0
- package/native-bridge/iOS/Source/Events/Reporters/EventsReporter.swift +69 -0
- package/native-bridge/iOS/Source/Events/Reporters/PushTokenEventsReporter.swift +34 -0
- package/native-bridge/iOS/Source/Extensions/URL+FromString.swift +26 -0
- package/native-bridge/iOS/Source/KaleyraVideoHybridNativeBridge.h +14 -0
- package/native-bridge/iOS/Source/NativeHybridBridge/VideoHybridNativeBridge.swift +173 -0
- package/native-bridge/iOS/Source/NativeHybridBridge/VideoHybridNativeBridgeError.swift +33 -0
- package/native-bridge/iOS/Source/UI/KaleyraVideoSDKUserInterfacePresenter.swift +249 -0
- package/native-bridge/iOS/Source/UI/Presenters/PresentingViewControllerViewControllerPresenter.swift +44 -0
- package/native-bridge/iOS/Source/UI/Presenters/ViewControllerPresenter.swift +17 -0
- package/native-bridge/iOS/Source/UI/Presenters/WindowViewControllerPresenter.swift +111 -0
- package/native-bridge/iOS/Source/UI/UserInterfacePresenter+MainQueueRelay.swift +30 -0
- package/native-bridge/iOS/Source/UI/UserInterfacePresenter.swift +14 -0
- package/native-bridge/iOS/Source/User Details/Cache/UsersDetailsCache.swift +36 -0
- package/native-bridge/iOS/Source/User Details/Formatter/FormatterProxy.swift +47 -0
- package/native-bridge/iOS/Source/User Details/Formatter/UserDetailsFormatter.swift +83 -0
- package/native-bridge/iOS/Source/User Details/Providers/UsersDetailsProvider.swift +39 -0
- package/package.json +147 -0
- package/src/KaleyraVideo.ts +343 -0
- package/src/ReactNativeEventEmitter.ts +51 -0
- package/src/events/Events.ts +46 -0
- package/video-react-native-module.podspec +36 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>FILEHEADER</key>
|
|
6
|
+
<string> Copyright © 2018-___YEAR___ ___ORGANIZATIONNAME___ All Rights Reserved.
|
|
7
|
+
// See LICENSE for licensing information</string>
|
|
8
|
+
</dict>
|
|
9
|
+
</plist>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Scheme
|
|
3
|
+
LastUpgradeVersion = "1430"
|
|
4
|
+
version = "1.7">
|
|
5
|
+
<BuildAction
|
|
6
|
+
parallelizeBuildables = "YES"
|
|
7
|
+
buildImplicitDependencies = "YES">
|
|
8
|
+
<BuildActionEntries>
|
|
9
|
+
<BuildActionEntry
|
|
10
|
+
buildForTesting = "YES"
|
|
11
|
+
buildForRunning = "YES"
|
|
12
|
+
buildForProfiling = "YES"
|
|
13
|
+
buildForArchiving = "YES"
|
|
14
|
+
buildForAnalyzing = "YES">
|
|
15
|
+
<BuildableReference
|
|
16
|
+
BuildableIdentifier = "primary"
|
|
17
|
+
BlueprintIdentifier = "F9875C6B29A661FC00A91C93"
|
|
18
|
+
BuildableName = "KaleyraVideoHybridNativeBridge.framework"
|
|
19
|
+
BlueprintName = "KaleyraVideoHybridNativeBridge"
|
|
20
|
+
ReferencedContainer = "container:KaleyraVideoHybridNativeBridge.xcodeproj">
|
|
21
|
+
</BuildableReference>
|
|
22
|
+
</BuildActionEntry>
|
|
23
|
+
</BuildActionEntries>
|
|
24
|
+
</BuildAction>
|
|
25
|
+
<TestAction
|
|
26
|
+
buildConfiguration = "Debug"
|
|
27
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
30
|
+
shouldAutocreateTestPlan = "YES">
|
|
31
|
+
<Testables>
|
|
32
|
+
<TestableReference
|
|
33
|
+
skipped = "NO"
|
|
34
|
+
parallelizable = "YES">
|
|
35
|
+
<BuildableReference
|
|
36
|
+
BuildableIdentifier = "primary"
|
|
37
|
+
BlueprintIdentifier = "F9875C7329A661FC00A91C93"
|
|
38
|
+
BuildableName = "KaleyraVideoHybridNativeBridgeTests.xctest"
|
|
39
|
+
BlueprintName = "KaleyraVideoHybridNativeBridgeTests"
|
|
40
|
+
ReferencedContainer = "container:KaleyraVideoHybridNativeBridge.xcodeproj">
|
|
41
|
+
</BuildableReference>
|
|
42
|
+
</TestableReference>
|
|
43
|
+
</Testables>
|
|
44
|
+
</TestAction>
|
|
45
|
+
<LaunchAction
|
|
46
|
+
buildConfiguration = "Debug"
|
|
47
|
+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
48
|
+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
49
|
+
launchStyle = "0"
|
|
50
|
+
useCustomWorkingDirectory = "NO"
|
|
51
|
+
ignoresPersistentStateOnLaunch = "NO"
|
|
52
|
+
debugDocumentVersioning = "YES"
|
|
53
|
+
debugServiceExtension = "internal"
|
|
54
|
+
allowLocationSimulation = "YES">
|
|
55
|
+
</LaunchAction>
|
|
56
|
+
<ProfileAction
|
|
57
|
+
buildConfiguration = "Release"
|
|
58
|
+
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
59
|
+
savedToolIdentifier = ""
|
|
60
|
+
useCustomWorkingDirectory = "NO"
|
|
61
|
+
debugDocumentVersioning = "YES">
|
|
62
|
+
<MacroExpansion>
|
|
63
|
+
<BuildableReference
|
|
64
|
+
BuildableIdentifier = "primary"
|
|
65
|
+
BlueprintIdentifier = "F9875C6B29A661FC00A91C93"
|
|
66
|
+
BuildableName = "KaleyraVideoHybridNativeBridge.framework"
|
|
67
|
+
BlueprintName = "KaleyraVideoHybridNativeBridge"
|
|
68
|
+
ReferencedContainer = "container:KaleyraVideoHybridNativeBridge.xcodeproj">
|
|
69
|
+
</BuildableReference>
|
|
70
|
+
</MacroExpansion>
|
|
71
|
+
</ProfileAction>
|
|
72
|
+
<AnalyzeAction
|
|
73
|
+
buildConfiguration = "Debug">
|
|
74
|
+
</AnalyzeAction>
|
|
75
|
+
<ArchiveAction
|
|
76
|
+
buildConfiguration = "Release"
|
|
77
|
+
revealArchiveInOrganizer = "YES">
|
|
78
|
+
</ArchiveAction>
|
|
79
|
+
</Scheme>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
# See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
platform :ios, '10.0'
|
|
5
|
+
|
|
6
|
+
target 'KaleyraVideoHybridNativeBridge' do
|
|
7
|
+
use_frameworks!
|
|
8
|
+
|
|
9
|
+
pod "Bandyer", "3.6.2"
|
|
10
|
+
|
|
11
|
+
target 'KaleyraVideoHybridNativeBridgeTests' do
|
|
12
|
+
use_frameworks!
|
|
13
|
+
|
|
14
|
+
pod 'SwiftHamcrest', '~> 2.2'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
#This post_install script is needed after updating Xcode to 14.3 version, otherwise there will be compilation issues.
|
|
20
|
+
post_install do |installer|
|
|
21
|
+
installer.generated_projects.each do |project|
|
|
22
|
+
project.targets.each do |target|
|
|
23
|
+
target.build_configurations.each do |config|
|
|
24
|
+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
PODS:
|
|
2
|
+
- Bandyer (3.6.2)
|
|
3
|
+
- SwiftHamcrest (2.2.0)
|
|
4
|
+
|
|
5
|
+
DEPENDENCIES:
|
|
6
|
+
- Bandyer (= 3.6.2)
|
|
7
|
+
- SwiftHamcrest (~> 2.2)
|
|
8
|
+
|
|
9
|
+
SPEC REPOS:
|
|
10
|
+
trunk:
|
|
11
|
+
- Bandyer
|
|
12
|
+
- SwiftHamcrest
|
|
13
|
+
|
|
14
|
+
SPEC CHECKSUMS:
|
|
15
|
+
Bandyer: bed6cd784597ce404e271d4287c9b2df950b4d79
|
|
16
|
+
SwiftHamcrest: 7162cfe5a0b399c573fef5c2534d69c5f7e182d6
|
|
17
|
+
|
|
18
|
+
PODFILE CHECKSUM: 1248a988a6a0f668e8e04a03bc1a06d6218db5d5
|
|
19
|
+
|
|
20
|
+
COCOAPODS: 1.12.1
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
import Bandyer
|
|
6
|
+
|
|
7
|
+
@available(iOS 12.0, *)
|
|
8
|
+
protocol BandyerSDKProtocol: AnyObject {
|
|
9
|
+
|
|
10
|
+
var config: Bandyer.Config? { get }
|
|
11
|
+
var userDetailsProvider: Bandyer.UserDetailsProvider? { get set }
|
|
12
|
+
var callClient: Bandyer.CallClient! { get }
|
|
13
|
+
var chatClient: Bandyer.ChatClient! { get }
|
|
14
|
+
var notificationsCoordinator: Bandyer.InAppNotificationsCoordinator? { get }
|
|
15
|
+
var callRegistry: Bandyer.CallRegistry! { get }
|
|
16
|
+
|
|
17
|
+
func configure(_ config: Bandyer.Config)
|
|
18
|
+
func connect(_ session: Bandyer.Session)
|
|
19
|
+
func verifiedUser(_ verified: Bool, for call: Bandyer.Call, completion: ((Error?) -> Void)?)
|
|
20
|
+
func disconnect()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@available(iOS 12.0, *)
|
|
24
|
+
extension BandyerSDK: BandyerSDKProtocol {}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
import Bandyer
|
|
6
|
+
|
|
7
|
+
@available(iOS 12.0, *)
|
|
8
|
+
protocol CallWindowProtocol: AnyObject {
|
|
9
|
+
|
|
10
|
+
var isHidden: Bool { get set }
|
|
11
|
+
var callDelegate: Bandyer.CallWindowDelegate? { get set }
|
|
12
|
+
|
|
13
|
+
func setConfiguration(_ configuration: Bandyer.CallViewControllerConfiguration?)
|
|
14
|
+
func presentCallViewController(for intent: Bandyer.Intent, completion: ((Error?) -> Void)?)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@available(iOS 12.0, *)
|
|
18
|
+
extension CallWindow: CallWindowProtocol {}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
import Bandyer
|
|
6
|
+
|
|
7
|
+
@available(iOS 12.0, *)
|
|
8
|
+
class TokenProvider: AccessTokenProvider {
|
|
9
|
+
|
|
10
|
+
// MARK: - Nested Types
|
|
11
|
+
|
|
12
|
+
private struct PendingRequest {
|
|
13
|
+
|
|
14
|
+
let id: String
|
|
15
|
+
let completion: (Result<String, Error>) -> Void
|
|
16
|
+
|
|
17
|
+
init(id: UUID = .init(), completion: @escaping (Result<String, Error>) -> Void) {
|
|
18
|
+
self.init(id: id.uuidString, completion: completion)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
init(id: String, completion: @escaping (Result<String, Error>) -> Void) {
|
|
22
|
+
self.id = id
|
|
23
|
+
self.completion = completion
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
func succeeded(_ token: String) {
|
|
27
|
+
completion(.success(token))
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
func failed(_ error: Error) {
|
|
31
|
+
completion(.failure(error))
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private struct ProviderError: Error {
|
|
36
|
+
|
|
37
|
+
let reason: String?
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// MARK: - Properties
|
|
41
|
+
|
|
42
|
+
private let requester: AccessTokenRequester
|
|
43
|
+
|
|
44
|
+
private lazy var requests = [PendingRequest]()
|
|
45
|
+
|
|
46
|
+
// MARK: - Init
|
|
47
|
+
|
|
48
|
+
init(requester: AccessTokenRequester) {
|
|
49
|
+
self.requester = requester
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// MARK: - AccessTokenProvider
|
|
53
|
+
|
|
54
|
+
func provideAccessToken(userId: String, completion: @escaping (Result<String, Error>) -> Void) {
|
|
55
|
+
let pendingRequest = PendingRequest(completion: completion)
|
|
56
|
+
let request = AccessTokenRequest(requestID: pendingRequest.id, userID: userId)
|
|
57
|
+
|
|
58
|
+
do {
|
|
59
|
+
try requester.requestAccessToken(request: request)
|
|
60
|
+
} catch {
|
|
61
|
+
completion(.failure(error))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
requests.append(pendingRequest)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
func onResponse(_ response: AccessTokenResponse) {
|
|
68
|
+
guard let request = requests.first(where: { $0.id == response.requestID }) else { return }
|
|
69
|
+
|
|
70
|
+
if response.success {
|
|
71
|
+
request.succeeded(response.data)
|
|
72
|
+
} else {
|
|
73
|
+
request.failed(ProviderError(reason: response.error))
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
requests.removeAll(where: { $0.id == response.requestID })
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
@available(iOS 12.0, *)
|
|
7
|
+
struct BroadcastConfigurationPlistReader {
|
|
8
|
+
|
|
9
|
+
struct BroadcastConfig {
|
|
10
|
+
|
|
11
|
+
let appGroupID: String
|
|
12
|
+
let extensionBundleID: String
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
enum ReaderError: Error {
|
|
16
|
+
case urlIsNotAFile
|
|
17
|
+
case notAPlistFile
|
|
18
|
+
case appGroupIdentifierMissing
|
|
19
|
+
case extensionBundleIdMissing
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
func read(fileURL url: URL) throws -> BroadcastConfig {
|
|
23
|
+
guard url.isFileURL else {
|
|
24
|
+
throw ReaderError.urlIsNotAFile
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
guard url.pathExtension == "plist" else {
|
|
28
|
+
throw ReaderError.notAPlistFile
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let values = try NSDictionary(contentsOf: url, error: ())
|
|
32
|
+
let appGroupValue = values.value(forKeyPath: "broadcast.appGroupIdentifier")
|
|
33
|
+
let extensionBundleIdValue = values.value(forKeyPath: "broadcast.extensionBundleIdentifier")
|
|
34
|
+
|
|
35
|
+
guard let appGroupIdentifier = appGroupValue as? String,
|
|
36
|
+
appGroupIdentifier != "",
|
|
37
|
+
appGroupIdentifier != "NOT_AVAILABLE" else {
|
|
38
|
+
throw ReaderError.appGroupIdentifierMissing
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
guard let extensionBundleId = extensionBundleIdValue as? String,
|
|
42
|
+
extensionBundleId != "",
|
|
43
|
+
extensionBundleId != "NOT_AVAILABLE" else {
|
|
44
|
+
throw ReaderError.extensionBundleIdMissing
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return .init(appGroupID: appGroupIdentifier, extensionBundleID: extensionBundleId)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
import Dispatch
|
|
6
|
+
|
|
7
|
+
@available(iOS 12.0, *)
|
|
8
|
+
public extension DispatchQueue {
|
|
9
|
+
|
|
10
|
+
private static var mainSpecificKey: DispatchSpecificKey<Void> = {
|
|
11
|
+
let key = DispatchSpecificKey<Void>()
|
|
12
|
+
DispatchQueue.main.setSpecific(key: key, value: ())
|
|
13
|
+
return key
|
|
14
|
+
}()
|
|
15
|
+
|
|
16
|
+
static var isMain: Bool {
|
|
17
|
+
DispatchQueue.getSpecific(key: mainSpecificKey) != nil
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
protocol Lock {
|
|
7
|
+
|
|
8
|
+
func sync<T>(_ work: () throws -> T) rethrows -> T
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
extension Lock where Self: NSLocking {
|
|
12
|
+
|
|
13
|
+
func sync<T>(_ work: () throws -> T) rethrows -> T {
|
|
14
|
+
lock()
|
|
15
|
+
defer { unlock() }
|
|
16
|
+
return try work()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
extension NSLock: Lock {}
|
|
21
|
+
extension NSRecursiveLock: Lock {}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
@available(iOS 12.0, *)
|
|
7
|
+
public enum MainQueueDispatcher {
|
|
8
|
+
|
|
9
|
+
public static func perform(_ work: @escaping () -> Void) {
|
|
10
|
+
guard DispatchQueue.isMain else {
|
|
11
|
+
return DispatchQueue.main.async(execute: work)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
work()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public static func performSync<T>(_ work: () -> T) -> T {
|
|
18
|
+
guard DispatchQueue.isMain else {
|
|
19
|
+
return DispatchQueue.main.sync(execute: work)
|
|
20
|
+
}
|
|
21
|
+
return work()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
@available(iOS 12.0, *)
|
|
7
|
+
final class MainQueueRelay<Decoratee> {
|
|
8
|
+
|
|
9
|
+
let decoratee: Decoratee
|
|
10
|
+
|
|
11
|
+
init(_ decoratee: Decoratee) {
|
|
12
|
+
self.decoratee = decoratee
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
func dispatch(completion: @escaping () -> Void) {
|
|
16
|
+
MainQueueDispatcher.perform(completion)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
extension AccessTokenRequest: Encodable {
|
|
7
|
+
|
|
8
|
+
private enum CodingKeys: String, CodingKey {
|
|
9
|
+
case requestID
|
|
10
|
+
case userID
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
func encode(to encoder: Encoder) throws {
|
|
14
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
15
|
+
try container.encode(requestID, forKey: .requestID)
|
|
16
|
+
try container.encode(userID, forKey: .userID)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
extension AccessTokenRequest {
|
|
21
|
+
|
|
22
|
+
func JSONEncoded() throws -> String {
|
|
23
|
+
let encoder = JSONEncoder()
|
|
24
|
+
let data = try encoder.encode(self)
|
|
25
|
+
return String(data: data, encoding: .utf8)!
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
extension AccessTokenResponse: Decodable {
|
|
7
|
+
|
|
8
|
+
private enum CodingKeys: String, CodingKey {
|
|
9
|
+
case success
|
|
10
|
+
case requestID
|
|
11
|
+
case data
|
|
12
|
+
case error
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
init(from decoder: Decoder) throws {
|
|
16
|
+
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
17
|
+
self.success = try container.decode(Bool.self, forKey: .success)
|
|
18
|
+
self.requestID = try container.decode(String.self, forKey: .requestID)
|
|
19
|
+
self.data = try container.decode(String.self, forKey: .data)
|
|
20
|
+
self.error = try container.decodeIfPresent(String.self, forKey: .error)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
extension AccessTokenResponse: JSONDecodable {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
import Bandyer
|
|
6
|
+
|
|
7
|
+
@available(iOS 12.0, *)
|
|
8
|
+
extension AudioCallOptions {
|
|
9
|
+
|
|
10
|
+
var callOptions: Bandyer.CallOptions {
|
|
11
|
+
.init(callType: type.callType,
|
|
12
|
+
recordingType: recordingType.callRecordingType)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
extension AudioCallOptions: Decodable {
|
|
7
|
+
|
|
8
|
+
private enum CodingKeys: String, CodingKey {
|
|
9
|
+
case recordingType
|
|
10
|
+
case type
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
init(from decoder: Decoder) throws {
|
|
14
|
+
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
15
|
+
self.recordingType = try container.decodeIfPresent(RecordingType.self, forKey: .recordingType)
|
|
16
|
+
self.type = try container.decode(AudioCallType.self, forKey: .type)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
@available(iOS 12.0, *)
|
|
7
|
+
extension AudioCallOptions: Equatable {
|
|
8
|
+
|
|
9
|
+
static func == (lhs: AudioCallOptions, rhs: AudioCallOptions) -> Bool {
|
|
10
|
+
lhs.callOptions == rhs.callOptions && lhs.recordingType == rhs.recordingType
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
import Bandyer
|
|
6
|
+
|
|
7
|
+
@available(iOS 12.0, *)
|
|
8
|
+
extension AudioCallType {
|
|
9
|
+
|
|
10
|
+
var callType: Bandyer.CallType {
|
|
11
|
+
switch self {
|
|
12
|
+
case .audio:
|
|
13
|
+
return .audioOnly
|
|
14
|
+
case .audioUpgradable:
|
|
15
|
+
return .audioUpgradable
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
struct UnknownAudioCallTypeError: Error {}
|
|
7
|
+
|
|
8
|
+
extension AudioCallType: Decodable {
|
|
9
|
+
|
|
10
|
+
init(from decoder: Decoder) throws {
|
|
11
|
+
let container = try decoder.singleValueContainer()
|
|
12
|
+
try self.init(try container.decode(String.self))
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
init(_ string: String) throws {
|
|
16
|
+
switch string {
|
|
17
|
+
case "audio":
|
|
18
|
+
self = .audio
|
|
19
|
+
case "audioUpgradable":
|
|
20
|
+
self = .audioUpgradable
|
|
21
|
+
default:
|
|
22
|
+
throw UnknownAudioCallTypeError()
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
extension CallKitConfiguration: Decodable {
|
|
7
|
+
|
|
8
|
+
private enum CodingKeys: String, CodingKey {
|
|
9
|
+
case enabled
|
|
10
|
+
case appIconName
|
|
11
|
+
case ringtoneSoundName
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
init(from decoder: Decoder) throws {
|
|
15
|
+
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
16
|
+
self.enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled) ?? true
|
|
17
|
+
self.appIconName = try container.decodeIfPresent(String.self, forKey: .appIconName)
|
|
18
|
+
self.ringtoneSoundName = try container.decodeIfPresent(String.self, forKey: .ringtoneSoundName)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
import Bandyer
|
|
6
|
+
|
|
7
|
+
@available(iOS 12.0, *)
|
|
8
|
+
extension CallOptions {
|
|
9
|
+
|
|
10
|
+
var callOptions: Bandyer.CallOptions {
|
|
11
|
+
.init(callType: .audioVideo,
|
|
12
|
+
recordingType: recordingType.callRecordingType)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright © 2018-2023 Kaleyra S.p.a. All Rights Reserved.
|
|
2
|
+
// See LICENSE for licensing information
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
extension CallOptions: Decodable {
|
|
7
|
+
|
|
8
|
+
private enum CodingKeys: String, CodingKey {
|
|
9
|
+
case recordingType
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
init(from decoder: Decoder) throws {
|
|
13
|
+
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
14
|
+
self.recordingType = try container.decodeIfPresent(RecordingType.self, forKey: .recordingType)
|
|
15
|
+
}
|
|
16
|
+
}
|