Skip to content

Commit

Permalink
Merge pull request #37 from salemove/release/0.29.0
Browse files Browse the repository at this point in the history
Release version 0.29.0
  • Loading branch information
gersonnoboa authored May 11, 2021
2 parents be03161 + c10f7c2 commit 766ad8a
Show file tree
Hide file tree
Showing 19 changed files with 265 additions and 93 deletions.
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ target 'ExampleApp' do
use_frameworks!

# Pods for ExampleApp
pod 'SalemoveSDK', :git => 'https://github.com/salemove/ios-bundle', :tag => "0.28.0"
pod 'SalemoveSDK', :git => 'https://github.com/salemove/ios-bundle', :tag => "0.29.0"
pod 'Kingfisher'
end

Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ let package = Package(
),
.binaryTarget(
name: "SalemoveSDK",
url: "https://github.com/salemove/ios-bundle/releases/download/0.28.0/SalemoveSDK.xcframework.zip",
checksum: "480c76ef91d4fe18752c6823d546fa91cc1d090721a90adf396d25c4ae51caca"
url: "https://github.com/salemove/ios-bundle/releases/download/0.29.0/SalemoveSDK.xcframework.zip",
checksum: "edfc95f768d2144c9626f27d488f72b7298ebcfc4d3976e943876941681b5561"
),
.target(
name: "GliaSDK",
Expand Down
2 changes: 1 addition & 1 deletion SalemoveSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|

s.module_name = 'SalemoveSDK'
s.ios.deployment_target = '12.0'
s.ios.vendored_frameworks = 'SalemoveSDK.framework'
s.ios.vendored_frameworks = 'SalemoveSDK.xcframework'
s.swift_version = '5.3'

s.dependency 'Moya', '14.0.0'
Expand Down
12 changes: 6 additions & 6 deletions SalemoveSDK.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-x86_64-simulator</string>
<key>LibraryPath</key>
<string>SalemoveSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SalemoveSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
@import Foundation;
@import ObjectiveC;
@import UIKit;
@import UserNotifications;
@import WebRTC;
#endif

Expand Down Expand Up @@ -339,6 +340,7 @@ SWIFT_CLASS("_TtC11SalemoveSDK22EngagementFileProgress")

@class VisitorContext;
@class SalemoveError;
@class Operator;

/// Basic for interacting with the Engagement
SWIFT_PROTOCOL("_TtP11SalemoveSDK18EngagementHandling_")
Expand Down Expand Up @@ -376,6 +378,8 @@ SWIFT_PROTOCOL("_TtP11SalemoveSDK18EngagementHandling_")
/// </li>
/// </ul>
@property (nonatomic, readonly, copy) void (^ _Nonnull onEngagementRequest)(void (^ _Nonnull)(VisitorContext * _Nonnull, BOOL, void (^ _Nonnull)(BOOL, SalemoveError * _Nullable)));
/// Called after an engagement has been transferred successfully to another operator.
@property (nonatomic, readonly, copy) void (^ _Nonnull onEngagementTransfer)(NSArray<Operator *> * _Nullable);
@end


Expand Down Expand Up @@ -673,6 +677,42 @@ SWIFT_CLASS("_TtC11SalemoveSDK4Push")
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

@class UNUserNotificationCenter;
@class UNNotification;
@class UNNotificationResponse;

/// The protocol to be used to notify the SDK about push notifications.
SWIFT_PROTOCOL("_TtP11SalemoveSDK24PushNotificationHandling_")
@protocol PushNotificationHandling
/// Call this method when <code>userNotificationCenter:willPresent:withCompletionHandler:</code> is called
/// from <code>UNUserNotificationCenterDelegate</code>.
/// Send all parameters that you receive in the delegate method as they are, without modifying them. By default, the completion
/// handler will not be called by the SDK, which means that iOS will not present a notification banner. If you wish to do so,
/// call the completion handler manually after calling this method.
/// <h1>Reference</h1>
/// <a href="https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate">UNUserNotificationCenterDelegate</a>
/// \param center The instance of <code>UNUserNotificationCenter</code>.
///
/// \param notification The notification, exactly as received from the delegate method.
///
/// \param completionHandler The completion handler, exactly as received from the delegate method.
///
- (void)userNotificationCenter:(UNUserNotificationCenter * _Nonnull)center willPresent:(UNNotification * _Nonnull)notification withCompletionHandler:(void (^ _Nonnull)(UNNotificationPresentationOptions))completionHandler;
/// Call this method when <code>userNotificationCenter:didReceive:withCompletionHandler:</code> is called
/// from <code>UNUserNotificationCenterDelegate</code>.
/// Send all parameters that you receive in the delegate method as they are, without modifying them. By default, the completion
/// handler will be called by the SDK, which means that iOS will present a notification banner.
/// <h1>Reference</h1>
/// <a href="https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate">UNUserNotificationCenterDelegate</a>
/// \param center The instance of <code>UNUserNotificationCenter</code>.
///
/// \param response The notification response, exactly as received from the delegate method.
///
/// \param completionHandler The completion handler, exactly as received from the delegate method.
///
- (void)userNotificationCenter:(UNUserNotificationCenter * _Nonnull)center didReceive:(UNNotificationResponse * _Nonnull)response withCompletionHandler:(void (^ _Nonnull)(void))completionHandler;
@end

/// Available push notification types.
typedef SWIFT_ENUM(NSInteger, PushNotificationType, open) {
/// The SDK will subscribe to push notifications for when the engagement starts.
Expand All @@ -683,10 +723,8 @@ typedef SWIFT_ENUM(NSInteger, PushNotificationType, open) {
PushNotificationTypeFailed = 2,
/// The SDK will subscribe to push notifications for when a new message is received.
PushNotificationTypeMessage = 3,
/// The SDK will subscribe to push notifications for when an operator is typing a message for the visitor.
/// Decide carefully when and where to use this notification, as the constant banners shown by iOS distract
/// engagement participants.
PushNotificationTypeOperatorTypingIndicator = 4,
/// The SDK will subscribe to push notifications for when the engagement is transferred to another operator.
PushNotificationTypeTransfer = 4,
};

/// Available push notification types
Expand Down Expand Up @@ -767,17 +805,18 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _




@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
/// Request media upgrade with specific offer
/// Request a VisitorCode for current Visitor
/// A Visitor code can be displayed to the Visitor. The Visitor can then inform OmniBrowse Operators of their code. OmniBrowse Operators use the Visitor’s code to start an OmniBrowse Engagement with the Visitor.
/// Each Visitor code is generated on demand and is unique for every Visitor on a particular site. Upon the first time this function is called for a Visitor the code is generated and returned. For each successive call thereafter the same code will be returned as long as the code has not expired. The expiration time for Visitor codes is 3 hours. During that time the code can be used to initiate an engagement. Once Operator uses the Visitor code to initiate an engagement, the code will expire immediately. When the Visitor Code expires this function will return a new Visitor code.
/// The expiration time is important to take note of if you plan on retrieving the code only once during the Visitor’s session. A new code should be requested once the initial one has expired. When Visitor provides an expired code to Operator the Operator will not be able to connect with the Visitor.
/// <ul>
/// <li>
/// parameters:
/// </li>
/// <li>
/// offer: The `MediaUpgradeOffer’ that is used for the request
/// </li>
/// <li>
/// completion: A callback that returns the upgrade result or <code>SalemoveError</code>
/// completion: A callback that will return the visitor code or <code>SalemoveError</code>
/// </li>
/// </ul>
/// If the request is unsuccessful for any reason then the completion will have an Error.
Expand All @@ -801,26 +840,23 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _
/// <li>
/// <code>ConfigurationError.invalidApiToken</code>
/// </li>
/// <li>
/// <code>MediaUpgradeError.requestError</code>
/// </li>
/// </ul>
- (void)requestMediaUpgradeWithOffer:(MediaUpgradeOffer * _Nonnull)offer completion:(void (^ _Nonnull)(BOOL, SalemoveError * _Nullable))completion;
- (void)requestVisitorCodeWithCompletion:(void (^ _Nonnull)(NSString * _Nullable, SalemoveError * _Nullable))completion;
@end



@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
/// Request a VisitorCode for current Visitor
/// A Visitor code can be displayed to the Visitor. The Visitor can then inform OmniBrowse Operators of their code. OmniBrowse Operators use the Visitor’s code to start an OmniBrowse Engagement with the Visitor.
/// Each Visitor code is generated on demand and is unique for every Visitor on a particular site. Upon the first time this function is called for a Visitor the code is generated and returned. For each successive call thereafter the same code will be returned as long as the code has not expired. The expiration time for Visitor codes is 3 hours. During that time the code can be used to initiate an engagement. Once Operator uses the Visitor code to initiate an engagement, the code will expire immediately. When the Visitor Code expires this function will return a new Visitor code.
/// The expiration time is important to take note of if you plan on retrieving the code only once during the Visitor’s session. A new code should be requested once the initial one has expired. When Visitor provides an expired code to Operator the Operator will not be able to connect with the Visitor.
/// Request media upgrade with specific offer
/// <ul>
/// <li>
/// parameters:
/// </li>
/// <li>
/// completion: A callback that will return the visitor code or <code>SalemoveError</code>
/// offer: The `MediaUpgradeOffer’ that is used for the request
/// </li>
/// <li>
/// completion: A callback that returns the upgrade result or <code>SalemoveError</code>
/// </li>
/// </ul>
/// If the request is unsuccessful for any reason then the completion will have an Error.
Expand All @@ -844,12 +880,21 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _
/// <li>
/// <code>ConfigurationError.invalidApiToken</code>
/// </li>
/// <li>
/// <code>MediaUpgradeError.requestError</code>
/// </li>
/// </ul>
- (void)requestVisitorCodeWithCompletion:(void (^ _Nonnull)(NSString * _Nullable, SalemoveError * _Nullable))completion;
- (void)requestMediaUpgradeWithOffer:(MediaUpgradeOffer * _Nonnull)offer completion:(void (^ _Nonnull)(BOOL, SalemoveError * _Nullable))completion;
@end



@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
/// Clear the use session of the client library
- (void)clearSession;
@end


@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
/// Update current Visitor’s information.
/// The information provided by this endpoint is available to all the Operators observing or interacting with the Visitor. This means that this endpoint can be used to provide additional context about the Visitor to the Operators. For example, if a Visitor is logged into the current site and their name and email are recorded on their profile, then taking the data from the profile and passing it into this endpoint helps the Operators see the real names and emails of every logged in Visitor even before they start a conversation.
Expand Down Expand Up @@ -903,12 +948,14 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _
@end


@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
/// Clear the use session of the client library
- (void)clearSession;
@end


@interface Salemove (SWIFT_EXTENSION(SalemoveSDK)) <PushNotificationHandling>
/// See the method description in <a href="x-source-tag://PushNotificationHandlingWillPresent">PushNotificationHandling</a>.
- (void)userNotificationCenter:(UNUserNotificationCenter * _Nonnull)center willPresent:(UNNotification * _Nonnull)notification withCompletionHandler:(void (^ _Nonnull)(UNNotificationPresentationOptions))completionHandler;
/// See the method description in <a href="x-source-tag://PushNotificationHandlingDidReceive">PushNotificationHandling</a>.
- (void)userNotificationCenter:(UNUserNotificationCenter * _Nonnull)center didReceive:(UNNotificationResponse * _Nonnull)response withCompletionHandler:(void (^ _Nonnull)(void))completionHandler;
@end



Expand Down Expand Up @@ -997,7 +1044,6 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _




@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
/// Send single choice response with the selected option.
/// Adds attachment with selected option to message.
Expand Down Expand Up @@ -1620,12 +1666,30 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _
/// The basic gateway class that interacts with the client library through the app delegate
SWIFT_CLASS("_TtC11SalemoveSDK19SalemoveAppDelegate")
@interface SalemoveAppDelegate : NSObject <UIApplicationDelegate>
/// Identify the app launch and initialize the sdk internals.
- (BOOL)application:(UIApplication * _Nonnull)application didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> * _Nullable)launchOptions;
/// Handle the internal push services.
- (void)application:(UIApplication * _Nonnull)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData * _Nonnull)deviceToken;
/// Handle the application active state and setup the internals.
/// \param application The current application.
///
- (void)applicationDidBecomeActive:(UIApplication * _Nonnull)application;
/// Call this method when <code>application:didRegisterForRemoteNotificationsWithDeviceToken:</code> is called
/// from <code>UNUserNotificationCenterDelegate</code>.
/// Send all parameters that you receive in the delegate method as they are, without modifying them.
/// <h1>Reference</h1>
/// <a href="https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate">UNUserNotificationCenterDelegate</a>
/// \param application The current application.
///
/// \param deviceToken The data that holds the push notification device token.
///
- (void)application:(UIApplication * _Nonnull)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData * _Nonnull)deviceToken;
/// Call this method when <code>application:didFailToRegisterForRemoteNotificationsWithError:</code> is called
/// from <code>UNUserNotificationCenterDelegate</code>.
/// Send all parameters that you receive in the delegate method as they are, without modifying them.
/// <h1>Reference</h1>
/// <a href="https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate">UNUserNotificationCenterDelegate</a>
/// \param application The current application.
///
/// \param error The error describing the push notification registration failure.
///
- (void)application:(UIApplication * _Nonnull)application didFailToRegisterForRemoteNotificationsWithError:(NSError * _Nonnull)error;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public protocol PushNotificationConfigurable {
case end
case failed
case message
case operatorTypingIndicator
case transfer
public typealias RawValue = Swift.Int
public init?(rawValue: Swift.Int)
public var rawValue: Swift.Int {
Expand All @@ -73,6 +73,7 @@ public protocol PushNotificationConfigurable {
@objc func start()
@objc func end()
@objc var onEngagementRequest: SalemoveSDK.RequestOfferBlock { get }
@objc var onEngagementTransfer: SalemoveSDK.EngagementTransferBlock { get }
}
@objc public protocol MessageHandling {
@objc func receive(message: SalemoveSDK.Message)
Expand Down Expand Up @@ -137,11 +138,16 @@ public typealias VisitorScreenSharingStateChange = (SalemoveSDK.VisitorScreenSha
public typealias AudioStreamAddedBlock = (SalemoveSDK.AudioStreamable?, SalemoveSDK.SalemoveError?) -> Swift.Void
public typealias VideoStreamAddedBlock = (SalemoveSDK.VideoStreamable?, SalemoveSDK.SalemoveError?) -> Swift.Void
public typealias MessagesUpdateBlock = ([SalemoveSDK.Message]) -> Swift.Void
public typealias EngagementTransferBlock = ([SalemoveSDK.Operator]?) -> Swift.Void
public typealias PushActionBlock = (SalemoveSDK.Push) -> Swift.Void
public typealias OperatorTypingStatusUpdate = (SalemoveSDK.OperatorTypingStatus) -> Swift.Void
public typealias EngagementFileProgressBlock = (SalemoveSDK.EngagementFileProgress) -> Swift.Void
public typealias EngagementFileCompletionBlock = (SalemoveSDK.EngagementFileInformation?, SalemoveSDK.SalemoveError?) -> Swift.Void
public typealias EngagementFileFetchCompletionBlock = (SalemoveSDK.EngagementFileData?, SalemoveSDK.SalemoveError?) -> Swift.Void
@objc public protocol PushNotificationHandling {
@objc func userNotificationCenter(_ center: UserNotifications.UNUserNotificationCenter, willPresent notification: UserNotifications.UNNotification, withCompletionHandler completionHandler: @escaping (UserNotifications.UNNotificationPresentationOptions) -> Swift.Void)
@objc func userNotificationCenter(_ center: UserNotifications.UNUserNotificationCenter, didReceive response: UserNotifications.UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Swift.Void)
}
extension MoyaProvider : ReactiveSwift.ReactiveExtensionsProvider {
}
@objc public protocol AudioStreamable {
Expand All @@ -163,12 +169,17 @@ extension MoyaProvider : ReactiveSwift.ReactiveExtensionsProvider {
}
@objc @_inheritsConvenienceInitializers public class SalemoveAppDelegate : ObjectiveC.NSObject, UIKit.UIApplicationDelegate {
@discardableResult
@objc public func application(_ application: UIKit.UIApplication, didFinishLaunchingWithOptions launchOptions: [UIKit.UIApplication.LaunchOptionsKey : Any]? = nil) -> Swift.Bool
@objc public func application(_ application: UIKit.UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Foundation.Data)
public func application(_ application: UIKit.UIApplication, didFinishLaunchingWithOptions launchOptions: [UIKit.UIApplication.LaunchOptionsKey : Any]? = nil, enablePushNotifications isPushNotificationsEnabled: Swift.Bool = false) -> Swift.Bool
@objc public func applicationDidBecomeActive(_ application: UIKit.UIApplication)
@objc public func application(_ application: UIKit.UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Foundation.Data)
@objc public func application(_ application: UIKit.UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Swift.Error)
@objc deinit
@objc override dynamic public init()
}
extension Salemove : SalemoveSDK.PushNotificationHandling {
@objc final public func userNotificationCenter(_ center: UserNotifications.UNUserNotificationCenter, willPresent notification: UserNotifications.UNNotification, withCompletionHandler completionHandler: @escaping (UserNotifications.UNNotificationPresentationOptions) -> Swift.Void)
@objc final public func userNotificationCenter(_ center: UserNotifications.UNUserNotificationCenter, didReceive response: UserNotifications.UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Swift.Void)
}
public enum ContextType : Swift.String {
case page
public typealias RawValue = Swift.String
Expand Down
Binary file not shown.
Loading

0 comments on commit 766ad8a

Please sign in to comment.