Skip to content

Commit

Permalink
Merge pull request #51 from applivery/fix/remove-token-reset
Browse files Browse the repository at this point in the history
simplify literals and remove reset token
  • Loading branch information
FranAlarza authored Dec 13, 2024
2 parents 6cba310 + 2c8f8da commit c79e95f
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 179 deletions.
6 changes: 3 additions & 3 deletions Applivery.podspec
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Pod::Spec.new do |s|
s.name = "Applivery"
s.version = "3.3.0"
s.version = "4.3.0"
s.summary = "Mobile App Distribution"
s.homepage = "https://www.applivery.com"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Alejandro Jiménez Agudo" => "[email protected]" }
s.social_media_url = "https://twitter.com/Applivery"
s.source = { :git => "https://github.com/applivery/applivery-ios-sdk.git", :tag => "v#{s.version}" }
s.platform = :ios, "11.0"
s.platform = :ios, "13.0"
s.source_files = "AppliverySDK/**/*.swift"
s.exclude_files = "AppliverySDK/**/getConstants.swift"
s.resource_bundle = { 'Applivery' => ["AppliverySDK/**/*.storyboard", "AppliverySDK/**/*.strings"] }
s.swift_version = "5.0"
s.swift_version = "5.5"
end
1 change: 0 additions & 1 deletion AppliverySDK/Interactors/StartInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class StartInteractor {
// MARK: Internal Methods

func start() {
try? keychain.remove(for: app.bundleId())
logInfo("Applivery is starting... ")
logInfo("SDK Version: \(GlobalConfig.shared.app.getSDKVersion())")
setupBindings()
Expand Down
67 changes: 41 additions & 26 deletions AppliverySDK/Model/Public/TextLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ public class TextLiterals: NSObject {
/// "Your session has expired. Please, log in again"
@objc public var loginSessionExpired: String

/// "Your session has expired. Please, log in again"
@objc public var sheetScreenshotAction: String

/// "Your session has expired. Please, log in again"
@objc public var sheetRecordAction: String

// MARK: - Initializer
/**
Creates a new instance of TextLiterals.
Expand Down Expand Up @@ -186,32 +192,35 @@ public class TextLiterals: NSObject {
- Version: 2.4
*/
@objc public init(
appName: String = kLocaleSdkName,
alertButtonCancel: String = kLocaleAlertButtonCancel,
alertButtonRetry: String = kLocaleAlertButtonRetry,
alertButtonOK: String = kLocaleAlertButtonOk,
errorUnexpected: String = kLocaleErrorUnexpected,
errorInvalidCredentials: String = kLocaleErrorInvalidCredentials,
errorDownloadURL: String = kLocaleErrorDownloadUrl,
otaUpdateMessage: String? = nil,
alertButtonLater: String = kLocaleAlertButtonLater,
alertButtonUpdate: String = kLocaleAlertButtonUpdate,
forceUpdateMessage: String? = nil,
buttonForceUpdate: String = kLocaleUpdateViewButtonUpdate,
feedbackButtonClose: String = kLocaleFeedbackButtonClose,
feedbackButtonAdd: String = kLocaleFeedbackButtonAdd,
feedbackButtonSend: String = kLocaleFeedbackButtonSend,
feedbackSelectType: String = kLocaleFeedbackLabelSelectType,
feedbackTypeBug: String = kLocaleFeedbackButtonBug,
feedbackTypeFeedback: String = kLocaleFeedbackButtonFeedback,
feedbackMessagePlaceholder: String = kLocaleFeedbackTextMessagePlaceholder,
feedbackAttach: String = kLocaleFeedbackLabelAttach,
loginInputUser: String = kLocaleLoginInputUser,
loginInputPassword: String = kLocaleLoginInputPassword,
loginButton: String = kLocaleLoginButton,
loginMessage: String = kLocaleLoginAlertMessage,
loginInvalidCredentials: String = kLocaleLoginAlertMessageInvalidCredentials,
loginSessionExpired: String = kLocaleLoginAlertMessageExpired) {
appName: String = "Applivery",
alertButtonCancel: String = "Cancel",
alertButtonRetry: String = "Retry",
alertButtonOK: String = "OK",
errorUnexpected: String = "Unexpected error",
errorInvalidCredentials: String = "Invalid credentials",
errorDownloadURL: String = "Couldn't start download. Invalid url",
otaUpdateMessage: String? = "There is a new version available for download. Do you want to update to the latest version?",
alertButtonLater: String = "Later",
alertButtonUpdate: String = "Update",
forceUpdateMessage: String? = "Sorry this App is outdated. Please, update the App to continue using it",
buttonForceUpdate: String = "Update now",
feedbackButtonClose: String = "Close",
feedbackButtonAdd: String = "Add Feedback",
feedbackButtonSend: String = "Send Feedback",
feedbackSelectType: String = "Select type",
feedbackTypeBug: String = "Bug",
feedbackTypeFeedback: String = "Feedback",
feedbackMessagePlaceholder: String = "Add a message",
feedbackAttach: String = "Attach Screenshot",
loginInputUser: String = "user",
loginInputPassword: String = "password",
loginButton: String = "Login",
loginMessage: String = "Login is required!",
loginInvalidCredentials: String = "Wrong user or password, please, try again",
loginSessionExpired: String = "Your session has expired. Please, log in again",
sheetScreenshotAction: String = "Take Screenshoot",
sheetRecordAction: String = "Record Screen"
) {

self.appName = appName
self.alertButtonCancel = alertButtonCancel
Expand Down Expand Up @@ -239,6 +248,8 @@ public class TextLiterals: NSObject {
self.loginMessage = loginMessage
self.loginInvalidCredentials = loginInvalidCredentials
self.loginSessionExpired = loginSessionExpired
self.sheetScreenshotAction = sheetScreenshotAction
self.sheetRecordAction = sheetRecordAction
}
}

Expand Down Expand Up @@ -269,6 +280,8 @@ enum Literal: CustomStringConvertible {
case loginMessage
case loginInvalidCredentials
case loginSessionExpired
case sheetScreenshotAction
case sheetRecordAction

var description: String {
return literal(self) ?? String(self.hashValue)
Expand Down Expand Up @@ -306,6 +319,8 @@ func literal(_ literal: Literal) -> String? {
case .loginMessage: return literals.loginMessage
case .loginInvalidCredentials: return literals.loginInvalidCredentials
case .loginSessionExpired: return literals.loginSessionExpired
case .sheetScreenshotAction: return literals.sheetScreenshotAction
case .sheetRecordAction: return literals.sheetRecordAction
}
}
// swiftlint:enable cyclomatic_complexity
19 changes: 13 additions & 6 deletions AppliverySDK/Modules/VideoReport/RecordingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class RecordingViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .clear
addRecordButton()
if #available(iOS 15.0, *) {
addRecordButton()
}
}


Expand Down Expand Up @@ -114,19 +116,24 @@ class RecordingViewController: UIViewController {
func presentActionSheet() {
actionSheet = UIAlertController()

let screenshotAction = UIAlertAction(title: localize("sheet_screenshoot_action"), style: .default) { _ in
let screenshotAction = UIAlertAction(title: literal(.sheetScreenshotAction), style: .default) { _ in
ScreenRecorderManager.shared.presentPreviewWithScreenshoot()
}

let screenRecordingAction = UIAlertAction(title: localize("sheet_record_action"), style: .default) { _ in
let screenRecordingAction = UIAlertAction(title: literal(.sheetRecordAction), style: .default) { _ in
ScreenRecorderManager.shared.startClipBuffering()
}

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)

actionSheet.addAction(screenshotAction)
actionSheet.addAction(screenRecordingAction)
actionSheet.addAction(cancelAction)
if #available(iOS 15.0, *) {
actionSheet.addAction(screenshotAction)
actionSheet.addAction(screenRecordingAction)
actionSheet.addAction(cancelAction)
} else {
actionSheet.addAction(screenshotAction)
actionSheet.addAction(cancelAction)
}

if let popoverController = actionSheet.popoverPresentationController {
popoverController.sourceView = self.view
Expand Down
1 change: 0 additions & 1 deletion AppliverySDK/Modules/VideoReport/VideoPreviewRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ struct VideoPreviewRow: View {
let imageGenerator = AVAssetImageGenerator(asset: asset)
imageGenerator.appliesPreferredTrackTransform = true

// Extraer el primer segundo del video (puedes ajustar el tiempo si es necesario)
let time = CMTime(seconds: 1, preferredTimescale: 60)
DispatchQueue.global().async {
do {
Expand Down
54 changes: 0 additions & 54 deletions AppliverySDK/Resources/en.lproj/Localizable.strings

This file was deleted.

87 changes: 0 additions & 87 deletions AppliverySDK/Resources/getConstants.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let package = Package(
name: "Applivery",
dependencies: [],
path: "AppliverySDK",
exclude: ["Info.plist", "Resources/getConstants.swift"],
exclude: ["Info.plist"],
resources: [.process("Resources/Assets")]),

.testTarget(
Expand Down

0 comments on commit c79e95f

Please sign in to comment.