diff --git a/PrivacyDashboardiOS/Classes/Extension/ExtensionMethods.swift b/PrivacyDashboardiOS/Classes/Extension/ExtensionMethods.swift index 61ccb10..1ad9a51 100644 --- a/PrivacyDashboardiOS/Classes/Extension/ExtensionMethods.swift +++ b/PrivacyDashboardiOS/Classes/Extension/ExtensionMethods.swift @@ -543,7 +543,11 @@ extension NSMutableAttributedString { extension String { var localized: String { let languageCode = BBConsentPrivacyDashboardiOS.shared.languageCode - let bundle = Bundle(url: Bundle.main.bundleURL.appendingPathComponent("Frameworks").appendingPathComponent("PrivacyDashboardiOS.framework").appendingPathComponent("/\(languageCode).lproj")) ?? Bundle.main - return NSLocalizedString(self, tableName: nil, bundle: bundle, value: "", comment: "") + if let bundle = Bundle(url: Bundle.main.bundleURL.appendingPathComponent("Frameworks").appendingPathComponent("PrivacyDashboardiOS.framework").appendingPathComponent("/\(languageCode).lproj")) { + return NSLocalizedString(self, tableName: nil, bundle: bundle, value: "", comment: "") + } else { + let bundle = Bundle(url: Bundle.main.bundleURL.appendingPathComponent("PrivacyDashboardiOS.bundle").appendingPathComponent("\(languageCode).lproj")) ?? Bundle.main + return NSLocalizedString(self, tableName: nil, bundle: bundle, value: "", comment: "") + } } } diff --git a/PrivacyDashboardiOS/Classes/PrivacyDashboard.swift b/PrivacyDashboardiOS/Classes/PrivacyDashboard.swift index 6ba13ed..37c3c13 100644 --- a/PrivacyDashboardiOS/Classes/PrivacyDashboard.swift +++ b/PrivacyDashboardiOS/Classes/PrivacyDashboard.swift @@ -11,8 +11,8 @@ public class PrivacyDashboard { public static var receiveDataBackFromPrivacyDashboard : (([String: Any]) -> Void)? // MARK: - Invoking 'PrivacyDashboard' iOS SDK - public static func showPrivacyDashboard(withApiKey: String, withUserId: String, withOrgId: String, withBaseUrl: String, withLocale: String?, accessToken: String = "", turnOnAskme: Bool, turnOnUserRequest: Bool, turnOnAttributeDetail: Bool) { - BBConsentPrivacyDashboardiOS.shared.languageCode = withLocale ?? "en" + public static func showPrivacyDashboard(withApiKey: String, withUserId: String, withOrgId: String, withBaseUrl: String, withLocale: String = "en", accessToken: String = "", turnOnAskme: Bool, turnOnUserRequest: Bool, turnOnAttributeDetail: Bool) { + BBConsentPrivacyDashboardiOS.shared.languageCode = withLocale BBConsentPrivacyDashboardiOS.shared.turnOnUserRequests = turnOnUserRequest BBConsentPrivacyDashboardiOS.shared.turnOnAskMeSection = turnOnAskme BBConsentPrivacyDashboardiOS.shared.turnOnAttributeDetailScreen = turnOnAttributeDetail