Skip to content

Commit

Permalink
Merge pull request #18 from cbajapan/4.2.6-beta
Browse files Browse the repository at this point in the history
4.2.6-beta8 updates
  • Loading branch information
Cartisim authored Oct 18, 2023
2 parents 4835752 + db43b25 commit 8d03a4b
Show file tree
Hide file tree
Showing 20 changed files with 728 additions and 724 deletions.
15 changes: 15 additions & 0 deletions FCSDKiOS/4.2.6-beta8/FCSDKiOS.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Pod::Spec.new do |s|
s.name = 'FCSDKiOS'
s.version = '4.2.6-beta8'
s.summary = 'FCSDKiOS XCFramework'
s.homepage = 'https://github.com/cbajapan/swift-fcsdk-ios'

s.author = { 'Name' => 'Communication Business Avenue, Inc.' }
s.license = { :type => 'Commercial', :text => 'Copyright Communication Business Avenue, Inc. Use of this software is subject to the terms and conditions located at https://github.com/cbajapan/swift-fcsdk-ios/blob/main/License.txt'}

s.source = { :http => 'https://swift-sdk.s3.us-east-2.amazonaws.com/client_sdk/FCSDKiOS-4.2.6-beta8.xcframework.zip' }

s.platforms = { :ios => "11.0" }

s.vendored_frameworks = 'FCSDKiOS.xcframework'
end
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -20,7 +20,7 @@ let package = Package(
"FCSDKiOS",
"WebRTC"
]),
.binaryTarget(name: "FCSDKiOS", url: "https://swift-sdk.s3.us-east-2.amazonaws.com/client_sdk/FCSDKiOS-4.2.6-beta7.xcframework.zip", checksum: "4d0638ceaaa3e2c11fad4ed2bb925076c4afa80c4dfdc8d09d495beff846865b"),
.binaryTarget(name: "FCSDKiOS", url: "https://swift-sdk.s3.us-east-2.amazonaws.com/client_sdk/FCSDKiOS-4.2.6-beta8.xcframework.zip", checksum: "077c3ba261286c83409c2b33759d7bcecacef0046c7659aed930174366d71d3d"),
.binaryTarget(name: "WebRTC", url: "https://swift-sdk.s3.us-east-2.amazonaws.com/real_time/WebRTC-m117.xcframework.zip", checksum: "7950151686d41d8fc33e69a9ad5bd47cad24d20691b4167e9fa4d8d156a8fca6")
]
)
17 changes: 0 additions & 17 deletions Sources/SwiftFCSDKiOS/SwiftFCSDKiOS.docc/FCSDKExtras.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,23 +228,6 @@ Then you can just run the shell script in it's directory
`sh build.sh`
You should have an XCFramework inside of the build folder indicated in `-output`

## Logging
In order to help you with your debugging, we have provided a log to file functionality while in **DEBUG** mode. In order to access the file run the program flow with your device attached. In order to use this fuctionality you may use the following line of code. Please note you can only use this line of code once per app initialization.
Swift
```swift
ACBUC.logToFile()
```
Objective-C
```swift
[ACBUC logToFile];
```
After the program flow has completed and contains any relevent issues you expected you can navigate to Xcode's Window Tab in the status bar, select Devices and Simulators. Select the Device you ran your program on and download the Container.

![An image showing how to add FCSDKiOS](image_9.png)

Go ahead and right click on the file and select **Show Package Contents**. Next navigate into AppData, then into the Library Directory where you should find a file called **fcsdk.log**. Inspect the file to make sure it contains what you want to share.


## Self-Signed Certificates

If you are connecting to a server that uses a self-signed certificate, you need to add that certificate, and the associated CA root certificate, to the keychain on your client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Objective-C

### Threading

- We have created a new threading model built from tools by Apple. This threading model makes the best use of the voice and video concurrency flow. With that being said, whenever you are interacting with the UI in your application while interacting with the call flow, you will need to make sure you are running your code on the main thread. For example when we make a call using FCSDKiOS in the sample app, we are interacting with our apps UI during the call flow, therefore we need to make those calls on the main thread. You can run code on the main thread like so.
**FCSDKiOS** is a Swift Concurrency based SDK. The SDK is built around the concept of **Tasks**, **Actors**, and other **Swift Concurrency** features. Whenever you are interacting with the UI in your application while interacting with the call flow, you will need to make sure you are running your code on the main thread. For example when we make a call using FCSDKiOS in the sample app, we are interacting with our apps UI during the call flow, therefore we need to make those calls on the main thread. You can run code on the main thread like so.

Async/Await
```swift
Expand Down
20 changes: 16 additions & 4 deletions Sources/SwiftFCSDKiOS/SwiftFCSDKiOS.docc/Network Activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,32 @@ It is strongly encouraged to move away from the old Reachability API that Apple

## Note

You may want to consider reactively monitoring your network changes in order for FCSDK to always know when you have an internet connection, rather than only when a ACBUC Object is created.
You may want to consider reactively monitoring your network changes in order for FCSDK to always know when you have an internet connection, rather than only when a ACBUC Object is created. FCSDKiOS is designed in order to behave according to network activity. It is not designed to behave according to arbitrary network connections.

## Responding to Network Issues

As the iOS SDK is network-based, it is essential that the client application is aware of any loss of connection. **Fusion Client SDK** does not dictate how you implement network monitoring; however, the sample application uses the SystemConfiguration framework.
As the iOS SDK is network-based, it is essential that the client application is aware of any loss of connection. **Fusion Client SDK** does not dictate how you implement network monitoring; however, the sample application uses the Network.framework.

Depending on the nature of the issues with the network, the client application should react differently.

### Reacting to Network Loss

In the event of network connection problems, the SDK automatically tries to re-establish the connection. It will make seven attempts at the following intervals: 0.5s, 1s, 2s, 4s, 4s, 4s, 4s. A call to the willRetryConnectionNumber:in:\] on the ACBUCDelegate precedes each of these attempts. The callback supplies the attempt number (as an Int) and the delay before the next attempt (as an TimeInterval) in its two parameters.
In the event of network connection problems*, the SDK automatically tries to re-establish the connection. It will make seven attempts at the following intervals: 0.5s, 1s, 2s, 4s, 4s, 4s, 4s. A call to the willRetryConnectionNumber:in:\] on the ACBUCDelegate precedes each of these attempts. The callback supplies the attempt number (as an Int) and the delay before the next attempt (as an TimeInterval) in its two parameters.

When all reconnection attempts are exhausted, the ACBUCDelegate receives the ucDidLoseConnection callback, and the retries stop. At this point the client application should assume that the session is invalid. The client application should then log out of the server and reconnect via the web app to get a new session, as described in the <doc:CreatingSession> section.
When all reconnection attempts are exhausted, the ACBUCDelegate receives the ucDidLoseConnection callback, and the retries stop. At this point the client application should assume that the session is invalid. The client application should then log out of the server and reconnect via the web app to get a new session, as described in the <doc:CreatingSession> section. *This behavior explains why we define network connection problems as such (Internet Connection Required)*

If any of the reconnection attempts are successful, the ACBUCDelegate receives the ucDidReestablishConnection callback.

Note that both the willRetryConnectionNumber and ucDidReestablishConnection are optional, so the application may choose to not implement them. The connection retries are attempted regardless.

The retry intervals, and the number of retries attempted by the SDK are subject to change in future releases. Do not rely on the exact values given above.

- **A network connection problem is defined as, "The client(iOS) has an internet connection, The server is online, The server unexpectedly closes the WebSocket"**

### Reacting to Network Changes

**FCSDKiOS** has been designed with **Network.framework** as the backbone of the networking layer, that means when moving between internet path types(i.e. Wi-Fi, cellular, etc.) the SDK will recognize that the path type has changes and automatically try and reconnect without the requirement of manually tearing down the socket and then reconnecting. This proves helpful in scenarios such as getting on and off elevators. However if you would like to, you still may manually tear down the socket as you would on **BSD Sockets** as described bellow.

If the issues with the network are caused by a temporary loss of connectivity (for example, when moving between two Wi-Fi networks, or from a Wi-Fi network to a cellular data connection), the client application should not log out from the session and log back in (as described in the **Reacting to Network Loss** section), as all session state will be lost.

To avoid this, the client application should register with iOS to receive notification of changes in network reachability. When iOS notifies the client application that the network has changed, the application should pass these details to the ACBUC instance.
Expand All @@ -51,6 +55,14 @@ The application can implement the didReportInboundQualityChange callback on the
}
```

**Async/Await**
```swift
func didReportInboundQualityChange(_ inboundQuality: Int, with call: ACBClientCall) async {
// Reflect in UI
print("Call Quality: \(inboundQuality)"
}
```

The inboundQuality parameter is a number between 0 and 100, where 100 indicates perfect quality. The application might choose to show a bar in the UI, the length of the bar indicating the quality of the connection.

The SDK starts collecting metrics as soon as it receives the remote media stream. It does this every 5s, so the first quality callback fires roughly 5s after this remote media stream callback has fired.
Expand Down
176 changes: 88 additions & 88 deletions Sources/SwiftFCSDKiOS/SwiftFCSDKiOS.docc/Symbols/ACBAudioDevice.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,92 @@ ACBAudioDevice provides available device audio capabilities. Please see <doc:ACB
## Overview

```swift
/// Available AudioDevices
@objc public enum ACBAudioDevice : Int, Comparable {

/// speaker phone enabled
case speakerphone

/// wired headset enabled
case wiredHeadset

/// earpiece enabled
case earpiece

/// bluetooth enabled
case bluetooth

/// no audio device
case none
}

extension ACBAudioDevice : CaseIterable {

/// A type that can represent a collection of all values of this type.
public typealias AllCases = [FCSDKiOS.ACBAudioDevice]

/// A collection of all values of this type.
public static var allCases: [FCSDKiOS.ACBAudioDevice] { get }
}

extension ACBAudioDevice : RawRepresentable {

/// The raw type that can be used to represent all values of the conforming
/// type.
///
/// Every distinct value of the conforming type has a corresponding unique
/// value of the `RawValue` type, but there may be values of the `RawValue`
/// type that don't have a corresponding value of the conforming type.
public typealias RawValue = String

/// The corresponding value of the raw type.
///
/// A new instance initialized with `rawValue` will be equivalent to this
/// instance. For example:
///
/// enum PaperSize: String {
/// case A4, A5, Letter, Legal
/// }
///
/// let selectedSize = PaperSize.Letter
/// print(selectedSize.rawValue)
/// // Prints "Letter"
///
/// print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
/// // Prints "true"
public var rawValue: FCSDKiOS.ACBAudioDevice.RawValue { get }

/// Creates a new instance with the specified raw value.
///
/// If there is no value of the type that corresponds with the specified raw
/// value, this initializer returns `nil`. For example:
///
/// enum PaperSize: String {
/// case A4, A5, Letter, Legal
/// }
///
/// print(PaperSize(rawValue: "Legal"))
/// // Prints "Optional("PaperSize.Legal")"
///
/// print(PaperSize(rawValue: "Tabloid"))
/// // Prints "nil"
///
/// - Parameter rawValue: The raw value to use for the new instance.
public init?(rawValue: String)

/// Returns a Boolean value indicating whether the value of the first
/// argument is less than that of the second argument.
///
/// This function is the only requirement of the `Comparable` protocol. The
/// remainder of the relational operator functions are implemented by the
/// standard library for any type that conforms to `Comparable`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func < (lhs: FCSDKiOS.ACBAudioDevice, rhs: FCSDKiOS.ACBAudioDevice) -> Bool
}

extension ACBAudioDevice : Hashable {
}
/// Available AudioDevices
@objc public enum ACBAudioDevice : Int, Comparable {
/// speaker phone enabled
case speakerphone
/// wired headset enabled
case wiredHeadset
/// earpiece enabled
case earpiece
/// bluetooth enabled
case bluetooth
/// no audio device
case none
}
extension ACBAudioDevice : CaseIterable {
/// A type that can represent a collection of all values of this type.
public typealias AllCases = [FCSDKiOS.ACBAudioDevice]
/// A collection of all values of this type.
public static var allCases: [FCSDKiOS.ACBAudioDevice] { get }
}
extension ACBAudioDevice : RawRepresentable {
/// The raw type that can be used to represent all values of the conforming
/// type.
///
/// Every distinct value of the conforming type has a corresponding unique
/// value of the `RawValue` type, but there may be values of the `RawValue`
/// type that don't have a corresponding value of the conforming type.
public typealias RawValue = String
/// The corresponding value of the raw type.
///
/// A new instance initialized with `rawValue` will be equivalent to this
/// instance. For example:
///
/// enum PaperSize: String {
/// case A4, A5, Letter, Legal
/// }
///
/// let selectedSize = PaperSize.Letter
/// print(selectedSize.rawValue)
/// // Prints "Letter"
///
/// print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!)
/// // Prints "true"
public var rawValue: FCSDKiOS.ACBAudioDevice.RawValue { get }
/// Creates a new instance with the specified raw value.
///
/// If there is no value of the type that corresponds with the specified raw
/// value, this initializer returns `nil`. For example:
///
/// enum PaperSize: String {
/// case A4, A5, Letter, Legal
/// }
///
/// print(PaperSize(rawValue: "Legal"))
/// // Prints "Optional("PaperSize.Legal")"
///
/// print(PaperSize(rawValue: "Tabloid"))
/// // Prints "nil"
///
/// - Parameter rawValue: The raw value to use for the new instance.
public init?(rawValue: String)
/// Returns a Boolean value indicating whether the value of the first
/// argument is less than that of the second argument.
///
/// This function is the only requirement of the `Comparable` protocol. The
/// remainder of the relational operator functions are implemented by the
/// standard library for any type that conforms to `Comparable`.
///
/// - Parameters:
/// - lhs: A value to compare.
/// - rhs: Another value to compare.
public static func < (lhs: FCSDKiOS.ACBAudioDevice, rhs: FCSDKiOS.ACBAudioDevice) -> Bool
}
extension ACBAudioDevice : Hashable {
}
```
Loading

0 comments on commit 8d03a4b

Please sign in to comment.