Skip to content

Commit 00c808f

Browse files
authored
3.3.2-8 (#397)
* 3.3.2-8 * fix eslint warning and remove unneeded interfaces
1 parent 26af2c7 commit 00c808f

31 files changed

+263
-129
lines changed

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ dependencies {
8585
implementation fileTree(dir: 'libs', include: ['*.jar'])
8686
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
8787

88-
playImplementation "com.namiml:sdk-android:3.3.2.5"
89-
amazonImplementation "com.namiml:sdk-amazon:3.3.2.5"
88+
playImplementation "com.namiml:sdk-android:3.3.2.6"
89+
amazonImplementation "com.namiml:sdk-amazon:3.3.2.6"
9090

9191
implementation "com.facebook.react:react-native:+" // From node_modules
9292
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4"

android/src/main/java/com/namiml/reactnative/NamiFlowManagerBridge.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ class NamiFlowManagerBridgeModule internal constructor(
7575
promise.resolve(NamiFlowManager.isFlowOpen())
7676
}
7777

78-
@ReactMethod
79-
fun purchaseSuccess() {
80-
NamiFlowManager.purchaseSuccess()
81-
}
82-
8378
private fun sendEvent(
8479
eventName: String,
8580
params: WritableMap?,

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ export { NamiEntitlementManager } from './src/NamiEntitlementManager';
55
export { NamiPurchaseManager } from './src/NamiPurchaseManager';
66
export { NamiPaywallManager } from './src/NamiPaywallManager';
77
export { NamiFlowManager } from './src/NamiFlowManager';
8+
import './src/NamiOverlayControl';
89
export { NamiOverlayControl } from './src/NamiOverlayControl';
910
export * from './src/types';

dist/src/NamiFlowManager.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ export declare const NamiFlowManager: {
1111
registerEventHandler: (callback: (payload: Record<string, unknown>) => void) => (() => void);
1212
finish: () => void;
1313
isFlowOpen: () => Promise<boolean>;
14-
purchaseSuccess: () => void;
1514
};

dist/src/NamiOverlayControl.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import React from 'react';
12
import { NativeEventEmitter } from 'react-native';
23
export declare const NamiOverlayControl: {
34
emitter: NativeEventEmitter;
45
presentOverlay(): Promise<void>;
56
finishOverlay(result?: any): Promise<void>;
67
onOverlayReady(handler: () => void): () => void;
78
onOverlayResult(handler: (result: any) => void): () => void;
9+
setCustomOverlayComponent(component: React.ComponentType<any>): void;
810
};
9-
export default function NamiOverlayHost(): any;
11+
declare function NamiOverlayHost(): any;
12+
export default NamiOverlayHost;

dist/src/version.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
* Auto-generated file. Do not edit manually.
33
* React Native Nami SDK version.
44
*/
5-
export declare const NAMI_REACT_NATIVE_VERSION = "3.3.2-7";
5+
export declare const NAMI_REACT_NATIVE_VERSION = "3.3.2-8";

examples/Basic/containers/ProfileScreen.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React, {
44
useState,
55
useLayoutEffect,
66
useCallback,
7+
useMemo,
78
} from 'react';
89
import { StyleSheet, View, Text, TouchableOpacity } from 'react-native';
910
import { SafeAreaView } from 'react-native-safe-area-context';
@@ -80,15 +81,15 @@ const ProfileScreen: FC<ProfileScreenProps> = ({ navigation }) => {
8081
const [externalId, setExternalId] = useState<string | undefined>(undefined);
8182
const [displayedDeviceId, setDisplayedDeviceId] = useState<string>('');
8283

83-
const defaultJourneyState: CustomerJourneyState = {
84+
const defaultJourneyState: CustomerJourneyState = useMemo(() => ({
8485
inTrialPeriod: false,
8586
inIntroOfferPeriod: false,
8687
isCancelled: false,
8788
formerSubscriber: false,
8889
inGracePeriod: false,
8990
inAccountHold: false,
9091
inPause: false,
91-
};
92+
}), []);
9293

9394
const checkIsLoggedIn = useCallback(() => {
9495
// workaround for tests purposes
@@ -112,12 +113,12 @@ const ProfileScreen: FC<ProfileScreenProps> = ({ navigation }) => {
112113
}, [checkIsLoggedIn]);
113114

114115

115-
const getJourneyState = () => {
116+
const getJourneyState = useCallback(() => {
116117
NamiCustomerManager.journeyState().then(myJourneyState => {
117118
console.log('myJourneyState', myJourneyState);
118119
setJourneyState(myJourneyState ?? defaultJourneyState);
119120
});
120-
};
121+
}, [defaultJourneyState]);
121122

122123
const checkId = useCallback(() => {
123124
if (isUserLogin) {
@@ -171,7 +172,7 @@ const ProfileScreen: FC<ProfileScreenProps> = ({ navigation }) => {
171172
subscriptionJourneyStateRemover();
172173
subscriptionAccountStateRemover();
173174
};
174-
}, [checkId, checkIsLoggedIn, onLoginPress, onLogoutPress]);
175+
}, [checkId, checkIsLoggedIn, getJourneyState, onLoginPress, onLogoutPress]);
175176

176177
useLayoutEffect(() => {
177178
navigation.setOptions({

examples/Basic/hooks/useNamiFlowListener.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,5 +235,5 @@ export function useNamiFlowListener(
235235
log.debug('[NamiFlowManager] Removing step handoff listener');
236236
unsubscribe?.();
237237
};
238-
}, []);
238+
}, [navigationRef, setNamiSku, setProducts, setSubscriptions]);
239239
}

examples/Basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"react-native-base64": "^0.2.1",
4242
"react-native-iap": "12.16.0",
4343
"react-native-logs": "^5.1.0",
44-
"react-native-nami-sdk": "file:../../react-native-nami-sdk-3.3.2-7.tgz",
44+
"react-native-nami-sdk": "file:../../react-native-nami-sdk-3.3.2-8.tgz",
4545
"react-native-permissions": "^5.4.1",
4646
"react-native-reanimated": "3.18.0",
4747
"react-native-safe-area-context": "^4.10.7",

examples/TestNamiTV/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const App = () => {
128128
return () => {
129129
unsubscribe?.();
130130
};
131-
}, [wasOnSignIn]);
131+
}, [navigationRef, wasOnSignIn]);
132132

133133
useEffect(() => {
134134
const buySkuListener = NamiPaywallManager.registerBuySkuHandler(async (sku: NamiSKU) => {

0 commit comments

Comments
 (0)