Skip to content

Commit 766ad8a

Browse files
authored
Merge pull request #37 from salemove/release/0.29.0
Release version 0.29.0
2 parents be03161 + c10f7c2 commit 766ad8a

File tree

19 files changed

+265
-93
lines changed

19 files changed

+265
-93
lines changed

Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ target 'ExampleApp' do
1313
use_frameworks!
1414

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

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ let package = Package(
6565
),
6666
.binaryTarget(
6767
name: "SalemoveSDK",
68-
url: "https://github.com/salemove/ios-bundle/releases/download/0.28.0/SalemoveSDK.xcframework.zip",
69-
checksum: "480c76ef91d4fe18752c6823d546fa91cc1d090721a90adf396d25c4ae51caca"
68+
url: "https://github.com/salemove/ios-bundle/releases/download/0.29.0/SalemoveSDK.xcframework.zip",
69+
checksum: "edfc95f768d2144c9626f27d488f72b7298ebcfc4d3976e943876941681b5561"
7070
),
7171
.target(
7272
name: "GliaSDK",

SalemoveSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
1010

1111
s.module_name = 'SalemoveSDK'
1212
s.ios.deployment_target = '12.0'
13-
s.ios.vendored_frameworks = 'SalemoveSDK.framework'
13+
s.ios.vendored_frameworks = 'SalemoveSDK.xcframework'
1414
s.swift_version = '5.3'
1515

1616
s.dependency 'Moya', '14.0.0'

SalemoveSDK.xcframework/Info.plist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@
66
<array>
77
<dict>
88
<key>LibraryIdentifier</key>
9-
<string>ios-arm64</string>
9+
<string>ios-x86_64-simulator</string>
1010
<key>LibraryPath</key>
1111
<string>SalemoveSDK.framework</string>
1212
<key>SupportedArchitectures</key>
1313
<array>
14-
<string>arm64</string>
14+
<string>x86_64</string>
1515
</array>
1616
<key>SupportedPlatform</key>
1717
<string>ios</string>
18+
<key>SupportedPlatformVariant</key>
19+
<string>simulator</string>
1820
</dict>
1921
<dict>
2022
<key>LibraryIdentifier</key>
21-
<string>ios-x86_64-simulator</string>
23+
<string>ios-arm64</string>
2224
<key>LibraryPath</key>
2325
<string>SalemoveSDK.framework</string>
2426
<key>SupportedArchitectures</key>
2527
<array>
26-
<string>x86_64</string>
28+
<string>arm64</string>
2729
</array>
2830
<key>SupportedPlatform</key>
2931
<string>ios</string>
30-
<key>SupportedPlatformVariant</key>
31-
<string>simulator</string>
3232
</dict>
3333
</array>
3434
<key>CFBundlePackageType</key>

SalemoveSDK.xcframework/ios-arm64/SalemoveSDK.framework/Headers/SalemoveSDK-Swift.h

Lines changed: 92 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
192192
@import Foundation;
193193
@import ObjectiveC;
194194
@import UIKit;
195+
@import UserNotifications;
195196
@import WebRTC;
196197
#endif
197198

@@ -339,6 +340,7 @@ SWIFT_CLASS("_TtC11SalemoveSDK22EngagementFileProgress")
339340

340341
@class VisitorContext;
341342
@class SalemoveError;
343+
@class Operator;
342344

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

381385

@@ -673,6 +677,42 @@ SWIFT_CLASS("_TtC11SalemoveSDK4Push")
673677
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
674678
@end
675679

680+
@class UNUserNotificationCenter;
681+
@class UNNotification;
682+
@class UNNotificationResponse;
683+
684+
/// The protocol to be used to notify the SDK about push notifications.
685+
SWIFT_PROTOCOL("_TtP11SalemoveSDK24PushNotificationHandling_")
686+
@protocol PushNotificationHandling
687+
/// Call this method when <code>userNotificationCenter:willPresent:withCompletionHandler:</code> is called
688+
/// from <code>UNUserNotificationCenterDelegate</code>.
689+
/// Send all parameters that you receive in the delegate method as they are, without modifying them. By default, the completion
690+
/// handler will not be called by the SDK, which means that iOS will not present a notification banner. If you wish to do so,
691+
/// call the completion handler manually after calling this method.
692+
/// <h1>Reference</h1>
693+
/// <a href="https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate">UNUserNotificationCenterDelegate</a>
694+
/// \param center The instance of <code>UNUserNotificationCenter</code>.
695+
///
696+
/// \param notification The notification, exactly as received from the delegate method.
697+
///
698+
/// \param completionHandler The completion handler, exactly as received from the delegate method.
699+
///
700+
- (void)userNotificationCenter:(UNUserNotificationCenter * _Nonnull)center willPresent:(UNNotification * _Nonnull)notification withCompletionHandler:(void (^ _Nonnull)(UNNotificationPresentationOptions))completionHandler;
701+
/// Call this method when <code>userNotificationCenter:didReceive:withCompletionHandler:</code> is called
702+
/// from <code>UNUserNotificationCenterDelegate</code>.
703+
/// Send all parameters that you receive in the delegate method as they are, without modifying them. By default, the completion
704+
/// handler will be called by the SDK, which means that iOS will present a notification banner.
705+
/// <h1>Reference</h1>
706+
/// <a href="https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate">UNUserNotificationCenterDelegate</a>
707+
/// \param center The instance of <code>UNUserNotificationCenter</code>.
708+
///
709+
/// \param response The notification response, exactly as received from the delegate method.
710+
///
711+
/// \param completionHandler The completion handler, exactly as received from the delegate method.
712+
///
713+
- (void)userNotificationCenter:(UNUserNotificationCenter * _Nonnull)center didReceive:(UNNotificationResponse * _Nonnull)response withCompletionHandler:(void (^ _Nonnull)(void))completionHandler;
714+
@end
715+
676716
/// Available push notification types.
677717
typedef SWIFT_ENUM(NSInteger, PushNotificationType, open) {
678718
/// The SDK will subscribe to push notifications for when the engagement starts.
@@ -683,10 +723,8 @@ typedef SWIFT_ENUM(NSInteger, PushNotificationType, open) {
683723
PushNotificationTypeFailed = 2,
684724
/// The SDK will subscribe to push notifications for when a new message is received.
685725
PushNotificationTypeMessage = 3,
686-
/// The SDK will subscribe to push notifications for when an operator is typing a message for the visitor.
687-
/// Decide carefully when and where to use this notification, as the constant banners shown by iOS distract
688-
/// engagement participants.
689-
PushNotificationTypeOperatorTypingIndicator = 4,
726+
/// The SDK will subscribe to push notifications for when the engagement is transferred to another operator.
727+
PushNotificationTypeTransfer = 4,
690728
};
691729

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

768806

769807

808+
770809
@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
771-
/// Request media upgrade with specific offer
810+
/// Request a VisitorCode for current Visitor
811+
/// 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.
812+
/// 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.
813+
/// 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.
772814
/// <ul>
773815
/// <li>
774816
/// parameters:
775817
/// </li>
776818
/// <li>
777-
/// offer: The `MediaUpgradeOffer’ that is used for the request
778-
/// </li>
779-
/// <li>
780-
/// completion: A callback that returns the upgrade result or <code>SalemoveError</code>
819+
/// completion: A callback that will return the visitor code or <code>SalemoveError</code>
781820
/// </li>
782821
/// </ul>
783822
/// If the request is unsuccessful for any reason then the completion will have an Error.
@@ -801,26 +840,23 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _
801840
/// <li>
802841
/// <code>ConfigurationError.invalidApiToken</code>
803842
/// </li>
804-
/// <li>
805-
/// <code>MediaUpgradeError.requestError</code>
806-
/// </li>
807843
/// </ul>
808-
- (void)requestMediaUpgradeWithOffer:(MediaUpgradeOffer * _Nonnull)offer completion:(void (^ _Nonnull)(BOOL, SalemoveError * _Nullable))completion;
844+
- (void)requestVisitorCodeWithCompletion:(void (^ _Nonnull)(NSString * _Nullable, SalemoveError * _Nullable))completion;
809845
@end
810846

811847

812848

813849
@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
814-
/// Request a VisitorCode for current Visitor
815-
/// 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.
816-
/// 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.
817-
/// 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.
850+
/// Request media upgrade with specific offer
818851
/// <ul>
819852
/// <li>
820853
/// parameters:
821854
/// </li>
822855
/// <li>
823-
/// completion: A callback that will return the visitor code or <code>SalemoveError</code>
856+
/// offer: The `MediaUpgradeOffer’ that is used for the request
857+
/// </li>
858+
/// <li>
859+
/// completion: A callback that returns the upgrade result or <code>SalemoveError</code>
824860
/// </li>
825861
/// </ul>
826862
/// If the request is unsuccessful for any reason then the completion will have an Error.
@@ -844,12 +880,21 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _
844880
/// <li>
845881
/// <code>ConfigurationError.invalidApiToken</code>
846882
/// </li>
883+
/// <li>
884+
/// <code>MediaUpgradeError.requestError</code>
885+
/// </li>
847886
/// </ul>
848-
- (void)requestVisitorCodeWithCompletion:(void (^ _Nonnull)(NSString * _Nullable, SalemoveError * _Nullable))completion;
887+
- (void)requestMediaUpgradeWithOffer:(MediaUpgradeOffer * _Nonnull)offer completion:(void (^ _Nonnull)(BOOL, SalemoveError * _Nullable))completion;
849888
@end
850889

851890

852891

892+
@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
893+
/// Clear the use session of the client library
894+
- (void)clearSession;
895+
@end
896+
897+
853898
@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
854899
/// Update current Visitor’s information.
855900
/// 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.
@@ -903,12 +948,14 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _
903948
@end
904949

905950

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

911952

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

913960

914961

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

9981045

9991046

1000-
10011047
@interface Salemove (SWIFT_EXTENSION(SalemoveSDK))
10021048
/// Send single choice response with the selected option.
10031049
/// Adds attachment with selected option to message.
@@ -1620,12 +1666,30 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) Salemove * _
16201666
/// The basic gateway class that interacts with the client library through the app delegate
16211667
SWIFT_CLASS("_TtC11SalemoveSDK19SalemoveAppDelegate")
16221668
@interface SalemoveAppDelegate : NSObject <UIApplicationDelegate>
1623-
/// Identify the app launch and initialize the sdk internals.
1624-
- (BOOL)application:(UIApplication * _Nonnull)application didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> * _Nullable)launchOptions;
1625-
/// Handle the internal push services.
1626-
- (void)application:(UIApplication * _Nonnull)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData * _Nonnull)deviceToken;
16271669
/// Handle the application active state and setup the internals.
1670+
/// \param application The current application.
1671+
///
16281672
- (void)applicationDidBecomeActive:(UIApplication * _Nonnull)application;
1673+
/// Call this method when <code>application:didRegisterForRemoteNotificationsWithDeviceToken:</code> is called
1674+
/// from <code>UNUserNotificationCenterDelegate</code>.
1675+
/// Send all parameters that you receive in the delegate method as they are, without modifying them.
1676+
/// <h1>Reference</h1>
1677+
/// <a href="https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate">UNUserNotificationCenterDelegate</a>
1678+
/// \param application The current application.
1679+
///
1680+
/// \param deviceToken The data that holds the push notification device token.
1681+
///
1682+
- (void)application:(UIApplication * _Nonnull)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData * _Nonnull)deviceToken;
1683+
/// Call this method when <code>application:didFailToRegisterForRemoteNotificationsWithError:</code> is called
1684+
/// from <code>UNUserNotificationCenterDelegate</code>.
1685+
/// Send all parameters that you receive in the delegate method as they are, without modifying them.
1686+
/// <h1>Reference</h1>
1687+
/// <a href="https://developer.apple.com/documentation/usernotifications/unusernotificationcenterdelegate">UNUserNotificationCenterDelegate</a>
1688+
/// \param application The current application.
1689+
///
1690+
/// \param error The error describing the push notification registration failure.
1691+
///
1692+
- (void)application:(UIApplication * _Nonnull)application didFailToRegisterForRemoteNotificationsWithError:(NSError * _Nonnull)error;
16291693
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
16301694
@end
16311695

Binary file not shown.

SalemoveSDK.xcframework/ios-arm64/SalemoveSDK.framework/Modules/SalemoveSDK.swiftmodule/arm64-apple-ios.swiftinterface

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public protocol PushNotificationConfigurable {
5858
case end
5959
case failed
6060
case message
61-
case operatorTypingIndicator
61+
case transfer
6262
public typealias RawValue = Swift.Int
6363
public init?(rawValue: Swift.Int)
6464
public var rawValue: Swift.Int {
@@ -73,6 +73,7 @@ public protocol PushNotificationConfigurable {
7373
@objc func start()
7474
@objc func end()
7575
@objc var onEngagementRequest: SalemoveSDK.RequestOfferBlock { get }
76+
@objc var onEngagementTransfer: SalemoveSDK.EngagementTransferBlock { get }
7677
}
7778
@objc public protocol MessageHandling {
7879
@objc func receive(message: SalemoveSDK.Message)
@@ -137,11 +138,16 @@ public typealias VisitorScreenSharingStateChange = (SalemoveSDK.VisitorScreenSha
137138
public typealias AudioStreamAddedBlock = (SalemoveSDK.AudioStreamable?, SalemoveSDK.SalemoveError?) -> Swift.Void
138139
public typealias VideoStreamAddedBlock = (SalemoveSDK.VideoStreamable?, SalemoveSDK.SalemoveError?) -> Swift.Void
139140
public typealias MessagesUpdateBlock = ([SalemoveSDK.Message]) -> Swift.Void
141+
public typealias EngagementTransferBlock = ([SalemoveSDK.Operator]?) -> Swift.Void
140142
public typealias PushActionBlock = (SalemoveSDK.Push) -> Swift.Void
141143
public typealias OperatorTypingStatusUpdate = (SalemoveSDK.OperatorTypingStatus) -> Swift.Void
142144
public typealias EngagementFileProgressBlock = (SalemoveSDK.EngagementFileProgress) -> Swift.Void
143145
public typealias EngagementFileCompletionBlock = (SalemoveSDK.EngagementFileInformation?, SalemoveSDK.SalemoveError?) -> Swift.Void
144146
public typealias EngagementFileFetchCompletionBlock = (SalemoveSDK.EngagementFileData?, SalemoveSDK.SalemoveError?) -> Swift.Void
147+
@objc public protocol PushNotificationHandling {
148+
@objc func userNotificationCenter(_ center: UserNotifications.UNUserNotificationCenter, willPresent notification: UserNotifications.UNNotification, withCompletionHandler completionHandler: @escaping (UserNotifications.UNNotificationPresentationOptions) -> Swift.Void)
149+
@objc func userNotificationCenter(_ center: UserNotifications.UNUserNotificationCenter, didReceive response: UserNotifications.UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Swift.Void)
150+
}
145151
extension MoyaProvider : ReactiveSwift.ReactiveExtensionsProvider {
146152
}
147153
@objc public protocol AudioStreamable {
@@ -163,12 +169,17 @@ extension MoyaProvider : ReactiveSwift.ReactiveExtensionsProvider {
163169
}
164170
@objc @_inheritsConvenienceInitializers public class SalemoveAppDelegate : ObjectiveC.NSObject, UIKit.UIApplicationDelegate {
165171
@discardableResult
166-
@objc public func application(_ application: UIKit.UIApplication, didFinishLaunchingWithOptions launchOptions: [UIKit.UIApplication.LaunchOptionsKey : Any]? = nil) -> Swift.Bool
167-
@objc public func application(_ application: UIKit.UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Foundation.Data)
172+
public func application(_ application: UIKit.UIApplication, didFinishLaunchingWithOptions launchOptions: [UIKit.UIApplication.LaunchOptionsKey : Any]? = nil, enablePushNotifications isPushNotificationsEnabled: Swift.Bool = false) -> Swift.Bool
168173
@objc public func applicationDidBecomeActive(_ application: UIKit.UIApplication)
174+
@objc public func application(_ application: UIKit.UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Foundation.Data)
175+
@objc public func application(_ application: UIKit.UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Swift.Error)
169176
@objc deinit
170177
@objc override dynamic public init()
171178
}
179+
extension Salemove : SalemoveSDK.PushNotificationHandling {
180+
@objc final public func userNotificationCenter(_ center: UserNotifications.UNUserNotificationCenter, willPresent notification: UserNotifications.UNNotification, withCompletionHandler completionHandler: @escaping (UserNotifications.UNNotificationPresentationOptions) -> Swift.Void)
181+
@objc final public func userNotificationCenter(_ center: UserNotifications.UNUserNotificationCenter, didReceive response: UserNotifications.UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Swift.Void)
182+
}
172183
public enum ContextType : Swift.String {
173184
case page
174185
public typealias RawValue = Swift.String

0 commit comments

Comments
 (0)