Skip to content

Commit ecef772

Browse files
Merge pull request #251 Release 3.15.0
2 parents 8861fe1 + 4d3eaf3 commit ecef772

36 files changed

+4172
-258
lines changed

android/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ def getExtOrDefault(name) {
110110
def kotlin_version = getExtOrDefault('kotlinVersion')
111111

112112
dependencies {
113-
api 'io.adapty:android-sdk:3.14.1'
114-
api 'io.adapty:android-ui:3.14.0'
115-
api 'io.adapty.internal:crossplatform:3.14.1'
113+
implementation platform('io.adapty:adapty-bom:3.15.1')
114+
implementation 'io.adapty:android-sdk'
115+
implementation 'io.adapty:android-ui'
116+
implementation 'io.adapty.internal:crossplatform:3.15.2'
116117

117118
// Compatible with older and newer RN
118119
//noinspection GradleDynamicVersion

cross_platform.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$schema: "https://json-schema.org/draft/2020-12/schema"
2-
$id: "https://adapty.io/crossPlatform/3.14.0/schema"
2+
$id: "https://adapty.io/crossPlatform/3.15.1/schema"
33
title: "Cross Platform Format"
44

55
$requests:
@@ -56,6 +56,8 @@ $requests:
5656
- onboarding
5757
properties:
5858
method: { const: "adapty_ui_create_onboarding_view" }
59+
onboarding: { $ref: "#/$defs/AdaptyOnboarding" }
60+
external_urls_presentation: { $ref: "#/$defs/AdaptyWebPresentation" }
5961

6062
AdaptyUICreateOnboardingView.Response: #response
6163
type: object
@@ -401,6 +403,7 @@ $requests:
401403
required: [method]
402404
properties:
403405
method: { const: "open_web_paywall" }
406+
open_in: { $ref: "#/$defs/AdaptyWebPresentation", default: "browser_out_app" }
404407
oneOf:
405408
- required: [product]
406409
properties:
@@ -1481,6 +1484,12 @@ $defs:
14811484
- full_screen
14821485
- page_sheet
14831486

1487+
AdaptyWebPresentation: #request
1488+
type: string
1489+
enum:
1490+
- browser_out_app
1491+
- browser_in_app
1492+
14841493
AdaptyUI.DialogConfiguration: #request
14851494
type: object
14861495
required: [default_action]

examples/AdaptyDevtools/app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "AdaptyDevtools",
3-
"displayName": "AdaptyDevtools"
2+
"name": "AdaptyRnSdkExample",
3+
"displayName": "AdaptyRnSdkExample"
44
}

examples/AdaptyDevtools/ios/Podfile.lock

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
PODS:
2-
- Adapty (3.14.1):
3-
- AdaptyLogger (= 3.14.1)
4-
- AdaptyUIBuilder (= 3.14.1)
5-
- AdaptyLogger (3.14.1)
6-
- AdaptyPlugin (3.14.1):
7-
- Adapty (= 3.14.1)
8-
- AdaptyLogger (= 3.14.1)
9-
- AdaptyUI (= 3.14.1)
10-
- AdaptyUIBuilder (= 3.14.1)
11-
- AdaptyUI (3.14.1):
12-
- Adapty (= 3.14.1)
13-
- AdaptyLogger (= 3.14.1)
14-
- AdaptyUIBuilder (= 3.14.1)
15-
- AdaptyUIBuilder (3.14.1):
16-
- AdaptyLogger (= 3.14.1)
2+
- Adapty (3.15.1):
3+
- AdaptyLogger (= 3.15.1)
4+
- AdaptyUIBuilder (= 3.15.1)
5+
- AdaptyLogger (3.15.1)
6+
- AdaptyPlugin (3.15.1):
7+
- Adapty (= 3.15.1)
8+
- AdaptyLogger (= 3.15.1)
9+
- AdaptyUI (= 3.15.1)
10+
- AdaptyUIBuilder (= 3.15.1)
11+
- AdaptyUI (3.15.1):
12+
- Adapty (= 3.15.1)
13+
- AdaptyLogger (= 3.15.1)
14+
- AdaptyUIBuilder (= 3.15.1)
15+
- AdaptyUIBuilder (3.15.1):
16+
- AdaptyLogger (= 3.15.1)
1717
- boost (1.84.0)
1818
- DoubleConversion (1.1.6)
1919
- fast_float (8.0.0)
@@ -1663,10 +1663,10 @@ PODS:
16631663
- React-RCTFBReactNativeSpec
16641664
- ReactCommon/turbomodule/core
16651665
- SocketRocket
1666-
- react-native-adapty-sdk (3.14.0):
1667-
- Adapty (= 3.14.1)
1668-
- AdaptyPlugin (= 3.14.1)
1669-
- AdaptyUI (= 3.14.1)
1666+
- react-native-adapty-sdk (3.15.0):
1667+
- Adapty (= 3.15.1)
1668+
- AdaptyPlugin (= 3.15.1)
1669+
- AdaptyUI (= 3.15.1)
16701670
- React
16711671
- react-native-safe-area-context (5.4.1):
16721672
- boost
@@ -2538,11 +2538,11 @@ EXTERNAL SOURCES:
25382538
:path: "../node_modules/react-native/ReactCommon/yoga"
25392539

25402540
SPEC CHECKSUMS:
2541-
Adapty: 49795e39a24caae30ac6842fe52fdb08622a5dde
2542-
AdaptyLogger: dacdb8a91f6a4ca30dc0b03f1b2b6fd33de742a9
2543-
AdaptyPlugin: 32b5242897a3959af18f9abae8b1b44a2fd27ba2
2544-
AdaptyUI: c3acd25bbe344853f3a6c7724acfb047e439b195
2545-
AdaptyUIBuilder: c74e253e65311a8853b2010fb65021d61c24f4ac
2541+
Adapty: bb2cc10a238b5d53025a0a969bc2a7ad6e9a48f5
2542+
AdaptyLogger: 2d1a3cc8b8dee29dc171df753d6b6d45332bd399
2543+
AdaptyPlugin: 79f4d39bcaa84ad3755fe0f0a07148abca2af4ed
2544+
AdaptyUI: 56ff8ed7be49cbff9cdc29ddde230de60e115d4f
2545+
AdaptyUIBuilder: 3204524ee377de2eddec478d51c3cf1f1e83ef1c
25462546
boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90
25472547
DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb
25482548
fast_float: b32c788ed9c6a8c584d114d0047beda9664e7cc6
@@ -2583,7 +2583,7 @@ SPEC CHECKSUMS:
25832583
React-logger: b69e65dc60f768e5509ac0cc27a360124bf70478
25842584
React-Mapbuffer: b48f9f3311fd0ec0f7a5dc39d707eff521fb5f38
25852585
React-microtasksnativemodule: d8568d0485a350c720c061ae835e09fc88c28715
2586-
react-native-adapty-sdk: a2c859c9190f1a83547aac22c73e656d07338533
2586+
react-native-adapty-sdk: 39e2fb1607910e7d719e291281516864846792f1
25872587
react-native-safe-area-context: 6775aa9089fa84b77abd7ebdcf45e224a2a2ad3e
25882588
React-NativeModulesApple: f10596688a03af66804cfbe61792be24a7888da8
25892589
React-oscompat: 7c0a341cc31e350da71ddf2e46de0a845d1d1626

ios/AdaptyOnboardingWrapperView.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ class AdaptyOnboardingWrapperView: UIView {
4343
guard id != "NO_ID" else { return }
4444

4545
Task { @MainActor in
46-
guard let onboarding = await AdaptyPlugin.executeCreateNativeOnboardingView(withJson: json),
47-
let config = try? AdaptyUI.getOnboardingConfiguration(forOnboarding: onboarding)
48-
else { return }
46+
guard let config = try? await AdaptyPlugin.getOnboardingViewConfiguration(withJson: json)
47+
else {
48+
print("AdaptyOnboardingWrapperView: Failed to get onboarding configuration")
49+
return
50+
}
4951

5052
let handler = SwiftAdaptyPluginEventHandler { event in
5153
RNAdapty.emitPluginEvent(event)

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package",
33
"name": "react-native-adapty",
4-
"version": "3.14.2",
4+
"version": "3.15.0",
55
"description": "Adapty React Native SDK",
66
"license": "MIT",
77
"author": "Adapty team <support@adapty.io>",
@@ -21,7 +21,15 @@
2121
},
2222
"files": [
2323
"src/",
24+
"!src/__tests__",
25+
"!src/__docs__*",
26+
"!**/*.test.ts",
27+
"!**/*.test.tsx",
28+
"!**/*.spec.ts",
29+
"!**/*.spec.tsx",
2430
"dist/",
31+
"!dist/__tests__",
32+
"!dist/__docs__*",
2533
"ios/",
2634
"!ios/build",
2735
"!ios/RNAdapty.xcodeproj/project.xcworkspace",

react-native-adapty-sdk.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Pod::Spec.new do |s|
1919
s.resources = "ios/**/*.{plist}"
2020
s.requires_arc = true
2121

22-
s.dependency "Adapty", "3.14.1"
23-
s.dependency "AdaptyUI", "3.14.1"
24-
s.dependency "AdaptyPlugin", "3.14.1"
22+
s.dependency "Adapty", "3.15.1"
23+
s.dependency "AdaptyUI", "3.15.1"
24+
s.dependency "AdaptyPlugin", "3.15.1"
2525
s.dependency "React"
2626
end
2727

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { Adapty } from '@/adapty-handler';
2+
import type { AdaptyPaywallProduct, AdaptyProfile } from '@/types';
3+
import { createAdaptyInstance, cleanupAdapty } from './setup.utils';
4+
5+
describe('Adapty - Purchase Event', () => {
6+
let adapty: Adapty;
7+
8+
beforeEach(async () => {
9+
adapty = await createAdaptyInstance();
10+
});
11+
12+
afterEach(() => {
13+
cleanupAdapty(adapty);
14+
});
15+
16+
it('should emit onLatestProfileLoad event after purchase with correct format', async () => {
17+
const product: AdaptyPaywallProduct = {
18+
ios: { isFamilyShareable: false },
19+
vendorProductId: 'com.example.test',
20+
adaptyId: 'adapty_test',
21+
paywallProductIndex: 0,
22+
localizedDescription: 'Test Product',
23+
localizedTitle: 'Test',
24+
regionCode: 'US',
25+
variationId: 'variation_test',
26+
paywallABTestName: 'test_ab',
27+
paywallName: 'Test Paywall',
28+
accessLevelId: 'test_premium',
29+
productType: 'subscription',
30+
payloadData: 'test_payload',
31+
price: {
32+
amount: 9.99,
33+
currencyCode: 'USD',
34+
currencySymbol: '$',
35+
localizedString: '$9.99',
36+
},
37+
};
38+
39+
const profileUpdates: AdaptyProfile[] = [];
40+
41+
const listener = adapty.addEventListener('onLatestProfileLoad', profile => {
42+
profileUpdates.push(profile);
43+
44+
// Verify no circular references by serializing
45+
expect(() => JSON.stringify(profile)).not.toThrow();
46+
});
47+
48+
try {
49+
const result = await adapty.makePurchase(product);
50+
expect(result.type).toBe('success');
51+
52+
await new Promise(resolve => setTimeout(resolve, 100));
53+
54+
expect(profileUpdates).toHaveLength(1);
55+
expect(profileUpdates[0]?.profileId).toBeDefined();
56+
expect(profileUpdates[0]?.accessLevels?.['config_premium']).toBeDefined();
57+
expect(
58+
profileUpdates[0]?.accessLevels?.['config_premium']?.isActive,
59+
).toBe(true);
60+
} finally {
61+
listener.remove();
62+
}
63+
});
64+
});

0 commit comments

Comments
 (0)