Skip to content

Commit

Permalink
Merge pull request #394 from qonversion/release/5.0.1
Browse files Browse the repository at this point in the history
Release 5.0.1
  • Loading branch information
SpertsyanKM authored Aug 23, 2023
2 parents 3b24dd1 + b257ac7 commit 182e748
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Framework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.0.0</string>
<string>5.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Qonversion.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
idfa_exclude_files = ['Sources/Qonversion/IDFA']
s.name = 'Qonversion'
s.swift_version = '5.5'
s.version = '5.0.0'
s.version = '5.0.1'
s.summary = 'qonversion.io'
s.description = <<-DESC
Deep Analytics for iOS Subscriptions
Expand Down
2 changes: 1 addition & 1 deletion Sources/Qonversion/Public/QONConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "QONConfiguration.h"
#import "QNAPIConstants.h"

static NSString *const kSDKVersion = @"5.0.0";
static NSString *const kSDKVersion = @"5.0.1";

@interface QONConfiguration ()

Expand Down
33 changes: 23 additions & 10 deletions Sources/Qonversion/Public/Qonversion.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ @interface Qonversion()

@implementation Qonversion

static bool _isInitialized = NO;

// MARK: - Public

+ (instancetype)initWithConfig:(QONConfiguration *)configuration {
if (_isInitialized) {
return [Qonversion sharedInstance];
}

_isInitialized = YES;

QONConfiguration *configCopy = [configuration copy];
[Qonversion sharedInstance].debugMode = configCopy.environment == QONEnvironmentSandbox;
[[QNAPIClient shared] setSDKVersion:configCopy.version];
Expand All @@ -51,6 +59,21 @@ + (instancetype)initWithConfig:(QONConfiguration *)configuration {
return [Qonversion sharedInstance];
}

+ (instancetype)sharedInstance {
if (!_isInitialized) {
QONVERSION_ERROR(@"Attempt to get Qonversion instance before initialization. Please, call `initWithConfig` first.");
return nil;
}

static id shared = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
shared = self.new;
});

return shared;
}

- (void)launchWithKey:(nonnull NSString *)key completion:(QONLaunchCompletionHandler)completion {
NSString *userID = [[Qonversion sharedInstance].userInfoService obtainUserID];
QONVERSION_LOG(@"🚀 Qonversion initialized with userID: %@", userID);
Expand Down Expand Up @@ -184,16 +207,6 @@ - (void)handlePurchases:(NSArray<QONStoreKit2PurchaseModel *> *)purchasesInfo co

// MARK: - Private

+ (instancetype)sharedInstance {
static id shared = nil;
static dispatch_once_t once;
dispatch_once(&once, ^{
shared = self.new;
});

return shared;
}

- (instancetype)init {
self = super.init;
if (self) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ - (NSDictionary *)enrichParameters:(NSDictionary *)parameters {
NSMutableDictionary *baseDict = [[NSMutableDictionary alloc] initWithDictionary:_parameters];
baseDict[@"access_token"] = _apiKey;

[baseDict setObject:_userID forKey:@"q_uid"];
[baseDict setObject:_userID forKey:@"client_uid"];
[baseDict setObject:self.version forKey:@"version"];
[baseDict setObject:@(self.debug) forKey:@"debug_mode"];
baseDict[@"q_uid"] = _userID;
baseDict[@"client_uid"] = _userID;
baseDict[@"version"] = self.version;
baseDict[@"debug_mode"] = @(self.debug);

return [baseDict copy];
}
Expand Down
4 changes: 2 additions & 2 deletions fastlane/report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@



<testcase classname="fastlane.lanes" name="0: update_plist" time="0.154141">
<testcase classname="fastlane.lanes" name="0: update_plist" time="0.187624">

</testcase>


<testcase classname="fastlane.lanes" name="1: version_bump_podspec" time="0.001534">
<testcase classname="fastlane.lanes" name="1: version_bump_podspec" time="0.001514">

</testcase>

Expand Down

0 comments on commit 182e748

Please sign in to comment.