3.3.9
0.59.9
iOS ๋ฐ Android
Play Console๊ณผ Appstore์์ ์์ฑ ๋ ๋ค์ํ ์ ํ๊ณผ ๊ตฌ๋ ์ ์ป์ ์์์ ๊ฒ์ผ๋ก ๊ธฐ๋ํฉ๋๋ค.
RNIap.getProducts
๋ฐ RNIap.getSubscriptions
ํจ์๋ ํญ์ ๋น ๋ฐฐ์ด์ ๋ฐํํฉ๋๋ค.
iOS ์๋ฎฌ๋ ์ดํฐ, Android ์๋ฎฌ๋ ์ดํฐ ๋ฐ Android ์ค์ ์ฅ์น
24 ์๊ฐ ์ด์ ๊ธฐ๋ค๋ ธ์ต๋๋ค. ๋ํ Google Play Console์์ ๋ด๋ถ ๋ฐ ์ํ ๋ฆด๋ฆฌ์ค๋ฅผ ๋ง๋ค์์ง ๋ง ์ฌ์ ํ ๋น ๋ฐฐ์ด ๋ง ๋ฐํ๋ฉ๋๋ค.
์ ํํ ์ธ์ ์๋์ ์์ํด์ผํ๋์ง ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ์๋ฅผ ๋ค์ด ๋ด ์ํ ํ
์คํธ ์ถ์๊ฐ Google Play Console์ ์์ง ๊ฒ์ ๋ณด๋ฅ ์ค์ด๋ผ๋ฉด react-native-iap
์ด ์๋ํ์ง ์๋๋ค๋ ์๋ฏธ์ธ๊ฐ์? ์ฑ์ด ๊ฒ์ ๋ ๋๊น์ง ๊ธฐ๋ค๋ ค์ผํ๋์?
๋ํ ์๋ฎฌ๋ ์ดํฐ / ์๋ฎฌ๋ ์ดํฐ์์ ํ
์คํธ ๊ตฌ๋งค๋ ํ ์ ์์ง๋ง getProducts
/ getSubscriptions
๊ฐ ์๋ฎฌ๋ ์ดํฐ์์ ์๋ํด์ผํฉ๋๊น? ์๋๋ฉด ํ
์คํธ๋ฅผ ์ํด ์ค์ ์ฅ์น๊ฐ ํ์ํฉ๋๊น?
const itemSkus = Platform.select({
ios: ['product_1'],
android: ['1', '2']
});
const itemSubs = Platform.select({
ios: ['subscription_1'],
android: ['subscription_1', 'subscription_2']
});
let purchaseUpdateSubscription;
let purchaseErrorSubscription;
class App extends Component {
constructor(props) {
super(props);
this.state = {
productList: [],
receipt: '',
availableItemsMessage: ''
};
}
async componentDidMount() {
SplashScreen.hide();
try {
const result = await RNIap.initConnection();
await RNIap.consumeAllItemsAndroid();
console.log('result', result);
} catch (err) {
console.warn(err.code, err.message);
}
purchaseUpdateSubscription = purchaseUpdatedListener(async purchase => {
console.log('purchaseUpdatedListener', purchase);
if (purchase.purchaseStateAndroid === 1 && !purchase.isAcknowledgedAndroid) {
try {
const ackResult = await acknowledgePurchaseAndroid(purchase.purchaseToken);
console.log('ackResult', ackResult);
} catch (ackErr) {
console.warn('ackErr', ackErr);
}
}
this.setState({ receipt: purchase.transactionReceipt }, () => this.goNext());
});
purchaseErrorSubscription = purchaseErrorListener(error => {
console.log('purchaseErrorListener', error);
Alert.alert('purchase error', JSON.stringify(error));
});
}
componentWillMount() {
if (purchaseUpdateSubscription) {
purchaseUpdateSubscription.remove();
purchaseUpdateSubscription = null;
}
if (purchaseErrorSubscription) {
purchaseErrorSubscription.remove();
purchaseErrorSubscription = null;
}
}
goNext = () => {
Alert.alert('Receipt', this.state.receipt);
};
getItems = async () => {
try {
const products = await RNIap.getProducts(itemSkus);
console.log('Products', products);
this.setState({ productList: products });
} catch (err) {
console.warn(err.code, err.message);
}
};
getSubscriptions = async () => {
try {
const products = await RNIap.getSubscriptions(itemSubs);
console.log('Products', products);
this.setState({ productList: products });
} catch (err) {
console.warn(err.code, err.message);
}
};
getAvailablePurchases = async () => {
try {
console.info('Get available purchases (non-consumable or unconsumed consumable)');
const purchases = await RNIap.getAvailablePurchases();
console.info('Available purchases :: ', purchases);
if (purchases && purchases.length > 0) {
this.setState({
availableItemsMessage: `Got ${purchases.length} items.`,
receipt: purchases[0].transactionReceipt
});
}
} catch (err) {
console.warn(err.code, err.message);
Alert.alert(err.message);
}
};
requestPurchase = async sku => {
try {
RNIap.requestPurchase(sku);
} catch (err) {
console.warn(err.code, err.message);
}
};
requestSubscription = async sku => {
try {
RNIap.requestSubscription(sku);
} catch (err) {
Alert.alert(err.message);
}
};
render() {
const { productList, receipt, availableItemsMessage } = this.state;
const receipt100 = receipt.substring(0, 100);
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={styles.headerTxt}>react-native-iap V3</Text>
</View>
<View style={styles.content}>
<ScrollView style={{ alignSelf: 'stretch' }}>
<View style={{ height: 50 }} />
<NativeButton
onPress={this.getAvailablePurchases}
activeOpacity={0.5}
style={styles.btn}
textStyle={styles.txt}
>
Get available purchases
</NativeButton>
<Text style={{ margin: 5, fontSize: 15, alignSelf: 'center' }}>
{availableItemsMessage}
</Text>
<Text style={{ margin: 5, fontSize: 9, alignSelf: 'center' }}>
{receipt100}
</Text>
<NativeButton
onPress={() => this.getItems()}
activeOpacity={0.5}
style={styles.btn}
textStyle={styles.txt}
>
Get Products ({productList.length})
</NativeButton>
{productList.map((product, i) => {
return (
<View
key={i}
style={{
flexDirection: 'column'
}}
>
<Text
style={{
marginTop: 20,
fontSize: 12,
color: 'black',
minHeight: 100,
alignSelf: 'center',
paddingHorizontal: 20
}}
>
{JSON.stringify(product)}
</Text>
<NativeButton
// onPress={() => this.requestPurchase(product.productId)}
onPress={() => this.requestSubscription(product.productId)}
// onPress={() => this.buyItem(product.productId)}
// onPress={() => this.buySubscribeItem(product.productId)}
activeOpacity={0.5}
style={styles.btn}
textStyle={styles.txt}
>
Request purchase for above product
</NativeButton>
</View>
);
})}
</ScrollView>
</View>
</View>
);
}
}
๋น์ ์ ํ์๊ฐ ์์ต๋๋ค real device
์ ํ
์คํธ์ ios
์ ๋ํด getProducts
/ getSubscription
์์๊ฐ ์๋๋ผ android
. android
๊ตฌ๋งคํ๋ ค๋ฉด ์ค์ ๊ธฐ๊ธฐ๊ฐ ํ์ํฉ๋๋ค.
Google์ ๊ฒฝ์ฐ ๋ด ๊ฐ์ด๋ ๋ฅผ ๊ฒํ ํ์ฌ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ญ์์ค.
์ค์ ๋ก ํ
์คํธ๋ฅผ ์ํด ์ฑ์ playstore์ ๊ฒ์ ํ ํ์๋ ์์ง๋ง ์๋ช
๋ APK๋ฅผ ์
๋ก๋ํด์ผํฉ๋๋ค.
๋๋ ๋ํ์ด ๋ฌธ์ ๊ฐ ์๋๋ฐ, ์ด๋ฏธ ์ ํ์์ ์ ํ์ ๋ง๋ค์๊ณ ์ก์ธ์ค ํ ์์๋ ๊ฒ ๊ฐ์ต๋๋ค.
const itemSkus = Platform.select({
ios: [
'product1'
],
android: []
});
RNIap.getProducts(itemSkus).then((products) => {
console.log(products); //<< returns empty array
}).catch((error) => console.log(error))
์ ํ์ด ๊ทํ์ ๊ฒฝํ์ ๋ฐ์๋๋ ๋ฐ ์๊ฐ์ด ๊ฑธ๋ฆฌ๋์?
๊ณ์ฝ, ์ธ๊ธ ๋ฐ ์ํ ์
๋ฌด๊ฐ ๋ชจ๋ ํ์ฑํ ๋จ
"react-native-iap": "^ 3.4.0",
์ธ์ฑ์ ์ด๋ฏธ "์ ์ถ ์ค๋น ์๋ฃ"์ํ์
๋๋ค.
@nateblog ์ด๋ค ์ข ๋ฅ์ ์ ํ์ ๋ง๋ค์์ต๋๊น? ๊ตฌ๋ ์ด๋ ๋ค๋ฅธ ๊ฒ?
๋ํ ์ ํ / ๊ตฌ๋ ์ ๋ํด App Store Connect์ ํ์งํ๋ฅผ ์ถ๊ฐ ํ์ต๋๊น? ๊ทธ๋ ๋ค๋ฉด ์ฅ์น ๋๋ ์๋ฎฌ๋ ์ดํฐ์์ ํ์ฑํ ํ ํ์งํ๋ฅผ ์ถ๊ฐํด๋ณด์ญ์์ค. ์ด์ ์ ๋ช ๊ฐ์ง ๋ฌธ์ ๊ฐ ์์๋ ๊ฒ์ ๊ธฐ์ตํฉ๋๋ค. ๋ด ์๋ฎฌ๋ ์ดํฐ ๋ฐ ์ฅ์น ๋ก์ผ์ผ์ด ์์ด๋ก๋์ด ์์ผ๋ฏ๋ก ๊ตฌ๋ ์ ๋ํด "์์ด (๋ฏธ๊ตญ)"ํ์งํ ๋ง ์ถ๊ฐํ์ต๋๋ค.
@jvandenaardweg- ์๋ต ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ํ์งํ๋ฅผ ๊ฑด๋ ๋ฐ๋ฉด ์ธ์ฑ ์ํ๊ฐ "์ ์ถ ์ค๋น ์๋ฃ"๋ก ์ค์ ๋์ง ์๊ธฐ ๋๋ฌธ์ ์ด๋ฏธ ํ์งํ๋ฅผ ์ถ๊ฐํ์ต๋๋ค. ์ฌ์ฉ์ค์ธ ๊ธฐ๊ธฐ๊ฐ ์์ด๋ฅผ ์ฌ์ฉํ๊ณ ์๊ณ ์ ํ์ด ๊ตฌ๋ ์ด๋ฏ๋ก ํ์งํ๋ฅผ "์์ด (๋ฏธ๊ตญ)"๋ก ์ค์ ํ์ต๋๋ค.
์ต์ ์ ๋ณด
์ด๋ฏธ ๊ธฐ๋ฅ์์ ์ธ์ฑ์ ํ์ฑํํ๊ณ ํจํค์ง๋ฅผ 2.4.0์ผ๋ก ๋ค์ด ๊ทธ๋ ์ด๋ํ์ง๋ง ์ฌ์ ํ ๋์ผํ ๊ฒฐ๊ณผ๋ฅผ ์ป์๋์ง ํ์ธํ์ต๋๋ค. . ์ ํ์ ๊ฐ์ ธ์ฌ ์ ์์ผ๋ฉฐ ๋น ๋ฐฐ์ด ๋ง ๋ฐํํฉ๋๋ค.
๋ํ ๋ค๋ฅธ ๊ฒ์๋ฌผ์ด ๋ฐ์ ๋ค์ดํฐ๋ธ ๋งํฌ๋ฅผ ์ฌ์ฉํ์ง ๋ง๋ผ๊ณ ์ ์ํ์ง๋ง ์ฌ์ ํ ๋์ผํ ๊ฒฐ๊ณผ๋ฅผ ์ ์ํ๊ธฐ ๋๋ฌธ์ ํจํค์ง๋ฅผ ์๋์ผ๋ก ์ฐ๊ฒฐํ์ต๋๋ค. ์๋ฎฌ๋ ์ดํฐ์ ์ค์ ์ฅ์น๋ฅผ ๋ชจ๋ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
์ฃ์กํฉ๋๋ค. ์ด์ ์ ๋ฆฌ๋์์ต๋๋ค. ๋ฌธ์ ๋ xcode์ ๋ฒ๋ค ID์์ต๋๋ค. ์๋ชป๋ ๋ฒ๋ค ID๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค. ์ด์ ๋ชจ๋ ์๋ํฉ๋๋ค.
์ ๋ ๋น์ทํ๊ณ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ฐ๊ฒฐ ๊ณผ์ ์ ์๋์ผ๋กํด์ผํ์ต๋๋ค. (ios)
๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ณ Itunes Connect์์ ์ ํ์๋ก๋ํ์ง ์๊ณ ์ด๋์ ๋ฌธ์ ๋ฅผ ์ฐพ์์ผํ ์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ์ฑ์ด ์ด์ ๋ฒ์ ์ RN : 0.43.4๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค. RN-IAP ๋ฒ์ 3.3.7 ๋ฐ 2.5.5๋ฅผ ์ฌ์ฉํด ๋ณด์์ต๋๋ค. ์ด์ ๋ฒ์ ์ React-Native๋ฅผ ์ฌ์ฉํ๊ณ ์๊ธฐ ๋๋ฌธ์ ์ด์ ๋ฒ์ ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํด์ผํฉ๋๊น?
์ค๋ฅ ๋ฉ์์ง๊ฐ์๊ณ ๋ฐ์ดํฐ๊ฐ ์์ด์ ํด๊ฒฐํ๊ธฐ ์ด๋ ค์ด ๋ฌธ์ ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
์ฃ์กํฉ๋๋ค. ์ด์ ์ ๋ฆฌ๋์์ต๋๋ค. ๋ฌธ์ ๋ xcode์ ๋ฒ๋ค ID์์ต๋๋ค. ์๋ชป๋ ๋ฒ๋ค ID๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค. ์ด์ ๋ชจ๋ ์๋ํฉ๋๋ค.
์๋ ํ์ธ์, @nateblog! ๋น์ทํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ์ ํ ๋ฐ ๊ตฌ๋ ์ ๋ํ ๋น ๋ฐฐ์ด์ด ํ์๋๊ณ App Store Connect ๋ด์ 2 ๊ฐ์ ๊ตฌ๋ ํญ๋ชฉ์ ๋ง๋ค์์ต๋๋ค. ๋ฒ๋ค ID์ ์ด๋ค ๋ฌธ์ ๊ฐ ์์๋์ง ์์ธํ ์ค๋ช ํด ์ฃผ์๊ฒ ์ต๋๊น? ์ฌ๋ฐ๋ฅธ ์ํ SKU๋ฅผ ์ ์ถ ํ ๊ฒ ๊ฐ์ง ์์ต๋๋ค. ์ด๋ป๊ฒ ๊ตฌ์ฑ๋์ด ์๋์ง ๋๋ ๋ฌด์์ธ์ง์ ๋ํ ์ฐธ์กฐ๋ฅผ ์ฐพ์ ์ ์๊ธฐ ๋๋ฌธ์ [Bundle Identifier]. [๊ตฌ๋งค ํญ๋ชฉ์ ProductId] ๋๋ [ProductId]๋ฟ์ ๋๋ค. ๊ตฌ๋งค ํญ๋ชฉ]?
๋ํ ๋ฆด๋ฆฌ์ค ๋ฐ ๋๋ฒ๊ทธ ์ฒด๊ณ์ ๋ํด ์ฝ๊ฐ ๋ค๋ฅธ ๋ฒ๋ค ์๋ณ์๊ฐ ์์์ ์ถ๊ฐํ๊ณ ์ถ์ต๋๋ค.
์ด๋ค ์กฐ์ธ์ด๋ผ๋ ๋๋จํ ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.
์ ๋ ๋น์ทํ๊ณ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ฐ๊ฒฐ ๊ณผ์ ์ ์๋์ผ๋กํด์ผํ์ต๋๋ค. (ios)
๋น์ ์ ๋ด ํ๋ฃจ๋ฅผ ๊ตฌํ์ต๋๋ค!
react-native-iap์ ํตํฉํ๊ณ ์๋ช ๋ APK๋ฅผ Play ์คํ ์ด์ ๋ฒ ํ ๋ฆด๋ฆฌ์ค์ ์ ๋ก๋ํ๊ณ ํ๋์ ๊ตฌ๋ ํ๋๋ ์ถ๊ฐํ์ต๋๋ค. ํญ์ ๋น ๋ฐฐ์ด์ ๋ฐํํ๋ ๋๋ฒ๊ทธ ๋ชจ๋์์ ๊ตฌ๋ ID๋ก ๊ตฌ๋ ๋ชฉ๋ก์ ๊ฐ์ ธ ์ค๋ ค๊ณ ํฉ๋๋ค. ์ค์ ๋ก ๋๋ฒ๊ทธ ๋ชจ๋์์ ๊ตฌ๋ ์ ํ ์คํธ ํ ์ ์์ต๋๊น?
@ShridharCodewave ๋๋ ๊ฐ์ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค. ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์๋์ง ์๋ ค์ฃผ์ญ์์ค.
๋ฐ์ ๋ค์ดํฐ๋ธ IAP : 3.3.2
Android Emulator์์ ๋์ผํ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค. ๋ฒ ํ ์ฑ๋์ Google Play ์คํ ์ด์ APK๋ฅผ ์ ๋ก๋ํ๊ณ ์ ํ์ ์ถ๊ฐํ์ต๋๋ค.
๋จผ์ ์ฐ๊ฒฐ ์ด๊ธฐํ ํ ์ ํ์ ๊ฐ์ ธ ์ค๋ ค๊ณ ํ์ง๋ง ์ฝ์์ ์๋ฌด๊ฒ๋ ํ์๋์ง ์์ต๋๋ค.
์ฌ๊ธฐ์ ๊ฒฐ๊ณผ๊ฐ ์์ต๋๋ค.
์ฌ๊ธฐ์ ์ค๋ฅ ์์
@ismetsezer Android ์ฉ ์ธ์ฑ ๊ฒฐ์ ์ ์ฒด๊ฐ ์๋ฎฌ๋ ์ดํฐ์์ ์๋ํ์ง ์์ต๋๋ค.
์๋ฎฌ๋ ์ดํฐ๋ฅผ ์ฌ์ฉํ์ฌ Google Play ๊ฒฐ์ ๋ฅผ ํ ์คํธ ํ ์ ์์ต๋๋ค. Google Play ๊ฒฐ์ ๋ฅผ ํ ์คํธํ๋ ค๋ฉด ๊ธฐ๊ธฐ์ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ค์นํด์ผํฉ๋๋ค.
https://developer.android.com/google/play/billing/billing_testing
์ด๋ฅผ ์ํด์๋ ์ค์ ์ฅ์น๊ฐ ํ์ํฉ๋๋ค.
iOS์์๋ ์๋ฎฌ๋ ์ดํฐ์์ ๊ตฌ๋ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ฌ ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ค์ ์ฅ์น๊ฐ ํ์ํ๊ธฐ ๋๋ฌธ์ ๊ตฌ์ ํ ์ ์์ต๋๋ค.
์์ ๋ค๋ฅธ ์ฝ๋ฉํธ : ๋ํ ์ง ํ์ธํ์ธ์ versionName
๋ฐ versionCode
์์ android/app/build.gradle
Google Play ์ฝ์์ ์
๋ก๋ ํ ๊ฒ๊ณผ ๋์ผํ๊ฑฐ๋ ๋ ๋๋ค.
๋ํ Android์ ์๋ก์ด ๊ฒํ ์ ์ฑ ์ผ๋ก ์ธํด ๋น ํ๋ก๋์ ํธ๋์ ํ์ฑ ๊ฒํ ๋ ์ฑ์ด ํ์ํฉ๋๋ค.
์ด์ ์๋ ๊ฒ์๋์ง ์์ "์ด์"๋ฒ์ ์ ์ ๋ก๋ํ์ฌ ์ฑ์ ํ ์คํธ ํ ์์์์ต๋๋ค. ์ด ๊ธฐ๋ฅ์ ๋ ์ด์ ์ง์๋์ง ์์ต๋๋ค. ๋์ ๋น๊ณต๊ฐ ๋๋ ๊ณต๊ฐ ํ ์คํธ ํธ๋์ ์ฑ์ ๊ฒ์ํด์ผํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ์ด์ ์ฑ์ด ๋ ์ด์ ์ง์๋์ง ์์์ ์ฐธ์กฐํ์ญ์์ค.
https://developer.android.com/google/play/billing/billing_testing
๋น๊ณต๊ฐ / ๊ณต๊ฐ ํ ์คํธ ํธ๋์ '๊ฒ์'๋ Google Play์ ์๋ก์ด ๊ฒํ ํ๋ก์ธ์ค๋ฅผ ๊ฑฐ์ณ์ผ ํจ์ ์๋ฏธํฉ๋๋ค. ์ ์ฑ์ ๊ฒฝ์ฐ ๋ฉฐ์น , ๊ธฐ์กด ์ฑ์ ๊ฒฝ์ฐ ๋ช ์๊ฐ์ด ๊ฑธ๋ฆด ์ ์์ต๋๋ค.
๋ด๊ฐ ํ ์ ํํ ๋จ๊ณ๋ ๋ชจ๋ฅด์ง๋ง Android ๊ธฐ๊ธฐ์์ ๋ก์ปฌ๋ก ์์ ํ๊ณ ์์ต๋๋ค. ๋ฐ๋ผ์ ์๋ง๋ react-native-iap ํจํค์ง ๋ฌธ์ ๊ฐ ์๋๋ผ ๊ตฌ์ฑ ๋ฌธ์ ์ผ ๊ฒ์ ๋๋ค.
๋๊ตฐ๊ฐ ์์ ๋ด์ฉ์ ํ์ธํ ์ ์๋ค๋ฉด์ด ๋ณ๊ฒฝ ์ฌํญ์ ๋ํ README๋ฅผ ์ ๋ฐ์ดํธํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ์ด๊ฒ์ ์ง๋๋ฌ๋ถํฐ ์๋ก์ด ๊ฒ์ ๋๋ค.
์ค์ ์ฅ์น๋ก ์ ํํ์ ๋ @jvandenaardweg ์๊ฒ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ์ ์๋ํ๊ณ ์ฐ๊ฒฐ์ด ์ฑ๊ณตํ์ง๋ง
@ismetsezer ๋ฅผ ๋ฃ๊ณ
๋ฌผ๋ก . Google Play ์คํ ์ด์์ ๊ฒ์ ํ ํ ์ฌ๊ธฐ์์ ํ์ธํ๊ฒ ์ต๋๋ค.
์ต์ ์ ๋ณด
๋ด ์ฑ์ด Google Play ์คํ ์ด์ ๊ฒ์ ๋ ํ ๊ตฌ๋งค๊ฐ ์ด๋ฃจ์ด์ง๊ณ ์๋ํ์ต๋๋ค. ์น์ธํ๋ ๋ฐ 3 ์ผ์ด ๊ฑธ๋ฆฝ๋๋ค. @jvandenaardweg ๋๋ถ์
์ ๋ฐ์ดํธ 2
react-native-iap๋ ์๋ฎฌ๋ ์ดํฐ๊ฐ Google Play ์คํ ์ด๋ฅผ ์ง์ํ๋ ๊ฒฝ์ฐ android emulator์์ ์๋ ํ ์ ์์ต๋๋ค.
@kesepara Play ์คํ ์ด์ ์ ๊ตฌ๋ ์๊ธ์ ๋ฅผ ์ถ๊ฐ ํ ํ ๊ธฐ๊ธฐ์ ํ์ ๋๋ ค๋ฉด ๋ช ์๊ฐ์ ๊ธฐ๋ค๋ ค์ผํ์ต๋๋ค.
@ismetsezer ๋ฐ @kesepara ์๋
ํ์ธ์.
์์ง ๋ช
ํํ์ง ์์ ๊ฒ์ด ์์ผ๋ฏ๋ก ๊ฐ๋ฐ ํ๋ฆ์ ๋ํ ๊ทํ์ ์๊ฒฌ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
iOS ์ฉ RN IAP๋ฅผ ์ค์ ํ์ผ๋ฉฐ ์ด์ ์ ์์ ์ผ๋ก ์๋ํฉ๋๋ค.
์ง๊ธ์ ์๋๋ก์ด๋ ๋ถ๋ถ์ ์์ ํ์ด, ๋ด๊ฐ ๋ฐ๊ฒฌํ์ต๋๋ค ์ฌ๊ธฐ์ ์ฐ๋ฆฌ๊ฐ ์๋ช
ํ APK ํ
์คํธ ์ง๋ถ ๊ธฐ๋ฅ์ ํ ์ ์๋๋ก (์ ์ด๋) ๋ซํ ๊ถค๋์ ์
๋ก๋ ์ฌ์ฉํ ํ์๊ฐ์๋ค.
๊ทธ๋ฌ๋ ๊ทํ์ ์๊ฒฌ์์ Android ์๋ฎฌ๋ ์ดํฐ์์ ํ
์คํธ ํ ์ ์์๋ค๊ณ ๋ง์ํ์
จ์ต๋๋ค. ๋ง์ต๋๊น?
๋ํ ์คํ ์ด์์ ์๋ช
๋ APK๋ฅผ ์ฌ์ฉํด์ผํ๋ ๊ฒฝ์ฐ ์ด๋ป๊ฒ ๋๋ฒ๊น
ํ ์ ์์ต๋๊น?
๊ทํ์ ๋์์ ๋๋จํ ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.
์๋ ํ์ธ์ @beeremy ๊ทํ์ ์ข์ ์๊ฒฌ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. ์ ํ์ ๊ฐ์ ธ ์ค๋ ค๋ฉด Google Play๋ฅผ ์ง์ํ๋ ์ค์ ์ฅ์น ๋๋ ์๋ฎฌ๋ ์ดํฐ์์ iap์ ํ ์คํธํด์ผํฉ๋๋ค. IAP๋ Google Play ์คํ ์ด์ ์ฑ์ ๊ฒ์ ํ ํ ์๋ํ์ต๋๋ค. ๋ณ๊ฒฝ ๋ ์ ์์ง๋ง ์ ์ด๋์ด ๊ธฐ๋ฅ์ ํ ์คํธํ๋ ค๋ฉด ์คํ ์ด์ ์ด์์ ์ ๋ก๋ํ๊ฑฐ๋ ์ ๊ณตํด์ผํฉ๋๋ค. ํ์ง๋ง ์ผํ๋ ๋ฐ 2 โโ~ 3 ์๊ฐ์ด ๊ฑธ๋ฆฝ๋๋ค.
์๋ ํ์ธ์ @ismetsezer , ํผ๋๋ฐฑ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
์ ์ฉ ํ ์์๋ ์ฌ๋์ ์ํด https://stackoverflow.com/questions/36113347/is-it-possible-to-debug-locally-google-plays๋ฅผ ๋ฐ๋ฅธ ํ ๋๋ฒ๊ทธ ๊ตฌ์ฑ์ ์คํํ ์์์์ต๋๋ค.
@ismetsezer ๋ก ๊ตฌ๊ธ ํ๋ ์ด ์ฝ์์ ์ฑ์ด ๊ฒ์ ๋ ํ ์๋๋ก์ด๋์์ ๊ตฌ๋ ๋ฐ ์ ํ์ด ์๋ํ๋ค๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค. ์ฑ์ด ์์ง ๊ฒ์๋์ง ์์ ์ํ์์ ๊ตฌ๋ / ์ ํ์ ๋ฐ์ผ๋ ค๋ ์๋๋ Android์์ ์๋ํ์ง ์์ต๋๋ค.
iOS์์ ๊ตฌ๋ ๋ฐ ์ ํ์ ์ฑ์ ๊ฒ์ํ์ง ์๊ณ ๋ ์๋ํฉ๋๋ค.
์๋ ํ์ธ์. ์ต๊ทผ์ด ๋ฌธ์ ์ ๋ํ ํ๋์ด์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฌธ์ ๊ฐ ํด๊ฒฐ ๋์์ต๋๊น? ์๋๋ฉด ์ฌ์ ํ ์ปค๋ฎค๋ํฐ์์ฃผ์๊ฐ ํ์ํฉ๋๊น? ์ด ๋ฌธ์ ๋ ๋ ์ด์ ํ๋์ด ๋ฐ์ํ์ง ์์ผ๋ฉด ์ข ๊ฒฐ ๋ ์ ์์ต๋๋ค. ์ด ๋ฌธ์ ๋ฅผ "ํ ๋ก ์ฉ"๋๋ "์ข์ ์ฒซ ๋ฒ์งธ ๋ฌธ์ "๋ก ํ์ ํ ์๋ ์์ผ๋ฉฐ ์ด์ด ๋๊ฒ ์ต๋๋ค. ๊ทํ์ ๊ธฐ์ฌ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
์ฌ๊ธฐ Android dev์ RN 0.59.1์ด๊ณ iap ๋ฒ์ 4.4.1์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
๋ด ๋น๋๋ ํ์ฌ ์ํ ํธ๋์ ์์ต๋๋ค. ๊ทธ ํ , ๋๋ฒ๊ทธ ๋ชจ๋๋ก ๋ด ์ปดํจํฐ์์ ํ์์ ๊ฐ์ด ๋ค์ ๋น๋ํ์ต๋๋ค. Platform.select ({}) ๋ด์์ Play Console์์๋ ๊ตฌ๋ ID๋ฅผ ์ง์ ํ๊ณ getSubscriptions ()๋ฅผ ํธ์ถํ์ง๋ง ๋น ๋ฐฐ์ด์ด ์์ ๋ฉ๋๋ค. ์ํ์ด๊ธฐ ๋๋ฌธ์ธ๊ฐ์? ์ด๋ค ์์ด๋์ด?
@edgaralienfoe Google Play Console์์ ๊ตฌ๋ ์ ํ์ฑํํ์ จ์ต๋๊น?
@acostalima ํ์ฑํํด์ผํฉ๋๋ค. ๊ทธ๋ ๊ฒํ๋ ๋ฐ ๋ฉฐ์น ์ด ๊ฑธ๋ฆด ๊ฒ์ด๋ผ๊ณ ์๊ฐํ์ง๋ง ์ฌ์ ํ ์ด์ด ์์ต๋๋ค.
@edgaralienfoe Google Play Console์์ ๊ตฌ๋ ์ ๋ช ์ ์ ์ผ๋ก ํ์ฑํํ๋ ์ต์ ์ด ์์ผ๋ฉฐ ํ์ฑํ๋์ง ์์ ๊ฒฝ์ฐ ๊ตฌ๋ ์ด ์ฑ์ ํ์๋์ง ์๊ธฐ ๋๋ฌธ์ ์์ฒญํฉ๋๋ค. ๊ทธ๋ฌ๋ ๊ทธ๋ ๊ฒ ๋งํ๋ฉด ๋ค๋ฅธ ๋ฌธ์ ๊ฐ์์ ์ ์์ต๋๋ค.
@edgaralienfoe ํด๊ฒฐ์ฑ ์ ์ฐพ์์ต๋๊น? ์ฑ ๋ฒ์ ์ด Alpha ํธ๋์ ๋ฒ์ ๋ณด๋ค ๋์์ผ ํ ์ ์์ต๋๋ค.
@edgaralienfoe ํด๊ฒฐ์ฑ ์ ์ฐพ์์ต๋๊น? ์ฑ ๋ฒ์ ์ด Alpha ํธ๋์ ๋ฒ์ ๋ณด๋ค ๋์์ผ ํ ์ ์์ต๋๋ค.
์ํ ํธ๋์ ์ ์๋ํฉ๋๋ค. ์ ๋ ๋ฌธ์ ์์ด Alpha์ ๋ฐฐํฌ ๋ ๋น๋๋ฅผ ์ฌ์ฉํ์ฌ ๊ฝค ์ค๋ซ๋์ IAP๋ฅผ ํ ์คํธ ํด ์์ต๋๋ค. ๋ฐ๋ฉด ๋ด๋ถ ํธ๋์ ์๋ํ์ง ์์ต๋๋ค.
์ฌ๊ธฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์์๋ ๋ชจ๋ ์ฌ๋๋ค์ ์ํด iOS์์ ํธ๋ฆญ์ @ Kuhne1์ด ์ ์ํ๋๋ก ํ๋ก์ ํธ๋ฅผ ์๋์ผ๋ก ์ฐ๊ฒฐํ๋ ๊ฒ์ด ์์ต๋๋ค. ๋น๋ ํด๋๋ฅผ ์ ๋ฆฌํ๊ณ Pod๋ฅผ ์๋์ผ๋ก ์ค์น ํ ํ์๋ ์๋ํ์ต๋๋ค. ๋๊ตฌ์๊ฒ๋ ์ ์ฉํ๊ธฐ๋ฅผ ๋ฐ๋๋๋ค!
์๋ ํ์ธ์. ์ต๊ทผ์ด ๋ฌธ์ ์ ๋ํ ํ๋์ด์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฌธ์ ๊ฐ ํด๊ฒฐ ๋์์ต๋๊น? ์๋๋ฉด ์ฌ์ ํ ์ปค๋ฎค๋ํฐ์์ฃผ์๊ฐ ํ์ํฉ๋๊น? ์ด ๋ฌธ์ ๋ ๋ ์ด์ ํ๋์ด ๋ฐ์ํ์ง ์์ผ๋ฉด ์ข ๊ฒฐ ๋ ์ ์์ต๋๋ค. ์ด ๋ฌธ์ ๋ฅผ "ํ ๋ก ์ฉ"๋๋ "์ข์ ์ฒซ ๋ฒ์งธ ๋ฌธ์ "๋ก ํ์ ํ ์๋ ์์ผ๋ฉฐ ์ด์ด ๋๊ฒ ์ต๋๋ค. ๊ทํ์ ๊ธฐ์ฌ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
์ฅ๊ธฐ๊ฐ ์ฌ์ฉํ์ง ์์ผ๋ฉด์ด ๋ฌธ์ ๋ฅผ ์ข ๋ฃํฉ๋๋ค. ์ด ๋ฌธ์ ๊ฐ ์ต์ ๋ฆด๋ฆฌ์ค์ ์ฌ์ ํ ์กด์ฌํ๋ ๊ฒฝ์ฐ ์ต์ ์ ๋ณด๋ก ์ ๋ฌธ์ ๋ฅผ ์์ ๋กญ๊ฒ ์์ฑํ์ญ์์ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ฌผ๋ก . Google Play ์คํ ์ด์์ ๊ฒ์ ํ ํ ์ฌ๊ธฐ์์ ํ์ธํ๊ฒ ์ต๋๋ค.
์ต์ ์ ๋ณด
์ ๋ฐ์ดํธ 2