Skip to content

Commit

Permalink
Update SalemoveSDK to version 0.29.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BitriseBot committed May 11, 2021
1 parent 063042d commit be03161
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 49 deletions.
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@

## Unreleased

Unreleased: https://github.com/salemove/ios-sdk/compare/0.28.0...master
Unreleased: https://github.com/salemove/ios-sdk/compare/0.29.0...master

## [0.29.0] - 2021-05-11

### Fixed

- Fixes SDK initialization deleting all keys in the keychain.
- Fixes issue with screen sharing not initializing properly.

[0.29.0]: https://github.com/salemove/ios-sdk/compare/0.28.0...0.29.0

## [0.28.0] - 2021-03-16

### Changed

- Added response card image URL support
- Added response card image URL support.

[0.28.0]: https://github.com/salemove/ios-sdk/compare/0.27.0...0.28.0

Expand All @@ -17,7 +26,7 @@ Unreleased: https://github.com/salemove/ios-sdk/compare/0.28.0...master
### Changed

- Support for Swift Package Manager.
- Cocoapods now delivers an XCFramework instead of a Framework
- Cocoapods now delivers an XCFramework instead of a Framework.

[0.27.0]: https://github.com/salemove/ios-sdk/compare/0.26.1...0.27.0

Expand Down
2 changes: 1 addition & 1 deletion Example/Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "Salemove/ios-bundle" "0.28.0"
github "Salemove/ios-bundle" "0.29.0"
4 changes: 3 additions & 1 deletion Example/ExampleApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.28.0</string>
<string>0.29.0</string>
<key>CFBundleVersion</key>
<string>76</string>
<key>LSRequiresIPhoneOS</key>
Expand Down Expand Up @@ -62,6 +62,8 @@
</array>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone for audio/video calls</string>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>NSCameraUsageDescription</key>
<string>This app needs camera for audio/video calls</string>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class DemoViewController: UIViewController {
super.viewDidLoad()

initializeSDK()
Salemove.sharedInstance.configurePushNotifications([.start, .end, .message])
Salemove.sharedInstance.pushHandler = { [weak self] push in
self?.handlePushNotification(push)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ extension EngagementStatusViewController: Interactable {
}
}

var onEngagementTransfer: EngagementTransferBlock {
return { _ in
print("Transfer completed")
}
}

var onOperatorTypingStatusUpdate: OperatorTypingStatusUpdate {
return { [unowned self] status in
self.engagementViewController?.updateOperatorTypingStatus(status: status)
Expand Down
14 changes: 7 additions & 7 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
end
12 changes: 6 additions & 6 deletions Example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ The values can be asked from Glia.

# App Usage Instructions

* Ensure Operator page is open (in your computer browser)
* Ensure Operator page is open (in your computer browser).

## Select Environment and Site
* Open the configuration screen by clicking on the icon at the top right corner.
* Select Environment by clicking on blue Change button/link under Environments
* Select Site by clicking on blue Change button/link under Sites
* Select Environment by clicking on blue Change button/link under Environments.
* Select Site by clicking on blue Change button/link under Sites.
* Click on the Apply button/link at the bottom of the screen.

## Messaging to queue
Expand Down Expand Up @@ -58,16 +58,16 @@ The values can be asked from Glia.
# Integration of SalemoveSDK using Carthage

### Integration was validated with
* XCode 11.6 (`/usr/bin/xcodebuild -version`)
* Swift 5.2.4 (`xcrun swift -version`)
* XCode 12.4 (`/usr/bin/xcodebuild -version`)
* Swift 5.4 (`xcrun swift -version`)
* Carthage 0.34.0 (`carthage version`)

### Integration steps

#### 1) Ensure that SalemoveSDK dependency in your Cartfile specifies version tag
This way you always get the Released state of the SDK

* Example: `github "Salemove/ios-bundle" "0.21.1"`
* Example: `github "Salemove/ios-bundle" "0.29.0"`

#### 2) Get and build dependencies
Run `carthage update --platform iOS` to get latest dependencies
Expand Down
120 changes: 92 additions & 28 deletions SalemoveSDK.framework/Headers/SalemoveSDK-Swift.h
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, closed) {
/// The SDK will subscribe to push notifications for when the engagement starts.
Expand All @@ -683,10 +723,8 @@ typedef SWIFT_ENUM(NSInteger, PushNotificationType, closed) {
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 modified SalemoveSDK.framework/Info.plist
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified SalemoveSDK.framework/SalemoveSDK
Binary file not shown.
4 changes: 2 additions & 2 deletions SalemoveSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SalemoveSDK'
s.version = '0.28.0'
s.version = '0.29.0'
s.summary = 'The Salemove iOS library'
s.description = 'The Salemove iOS library brings the in-person customer experience to iOS devices.'
s.homepage = 'https://github.com/salemove/ios-sdk'
Expand All @@ -10,7 +10,7 @@ Pod::Spec.new do |s|

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

s.dependency 'Moya', '14.0.0'
Expand Down

0 comments on commit be03161

Please sign in to comment.