File tree 5 files changed +43
-8
lines changed
5 files changed +43
-8
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,24 @@ const Root = () => {
56
56
return ( ) => { } ;
57
57
} , [ ] ) ;
58
58
59
+ useEffect ( ( ) => {
60
+ async function configureNami ( ) {
61
+ checkSdkConfigured ( ) ;
62
+
63
+ const result = await Nami . configure ( configDict ) ;
64
+ if ( result . success ) {
65
+ setIsConfigurationComplete ( true ) ;
66
+ checkSdkConfigured ( ) ;
67
+ }
68
+
69
+ initStoreConnection ( ) ;
70
+
71
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
72
+ return ( ) => { } ;
73
+ }
74
+ configureNami ( ) ;
75
+ } , [ ] ) ;
76
+
59
77
return isConfigurationComplete ? < App /> : < View /> ;
60
78
} ;
61
79
Original file line number Diff line number Diff line change @@ -23,18 +23,19 @@ const Root = () => {
23
23
useEffect ( ( ) => {
24
24
async function configureNami ( ) {
25
25
const result = await Nami . configure ( configDict ) ;
26
- if ( result . success ) {
26
+ if ( result . success ) {
27
27
setIsConfigurationComplete ( true ) ;
28
-
28
+
29
29
if ( Platform . constants . Manufacturer === 'Amazon' ) {
30
30
NamiPaywallManager . setProductDetails ( getAmazonProducts ( ) , false ) ;
31
31
}
32
32
}
33
+
34
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
35
+ return ( ) => { } ;
36
+
33
37
}
34
38
configureNami ( ) ;
35
-
36
- // eslint-disable-next-line @typescript-eslint/no-empty-function
37
- return ( ) => { } ;
38
39
} , [ ] ) ;
39
40
40
41
return isConfigurationComplete ? < App /> : < View /> ;
Original file line number Diff line number Diff line change @@ -6,5 +6,4 @@ export { NamiEntitlementManager } from './src/NamiEntitlementManager';
6
6
export { NamiManager } from './src/NamiManager' ;
7
7
export { NamiPurchaseManager } from './src/NamiPurchaseManager' ;
8
8
export { NamiPaywallManager } from './src/NamiPaywallManager' ;
9
- export { NamiSKU } from './src/types' ;
10
9
export * from './src/types' ;
Original file line number Diff line number Diff line change @@ -47,13 +47,20 @@ export type AppleProduct = {
47
47
export type GoogleProduct = { } ;
48
48
export type AmazonProduct = { } ;
49
49
export type NamiCampaign = {
50
- id : string ;
50
+ name : string ;
51
51
rule : string ;
52
52
segment : string ;
53
53
paywall : string ;
54
54
type : NamiCampaignRuleType ;
55
55
value ?: string | null ;
56
+ form_factors : NamiFormFactor [ ] ;
57
+ external_segment : string | null ;
56
58
} ;
59
+ type NamiFormFactor = {
60
+ form_factor : string ;
61
+ supports_portrait ?: boolean ;
62
+ supports_landscape ?: boolean ;
63
+ }
57
64
export declare enum NamiCampaignRuleType {
58
65
DEFAULT = "default" ,
59
66
LABEL = "label" ,
@@ -158,6 +165,7 @@ export type NamiPurchase = {
158
165
sku ?: NamiSKU ;
159
166
skuId : string ;
160
167
transactionIdentifier ?: string ;
168
+ purchaseToken ?: string ;
161
169
expires ?: Date ;
162
170
purchaseInitiatedTimestamp : Date ;
163
171
purchaseSource ?: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN' ;
Original file line number Diff line number Diff line change @@ -153,12 +153,14 @@ export type AmazonProduct = {};
153
153
154
154
// NamiCampaignManager
155
155
export type NamiCampaign = {
156
- id : string ;
156
+ name : string ;
157
157
rule : string ;
158
158
segment : string ;
159
159
paywall : string ;
160
160
type : NamiCampaignRuleType ;
161
161
value ?: string | null ;
162
+ form_factors : NamiFormFactor [ ] ;
163
+ external_segment : string | null ;
162
164
} ;
163
165
164
166
export enum NamiCampaignRuleType {
@@ -168,6 +170,12 @@ export enum NamiCampaignRuleType {
168
170
URL = 'url' ,
169
171
}
170
172
173
+ type NamiFormFactor = {
174
+ form_factor ?: string ;
175
+ supports_portrait ?: boolean ;
176
+ supports_landscape ?: boolean ;
177
+ } ;
178
+
171
179
export enum LaunchCampaignError {
172
180
DEFAULT_CAMPAIGN_NOT_FOUND = 0 ,
173
181
LABELED_CAMPAIGN_NOT_FOUND = 1 ,
@@ -295,6 +303,7 @@ export type NamiPurchase = {
295
303
sku ?: NamiSKU ;
296
304
skuId : string ;
297
305
transactionIdentifier ?: string ;
306
+ purchaseToken ?: string ;
298
307
expires ?: Date ;
299
308
purchaseInitiatedTimestamp : Date ;
300
309
purchaseSource ?: 'CAMPAIGN' | 'MARKETPLACE' | 'UNKNOWN' ;
You can’t perform that action at this time.
0 commit comments