Skip to content

Commit

Permalink
updated Licensing error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Müller committed Nov 16, 2020
1 parent 3a4513e commit f965677
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
21 changes: 10 additions & 11 deletions example/RNExampleApp/ios/RNExampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 2MSE892CA7;
LastSwiftMigration = 1110;
ProvisioningStyle = Manual;
ProvisioningStyle = Automatic;
};
};
};
Expand Down Expand Up @@ -352,21 +351,21 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = RNExampleApp/RNExampleApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 2MSE892CA7;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = RNExampleApp/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = com.anyline.example.reactnative.beta;
PRODUCT_BUNDLE_IDENTIFIER = com.anyline.example.reactnative;
PRODUCT_NAME = RNExampleApp;
PROVISIONING_PROFILE_SPECIFIER = "Anyline In House Distribution Profile";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "RNExampleApp-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -382,10 +381,10 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = RNExampleApp/RNExampleApp.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 2MSE892CA7;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = RNExampleApp/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
Expand All @@ -395,7 +394,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.anyline.example.reactnative.beta;
PRODUCT_NAME = RNExampleApp;
PROVISIONING_PROFILE_SPECIFIER = "Anyline In House Distribution Profile";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "RNExampleApp-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VALID_ARCHS = "arm64 arm64e armv7 armv7s";
Expand Down
5 changes: 4 additions & 1 deletion plugin/ios/ALNFCScanViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,15 @@ - (void)viewDidLoad {
//Set scanOptions for MRZConfig
mrzConfig.idFieldScanOptions = scanOptions;
}

NSError *error = nil;

//Init the anyline sdk with your license key
[AnylineSDK setupWithLicenseKey:self.licensekey error:&error];
if (error) {
[self.delegate pluginScanViewController:nil
didStopScanning:self
error:error];
return;
}
//Init the anyline ID ScanPlugin with an ID, Licensekey, the delegate,
Expand Down
4 changes: 4 additions & 0 deletions plugin/ios/ALPluginScanViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ NS_ASSUME_NONNULL_BEGIN

- (void)pluginScanViewController:(ALPluginScanViewController *)pluginScanViewController
didStopScanning:(id)sender;

- (void)pluginScanViewController:(ALPluginScanViewController *)pluginScanViewController
didStopScanning:(id)sender
error:(NSError *)error;
@end

NS_ASSUME_NONNULL_END
3 changes: 3 additions & 0 deletions plugin/ios/ALPluginScanViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ - (void)viewDidLoad {

[AnylineSDK setupWithLicenseKey:self.licensekey error:&error];
if (error) {
[self.delegate pluginScanViewController:self
didStopScanning:self
error:error];
return;
}

Expand Down
4 changes: 4 additions & 0 deletions plugin/ios/AnylineSDKPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ - (void)pluginScanViewController:(nonnull ALPluginScanViewController *)pluginSca
[self returnError:(@"Canceled")];
}

- (void)pluginScanViewController:(ALPluginScanViewController *)pluginScanViewController didStopScanning:(id)sender error:(NSError *)error {
[self returnError:error.debugDescription];
}

- (ALScanMode)energyScanModeFromString:(NSString *)scanMode{

if ([[scanMode uppercaseString] isEqualToString:@"ANALOG_METER"]) {
Expand Down

0 comments on commit f965677

Please sign in to comment.