Skip to content

Commit

Permalink
feat: add signature library missing check
Browse files Browse the repository at this point in the history
  • Loading branch information
nonelse committed Jul 22, 2024
1 parent b401934 commit d66cb88
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Adjust/Adjust.m
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ + (void)setTestOptions:(NSDictionary *)testOptions {
#pragma mark - Public instance methods

- (void)initSdk:(ADJConfig *)adjustConfig {
if (! [self isSignerPresent]) {
[self.logger error:@"Missing signature library, SDK can't be initialised"];
return;
}
if (self.activityHandler != nil) {
[self.logger error:@"Adjust already initialized"];
return;
Expand All @@ -327,6 +331,15 @@ - (void)initSdk:(ADJConfig *)adjustConfig {
savedPreLaunch:self.savedPreLaunch
deeplinkResolutionCallback:self.cachedResolvedDeeplinkBlock];
}
- (BOOL)isSignerPresent {
_Nullable Class signerClass = NSClassFromString(@"ADJSigner");
if (signerClass == nil) {
return NO;
}

return [signerClass respondsToSelector:
NSSelectorFromString(@"sign:withExtraParams:withOutputParams:")];
}

- (void)trackEvent:(ADJEvent *)event {
if (![self checkActivityHandler]) {
Expand Down

0 comments on commit d66cb88

Please sign in to comment.