Skip to content

Commit

Permalink
Merge pull request #24 from BlinkID/feature/v1.4.2
Browse files Browse the repository at this point in the history
v1.4.2
  • Loading branch information
juraskrlec authored Sep 13, 2024
2 parents e778d1e + f948438 commit 463f91f
Show file tree
Hide file tree
Showing 20 changed files with 136 additions and 62 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.4.2

- Added experimental feature `overrideAppPreferredLanguage` which allows setting the language from inside the app. As this is not aligned with [Apple guidelines](https://developer.apple.com/news/?id=u2cfuj88), customers are advised to use it ONLY if needed for transitional period. Any issues that might arise from using this setting are left on customer's discretion for solving.

## v1.4.1

- No changes
Expand Down
10 changes: 5 additions & 5 deletions CaptureCore.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>CaptureCore.framework/CaptureCore</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>CaptureCore.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>BinaryPath</key>
<string>CaptureCore.framework/CaptureCore</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>CaptureCore.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>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</data>
<key>Info.plist</key>
<data>
90PCUQB8AaF3zA+qFOesUqeNivg=
K5dbmMcTcBoC0UIHmZv5m70XDoE=
</data>
<key>Model_021c530a7efe77c0e90c4bfe19c3bebaaceee433103e4e6d4f1424d921885982.strop</key>
<data>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</data>
<key>Info.plist</key>
<data>
DBcquIDRpm1sTflfX4UDZrTCf3s=
bh7XdhIFYmxOCFsPv0sbIxUK1jc=
</data>
<key>Model_021c530a7efe77c0e90c4bfe19c3bebaaceee433103e4e6d4f1424d921885982.strop</key>
<data>
Expand Down
10 changes: 5 additions & 5 deletions CaptureUX.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>CaptureUX.framework/CaptureUX</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>CaptureUX.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>BinaryPath</key>
<string>CaptureUX.framework/CaptureUX</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>CaptureUX.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>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file modified CaptureUX.xcframework/ios-arm64/CaptureUX.framework/CaptureUX
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
MBIC_UX_FINAL
@interface MBICCaptureUISDK : NSObject

@property (nonatomic) NSString *language;
/// Sets the language used in CaptureSDK
@property (nonatomic) NSString *language DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases.");

/// Bundle with resources used in framework
@property (nonatomic) NSBundle *resourcesBundle;
Expand All @@ -25,48 +26,80 @@ MBIC_UX_FINAL
@property (nonatomic) NSBundle *customResourcesBundle;

/// Localization file in main bundle used for overrideing framework's localizations
@property (nonatomic) NSString *customLocalizationFileName;
@property (nonatomic) NSString *customLocalizationFileName DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases.");

/// Language Localizable.strings
@property (nonatomic, readonly) NSBundle *localizableLanguageBundle DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases.");

/// Overrides device langauge. You need to set your own language.
/// Set this to YES, if you want to have in-app language selection.
///
/// WARNING: Use Apple intended way of localization from Settings screen.
/// Default: NO
@property (nonatomic) BOOL overrideAppPreferredLanguage DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases.");

/// Obtain the shared instance
+ (instancetype)sharedInstance NS_SWIFT_NAME(shared());

/// Sets the language used in CaptureSDK
- (void)setLanguage:(NSString *)language;

/// Sets the language to default (i.e. language specified in the user's device settings.
/// Sets the language to default (i.e. language specified in the user's device settings)..
- (void)setDefaultLanguage;

@end

static inline NSString * MBIC_UI_LOCALIZED_DEFAULT_STRING(NSString *key) {
return ([NSString stringWithFormat:@"%@", key]);
return ([NSString stringWithFormat:@"[[%@]]", key]);
}

static inline NSString * MBIC_UI_LOCALIZED_FOR_LANGUAGE(NSString *key) {

NSString *overridenStringFromCustomBundle = NSLocalizedStringWithDefaultValue(key,
nil,
[MBICCaptureUISDK sharedInstance].customResourcesBundle,
@"",
@"");
static inline NSString * MBIC_UI_LOCALIZED_FOR_LANGUAGE(NSString *key, NSString *language) {
NSBundle *bundle = [MBICCaptureUISDK sharedInstance].localizableLanguageBundle;

// If a custom resource bundle is defined, use it for the localization
NSString *overridenStringFromCustomBundle = NSLocalizedStringWithDefaultValue(
key,
nil,
[MBICCaptureUISDK sharedInstance].customResourcesBundle ?: bundle,
@"",
@""
);

// If we found an override in the custom bundle, return it
if (overridenStringFromCustomBundle != nil && ![overridenStringFromCustomBundle isEqualToString:key]) {
return overridenStringFromCustomBundle;
}

return NSLocalizedStringFromTableInBundle(key, nil, [MBICCaptureUISDK sharedInstance].resourcesBundle, @"");

// If not, fallback to the localizable bundle
return NSLocalizedStringFromTableInBundle(
key,
@"Localizable",
bundle,
@""
);
}

static inline NSString * MBIC_UI_LOCALIZED(NSString *key) {
NSString *localizationFileName = [MBICCaptureUISDK sharedInstance].customLocalizationFileName;

// First, check if we have a custom localization file
if (localizationFileName) {
NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue(key, localizationFileName, [NSBundle mainBundle], @"", @"");

NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue(
key,
localizationFileName,
[NSBundle mainBundle],
@"",
@""
);

// If we found a match in the custom localization file, return it
if (![overridenStringFromCustomLocalizationFile isEqualToString:key]) {
return overridenStringFromCustomLocalizationFile;
}
}

// Get the language currently set in the SDK
NSString *language = [MBICCaptureUISDK sharedInstance].language;

NSString *localizedString = MBIC_UI_LOCALIZED_FOR_LANGUAGE(key);
// Now, attempt to localize the string for the selected language
NSString *localizedString = MBIC_UI_LOCALIZED_FOR_LANGUAGE(key, language);

return localizedString;
}
Expand Down
Binary file modified CaptureUX.xcframework/ios-arm64/CaptureUX.framework/Info.plist
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</data>
<key>Headers/MBICCaptureUISDK.h</key>
<data>
E7mr/Sr6N5MTUo2uvBJ2IOsvEEs=
Bp2RehSZ4UXY650V38YzfyX0snI=
</data>
<key>Headers/MBICCaptureUXSettings.h</key>
<data>
Expand All @@ -58,7 +58,7 @@
</data>
<key>Info.plist</key>
<data>
9qWsGhfHprgyetYGnq2UOrjnhac=
X8cb0/0SpqDji/nim+ZF3NiAjjg=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand Down Expand Up @@ -331,7 +331,7 @@
<dict>
<key>hash2</key>
<data>
hQOqxm4/zPtVt1KHz1NHZ6BFlopHUM21e8iF2R8heBQ=
SHUyxFnUfxeqPR/i91UG7ZQXKOePxfqhfvR3Hl8JvuM=
</data>
</dict>
<key>Headers/MBICCaptureUXSettings.h</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
MBIC_UX_FINAL
@interface MBICCaptureUISDK : NSObject

@property (nonatomic) NSString *language;
/// Sets the language used in CaptureSDK
@property (nonatomic) NSString *language DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases.");

/// Bundle with resources used in framework
@property (nonatomic) NSBundle *resourcesBundle;
Expand All @@ -25,48 +26,80 @@ MBIC_UX_FINAL
@property (nonatomic) NSBundle *customResourcesBundle;

/// Localization file in main bundle used for overrideing framework's localizations
@property (nonatomic) NSString *customLocalizationFileName;
@property (nonatomic) NSString *customLocalizationFileName DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases.");

/// Language Localizable.strings
@property (nonatomic, readonly) NSBundle *localizableLanguageBundle DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases.");

/// Overrides device langauge. You need to set your own language.
/// Set this to YES, if you want to have in-app language selection.
///
/// WARNING: Use Apple intended way of localization from Settings screen.
/// Default: NO
@property (nonatomic) BOOL overrideAppPreferredLanguage DEPRECATED_MSG_ATTRIBUTE("Use this property at your own risk as it does not comply with Apple guidelines. This will be removed in future releases.");

/// Obtain the shared instance
+ (instancetype)sharedInstance NS_SWIFT_NAME(shared());

/// Sets the language used in CaptureSDK
- (void)setLanguage:(NSString *)language;

/// Sets the language to default (i.e. language specified in the user's device settings.
/// Sets the language to default (i.e. language specified in the user's device settings)..
- (void)setDefaultLanguage;

@end

static inline NSString * MBIC_UI_LOCALIZED_DEFAULT_STRING(NSString *key) {
return ([NSString stringWithFormat:@"%@", key]);
return ([NSString stringWithFormat:@"[[%@]]", key]);
}

static inline NSString * MBIC_UI_LOCALIZED_FOR_LANGUAGE(NSString *key) {

NSString *overridenStringFromCustomBundle = NSLocalizedStringWithDefaultValue(key,
nil,
[MBICCaptureUISDK sharedInstance].customResourcesBundle,
@"",
@"");
static inline NSString * MBIC_UI_LOCALIZED_FOR_LANGUAGE(NSString *key, NSString *language) {
NSBundle *bundle = [MBICCaptureUISDK sharedInstance].localizableLanguageBundle;

// If a custom resource bundle is defined, use it for the localization
NSString *overridenStringFromCustomBundle = NSLocalizedStringWithDefaultValue(
key,
nil,
[MBICCaptureUISDK sharedInstance].customResourcesBundle ?: bundle,
@"",
@""
);

// If we found an override in the custom bundle, return it
if (overridenStringFromCustomBundle != nil && ![overridenStringFromCustomBundle isEqualToString:key]) {
return overridenStringFromCustomBundle;
}

return NSLocalizedStringFromTableInBundle(key, nil, [MBICCaptureUISDK sharedInstance].resourcesBundle, @"");

// If not, fallback to the localizable bundle
return NSLocalizedStringFromTableInBundle(
key,
@"Localizable",
bundle,
@""
);
}

static inline NSString * MBIC_UI_LOCALIZED(NSString *key) {
NSString *localizationFileName = [MBICCaptureUISDK sharedInstance].customLocalizationFileName;

// First, check if we have a custom localization file
if (localizationFileName) {
NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue(key, localizationFileName, [NSBundle mainBundle], @"", @"");

NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue(
key,
localizationFileName,
[NSBundle mainBundle],
@"",
@""
);

// If we found a match in the custom localization file, return it
if (![overridenStringFromCustomLocalizationFile isEqualToString:key]) {
return overridenStringFromCustomLocalizationFile;
}
}

// Get the language currently set in the SDK
NSString *language = [MBICCaptureUISDK sharedInstance].language;

NSString *localizedString = MBIC_UI_LOCALIZED_FOR_LANGUAGE(key);
// Now, attempt to localize the string for the selected language
NSString *localizedString = MBIC_UI_LOCALIZED_FOR_LANGUAGE(key, language);

return localizedString;
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</data>
<key>Headers/MBICCaptureUISDK.h</key>
<data>
E7mr/Sr6N5MTUo2uvBJ2IOsvEEs=
Bp2RehSZ4UXY650V38YzfyX0snI=
</data>
<key>Headers/MBICCaptureUXSettings.h</key>
<data>
Expand All @@ -58,7 +58,7 @@
</data>
<key>Info.plist</key>
<data>
gACvR6ygDYi4US1p7T1piHtw8Iw=
jyuGqu3MaqHDYrOHtrOn3KONi4E=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand Down Expand Up @@ -331,7 +331,7 @@
<dict>
<key>hash2</key>
<data>
hQOqxm4/zPtVt1KHz1NHZ6BFlopHUM21e8iF2R8heBQ=
SHUyxFnUfxeqPR/i91UG7ZQXKOePxfqhfvR3Hl8JvuM=
</data>
</dict>
<key>Headers/MBICCaptureUXSettings.h</key>
Expand Down
6 changes: 3 additions & 3 deletions MBCaptureCore.podspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Pod::Spec.new do |s|

s.name = "MBCaptureCore"
s.version = "1.4.1"
s.version = "1.4.2"
s.summary = "A delightful Direct API component for document capture"
s.homepage = "http://microblink.com"
s.readme = "https://raw.githubusercontent.com/BlinkID/capture-ios/v1.4.1/README.md"
s.readme = "https://raw.githubusercontent.com/BlinkID/capture-ios/v1.4.2/README.md"

s.description = <<-DESC
The BlinkID Capture iOS SDK gives you the ability to auto-capture high quality images of identity documents in a user-friendly way. The SDK provides you with a rectified image of the document that ensures high success rate in extracting document text or verifying the document validity.
Expand All @@ -23,7 +23,7 @@ Pod::Spec.new do |s|
}

s.source = {
:http => 'https://github.com/BlinkID/capture-ios/releases/download/v1.4.1/CaptureCore.xcframework.zip'
:http => 'https://github.com/BlinkID/capture-ios/releases/download/v1.4.2/CaptureCore.xcframework.zip'
}

s.platform = :ios
Expand Down
Loading

0 comments on commit 463f91f

Please sign in to comment.