Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
dependencies {
implementation "com.facebook.react:react-android"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "io.qonversion:sandwich:6.0.6"
implementation "io.qonversion:sandwich:6.0.10"
}

if (isNewArchitectureEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class NoCodesModule(private val reactContext: ReactApplicationContext) : NativeN
}

@ReactMethod
override fun initialize(projectKey: String) {
override fun initialize(projectKey: String, source: String, version: String) {
noCodesSandwich.storeSdkInfo(reactContext, source, version)
noCodesSandwich.initialize(reactContext, projectKey, null, null, null)
noCodesSandwich.setDelegate(noCodesEventListener)
noCodesSandwich.setScreenCustomizationDelegate()
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PODS:
- fmt
- glog
- hermes-engine
- QonversionSandwich (= 6.0.8)
- QonversionSandwich (= 6.0.10)
- RCT-Folly
- RCT-Folly/Fabric
- RCTRequired
Expand All @@ -43,7 +43,7 @@ PODS:
- SocketRocket
- Yoga
- Qonversion/Main (5.13.3)
- QonversionSandwich (6.0.8):
- QonversionSandwich (6.0.10):
- NoCodes (= 0.1.3)
- Qonversion (= 5.13.3)
- RCT-Folly (2024.11.18.00):
Expand Down Expand Up @@ -2406,8 +2406,8 @@ SPEC CHECKSUMS:
hermes-engine: 4f07404533b808de66cf48ac4200463068d0e95a
NoCodes: 21b87d320a16758c6eb79167ff98010d81b4894e
Qonversion: 2b32ae8681de3ba02db5b5ed69c8f213ac4a28fa
qonversion-react-native-sdk: 046d871f4599e0f6e8097a0d660bf3091493888f
QonversionSandwich: 8a8638ee1fbdf304f0629f064712d206c390fedf
qonversion-react-native-sdk: dc32c5cf63d9e4f1d650ba3692209d09f115df06
QonversionSandwich: 6a8c8704a57bc97393ec1684c8932402aa0b7ba9
RCT-Folly: 59ec0ac1f2f39672a0c6e6cecdd39383b764646f
RCTDeprecation: efa5010912100e944a7ac9a93a157e1def1988fe
RCTRequired: bbc4cf999ddc4a4b076e076c74dd1d39d0254630
Expand Down
4 changes: 2 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def update_js(new_version)
path = Dir['../src/**/QonversionInternal.ts'].first
regex = /const sdkVersion = ".*";/
result_value = "const sdkVersion = \"#{new_version}\";"
regex = /export const sdkVersion = ".*";/
result_value = "export const sdkVersion = \"#{new_version}\";"

update_file(path, regex, result_value)
end
Expand Down
6 changes: 4 additions & 2 deletions ios/RNNoCodes.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ - (instancetype)init {
return self;
}

- (void)initialize:(NSString *)projectKey {
[self.impl initializeWithProjectKey:projectKey];
- (void)initialize:(NSString *)projectKey
source:(NSString *)source
version:(NSString *)version {
[self.impl initializeWithProjectKey:projectKey source:source version:version];
}

- (void)setScreenPresentationConfig:(NSDictionary *)configData
Expand Down
3 changes: 2 additions & 1 deletion ios/RNNoCodesImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public class RNNoCodesImpl: NSObject {
}

@objc
public func initialize(projectKey: String) {
public func initialize(projectKey: String, source: String, version: String) {
// Ignore source and version, because it's taken from the Qonversion SDK.
noCodesSandwich?.initialize(projectKey: projectKey)
}

Expand Down
2 changes: 1 addition & 1 deletion qonversion-react-native-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
s.private_header_files = "ios/**/*.h"

s.dependency "QonversionSandwich", "6.0.8"
s.dependency "QonversionSandwich", "6.0.10"
install_modules_dependencies(s)
end
4 changes: 3 additions & 1 deletion src/internal/NoCodesInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import ScreenPresentationConfig from '../dto/ScreenPresentationConfig';
import NoCodesError from '../dto/NoCodesError';
import {NoCodesErrorCode} from '../dto/enums';
import RNNoCodes, {type NoCodeEvent} from './specs/NativeNoCodesModule';
import {sdkSource, sdkVersion} from './QonversionInternal';

const EVENT_SCREEN_SHOWN = "nocodes_screen_shown";
const EVENT_FINISHED = "nocodes_finished";
const EVENT_ACTION_STARTED = "nocodes_action_started";
Expand All @@ -17,7 +19,7 @@ export default class NoCodesInternal implements NoCodesApi {
private noCodesListener: NoCodesListener | null = null;

constructor(config: NoCodesConfig) {
RNNoCodes.initialize(config.projectKey);
RNNoCodes.initialize(config.projectKey, sdkSource, sdkVersion);

if (config.noCodesListener) {
this.setNoCodesListener(config.noCodesListener);
Expand Down
5 changes: 3 additions & 2 deletions src/internal/QonversionInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ import PromotionalOffer from '../dto/PromotionalOffer';
import RNQonversion from './specs/NativeQonversionModule';
import type { QPromoOfferDetails } from './specs/NativeQonversionModule';

const sdkVersion = "9.0.2";
export const sdkVersion = "9.0.2";
export const sdkSource = "rn";

export default class QonversionInternal implements QonversionApi {

private entitlementsUpdateListener: EntitlementsUpdateListener | null = null;
private promoPurchasesDelegate: PromoPurchasesListener | null = null;

constructor(qonversionConfig: QonversionConfig) {
RNQonversion.storeSDKInfo("rn", sdkVersion);
RNQonversion.storeSDKInfo(sdkSource, sdkVersion);
RNQonversion.initializeSdk(
qonversionConfig.projectKey,
qonversionConfig.launchMode,
Expand Down
2 changes: 1 addition & 1 deletion src/internal/specs/NativeNoCodesModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type NoCodeEvent = {
};

export interface Spec extends TurboModule {
initialize(projectKey: string): void;
initialize(projectKey: string, source: string, version: string): void;
setScreenPresentationConfig(configData: Object, contextKey?: string): Promise<boolean>;
showScreen(contextKey: string): Promise<boolean>;
close(): Promise<boolean>;
Expand Down