diff --git a/Framework/Info.plist b/Framework/Info.plist
index 11b5baf7..df9138c2 100644
--- a/Framework/Info.plist
+++ b/Framework/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 5.0.0
+ 5.0.1
CFBundleSignature
????
CFBundleVersion
diff --git a/Qonversion.podspec b/Qonversion.podspec
index c9955320..e49262bf 100644
--- a/Qonversion.podspec
+++ b/Qonversion.podspec
@@ -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
diff --git a/Sources/Qonversion/Public/QONConfiguration.m b/Sources/Qonversion/Public/QONConfiguration.m
index b918b58e..b88b6882 100644
--- a/Sources/Qonversion/Public/QONConfiguration.m
+++ b/Sources/Qonversion/Public/QONConfiguration.m
@@ -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 ()
diff --git a/Sources/Qonversion/Public/Qonversion.m b/Sources/Qonversion/Public/Qonversion.m
index 42321fa9..4c160e91 100644
--- a/Sources/Qonversion/Public/Qonversion.m
+++ b/Sources/Qonversion/Public/Qonversion.m
@@ -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];
@@ -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);
@@ -184,16 +207,6 @@ - (void)handlePurchases:(NSArray *)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) {
diff --git a/Sources/Qonversion/Qonversion/Services/QNAPIClient/QNAPIClient.m b/Sources/Qonversion/Qonversion/Services/QNAPIClient/QNAPIClient.m
index 79761d05..ec7a5765 100644
--- a/Sources/Qonversion/Qonversion/Services/QNAPIClient/QNAPIClient.m
+++ b/Sources/Qonversion/Qonversion/Services/QNAPIClient/QNAPIClient.m
@@ -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];
}
diff --git a/fastlane/report.xml b/fastlane/report.xml
index d1f28b82..5ad8f75d 100644
--- a/fastlane/report.xml
+++ b/fastlane/report.xml
@@ -5,12 +5,12 @@
-
+
-
+