0.3.15
κΈ°κ³μ μΈμ‘° μΈκ°
λͺ¨λ μ ν λ°κΈ°
λͺ¨λ iOSμμ μ μλνμ§λ§ getProductsλ νμ Androidμμ λΉ λ°°μ΄μ λ°νν©λλ€.
κ΅¬μ± λ¬Έμ λΌκ³ μκ°νμ§λ§ κ° λ¨κ³λ₯Ό λ°λμ΅λλ€ ...
κ²°μ κΆνμ΄μλ APK μ λ‘λ / ν맀μ κ³μ μ€μ / μ± λ΄ κ΅¬λ§€ μμ± ...
μ¬κΈ°μ κ°μ λ¬Έμ
λ΄ μ€ λν« :
RNIap.prepare().then(responsePrepare => {
console.log("=============>responsePrepare:" + responsePrepare);
RNIap.getProducts(itemSkus).then(response => {
this.setState({ items : response});
console.log("=============>response:" + JSON.stringify(response));
});
});
adb.logcat (Android)μ λν λ΄ μλ΅
208 28473 28524 I ReactNativeJS : appParams : { "rootTag": 11}λ₯Ό μ¬μ©νμ¬ "testingIap"μ ν리μΌμ΄μ
μ μ€ν μ€μ
λλ€. __DEV__ === true, κ°λ° μμ€ κ²½κ³ λ ON, μ±λ₯ μ΅μ νλ OFF
04-25 17 : 04 : 04.228 1140 1150 I AccountManagerService : getTypesVisibleToCaller : isPermitted? μ§μ€
04-25 17 : 04 : 04.230 1140 2059 I AccountManagerService : getTypesVisibleToCaller : isPermitted? μ§μ€
04-25 17 : 04 : 04.232 24842 24933 I Finsky : [4061] com.google.android.finsky.billing.iab.ab.b (46) : com.projectbundle : 첫 λ²μ§Έ κ³μ μ κ³μ -[uuAJBL1tLX2MAj69S-olEslXXXX]
04-25 17 : 04 : 04.233 28473 28473 D RNIapModule : κ²°μ ν΄λΌμ΄μΈνΈ μ€λΉ
04-25 17 : 04 : 04.303 28473 28524 I ReactNativeJS : =============> responsePrepare : null
04-25 17 : 04 : 04.308 28473 28524 I ReactNativeJS : =============> responsePrepare : null
04-25 17 : 04 : 04.328 1140 2107 I AccountManagerService : getTypesVisibleToCaller : isPermitted? μ§μ€
04-25 17 : 04 : 04.330 1140 1896 I AccountManagerService : getTypesVisibleToCaller : isPermitted? μ§μ€
04-25 17 : 04 : 04.339 1140 2095 I AccountManagerService : getTypesVisibleToCaller : isPermitted? μ§μ€
04-25 17 : 04 : 04.340 1140 1679 I AccountManagerService : getTypesVisibleToCaller : isPermitted? μ§μ€
04-25 17 : 04 : 04.343 24842 24854 I Finsky : [4020] com.google.android.finsky.billing.iab.ab.b (46) : com.projectbundle : 첫 λ²μ§Έ κ³μ μ κ³μ -[uuAJBL1tLX2MAj69S-olEslXXXX]
04-25 17 : 04 : 04.347 24842 24853 I Finsky : [4019] com.google.android.finsky.billing.iab.ab.b (46) : com.projectbundle : 첫 λ²μ§Έ κ³μ μ κ³μ -[uuAJBL1tLX2MAj69S-olEslXXXX]
04-25 17 : 04 : 04.626 28473 28525 D RNIapModule : responseCode : 0
04-25 17 : 04 : 04.628 28473 28525 D RNIapModule : responseCode : 0
04-25 17 : 04 : 04.669 28473 28524 I ReactNativeJS : =============> μλ΅ : []
04-25 17 : 04 : 04.693 28473 28524 I ReactNativeJS : =============> μλ΅ : []
κ·Έλ¬λ iOSμμλ λ°μ΄ν° νμμ΄ μ λ§λ λ°°μ΄μ μ»μ΅λλ€.
PD1 https://medium.com/@dooboolab/react -native-in-app-purchase-121622d26b67μμ μΆμ²μ λ°μμ΅λλ€.
PD2 "λΉμ μ΄ λμ μ μΌν ν¬λ§ μΈ μ€λΉμ μΌλ ΈλΉλ₯Ό λμμ£ΌμΈμ"
Package.json μ€ λν« :
"μ’
μμ±": {
"λ°μ": "16.3.1",
"λ°μ λ€μ΄ν°λΈ": "0.55.3",
"react-native-iap": "^ 0.3.18"
},
@vadermemo @martinberbesson μλ
νμΈμ ~ itemSkus
λν js μ½λλ₯Ό 곡μ ν΄ μ£Όμκ² μ΅λκΉ? μλ μ½λμ κ°μ΄ μ€μ νμ
¨λμ?
export const PURCHASE_ITEMS = Platform.select({
ios: [
'productid_1',
'productid_2',
],
android: [
'productid_1',
'productid_2',
],
});
λν μ΄μ μ± ν μ€νΈλ λ μ΄μ μ§μλμ§ μμ΅λλ€. κ°μ΄λλ₯Ό μ°Έμ‘°νμμμ€. μ±μ μν λλ λ² ν μ±λμ κ²μν΄μΌν©λλ€.
μλ νμΈμ @dooboolab
μ΄κ²μ λ΄ λ°μ΄ν°μ
λλ€
const itemSkus = Platform.select ({
ios : [
'com.iap.cart',
'com.iap.doublecoins'
],
android : [
'λλΈ',
'cart_1500'
],
});
μΉμ νλ
PD1 λ΄ μ±μ μν λ²μ μΈλ° μ νμλ°μ§ λͺ»ν©λλ€.
PD2 react-native-billingκ³Ό κ°μ λ€λ₯Έ npmμ μ¬μ©νλ©΄ μ νμ μ»μ μ μμ΅λλ€.
@vadermemo μ΄κ²μ λμκ² μ λ§ λμ souds .. μ£μ‘ν©λλ€. λ΄ νκ²½μμ μ μλν©λλ€. λλ λ λ§μ tommorowλ₯Ό λλ²κ·Ένκ³ λ°λμ tommorowλ‘ λμκ° κ²μ λλ€! λν μ§μ μ ν¬μ°©νκ³ κ±°κΈ°μ 무μμ΄ λνλλμ§ λ³Ό μ μμ΅λκΉ?
μν 릴리μ€κ° νμν κ² κ°μμ ... κ²°μ κΆνμ΄μλ APKλ₯Ό μ λ‘λνλ κ²λ§μΌλ‘λ μΆ©λΆνμ§ μμ΅λλ€
@dooboolab κΈμ, λΉμ μκ² λμμ΄λλ κ²μ΄ μλ€λ©΄ μλ§λ λ€μ μμ μ λλ€.
react-native-billingμ ꡬμ±μ λ£μ λ 리μμ€ νμΌ "string.xml"μ param string name = "RNB_GOOGLE_PLAY_LICENSE_KEY"λ₯Ό λ£μμ΅λλ€.
νμ§λ§ react-native-iapμμλμ΄ λ§€κ° λ³μκ° μλνλ κ²μ λ³Ό μ μμ΅λλ€.
νμν try-catchλ λ€μ λ‘κ·Έλ₯Ό μμ±ν©λλ€.
const itemSkus = Platform.select ({
ios : [
'predictorcart_1500',
],
android : [
'predictorcart_1500',
'android.test.purchased',
'android.test.canceled',
'android.test.refunded',
'android.test.item_unavailable',
],
});
componentDidMount λ³κ²½
λΉλκΈ° componentDidMount () {
{
κΈ°λ€λ¦¬κ³ RNIap.prepare ();
await this.getItems ();
}
catch (err) {
console.warn (err.code, err.message);
}
}
κ°μ Έ μ€κΈ° λ°μ΄ν° λ³κ²½
getProductDetails = async () => {
{
const μ ν = await RNIap.getProducts (itemSkus);
console.log ( '=======> μ ν ::::', μ ν);
this.setState ({productDetails : products});
} catch (err) {
console.warn (err.code, err.message);
}
}
λ²νΌμ λ£μ΄
\
κΈ°κΈ°μ μ± λ£κΈ°
λ°μ λ€μ΄ν°λΈ μ€ν μλλ‘μ΄λ --variant = release
6. λ§μ§λ§μΌλ‘ λ‘κ·Έλ λ€μμ
λλ€.
04-26 12 : 53 : 11.335 16749 16759 I Finsky : [11707] com.google.android.finsky.billing.iab.ab.b (46) : com.projectbundle : 첫 λ²μ§Έ κ³μ μ κ³μ -[uuAJBL1tLX2MAj69S-olEl331212]
04-26 12 : 53 : 11.401 226 1177 V audio_hw_primary : do_output_standby in
04-26 12 : 53 : 11.409 20362 20432 D RNIapModule : responseCode : 0
04-26 12 : 53 : 11.426 226 1177 W audio_hw_primary : do_output_standby.mode : 0
04-26 12 : 53 : 11.426 226 1177 V audio_hw_primary : do_output_standby in out
04-26 12 : 53 : 11.427 1140 2106 D PowerManagerService : releaseWakeLockInternal : lock = 87714678 [AudioMix], νλκ·Έ = 0x0, total_time = 3166ms
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : '=======> Products ::::', [{description : 'DescripciΓ³n de muestra para el producto : android.test.canceled.',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : μ λͺ© : 'TΓtulo de muestra',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : localizedPrice : '$ 18.65',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : μ ν : 'inapp',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : ν΅ν : 'MXN',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : κ°κ²© : '18 .65 ',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : productId : 'android.test.canceled'},
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : {description : 'DescripciΓ³n de muestra para el producto : android.test.item_unavailable.',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : μ λͺ© : 'TΓtulo de muestra',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : localizedPrice : '$ 18.65',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : μ ν : 'inapp',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : ν΅ν : 'MXN',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : κ°κ²© : '18 .65 ',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : productId : 'android.test.item_unavailable'},
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : {μ€λͺ
: 'DescripciΓ³n de muestra para el producto : android.test.purchased.',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : μ λͺ© : 'TΓtulo de muestra',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : localizedPrice : '$ 18.65',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : μ ν : 'inapp',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : ν΅ν : 'MXN',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : κ°κ²© : '18 .65 ',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : productId : 'android.test.purchased'},
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : {μ€λͺ
: 'DescripciΓ³n de muestra para el producto : android.test.refunded.',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : μ λͺ© : 'TΓtulo de muestra',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : localizedPrice : '$ 18.65',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : μ ν : 'inapp',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : ν΅ν : 'MXN',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : κ°κ²© : '18 .65 ',
04-26 12 : 53 : 11.444 20362 20431 I ReactNativeJS : productId : 'android.test.refunded'}]
@martinberbesson μν 릴리μ€μ μ±μ΄ μλλ° μ νμ μ»μ μ μμ΅λλ€. λ€λ₯Έ κ², μλ§λ react-native-iap λλ google μ½μμ ꡬμ±μ΄λΌκ³ μκ°ν©λλ€.
νΈμ λ΄μ κ°κΈ°
λμΌν λ¨κ³λ‘ λ€λ₯Έ μ±μ λ§λ€μκ³ μ±μ΄ iOS λ° Androidμμ μλν©λλ€ !!. λ―Ώμ μκ° μμ΄μ.
μ΄μ λ λͺ¨λ₯΄κ² μ§λ§ μ½λ λ Google μ½μμ ꡬμ±μ΄λΌκ³ μκ°ν©λλ€.
PD λλ μ νν itemSkusλ₯Ό μ»κΈ° μν΄ 5 μκ°μ κΈ°λ€λ Έλ€.
PD2 μ΄μ μ±μ 24 μκ° λμμλ itemsSkusλ₯Ό μ»μ§ λͺ»ν©λλ€.
PD3 @dooboolab μ΄μ μ‘°μ©ν μ μ μμ΅λλ€. :)
PD4 ꡬ맀 νλ‘μΈμ€λ₯Ό κ°λ°ν κ²μ
λλ€.
μΉμ νλ,
@vadermemo κ·Έκ²μ΄ μλνκ³ μλ€λ κ²μ κΈ°μκ² μκ°ν©λλ€. λν v3 μΈ Android μ© μ΅μ iap λͺ¨λμ κ²½μ° string.xml
λ€λ₯Έ νλͺ©μ λ£μ νμκ° μμ΅λλ€.
# 124μ λ°λΌ λλ μ΄κ²μ΄ μ¬μ ν λ°μνκ³ μλ€κ³ μκ°ν©λλ€-μ μ΄λ κΈ°μ‘΄ μ±μ κ²½μ°μλ μ΄κ²μ λν ν΄κ²°μ± μ΄ μμΌλ©΄ μ’μ κ²μ λλ€.
μ¬μ νμ΄ λ¬Έμ λ₯Ό κ²ͺκ³ μλ μ¬λμ΄λΌλ©΄ λ¨Όμ https://stackoverflow.com/a/35132936/1374827μ μ½κ³ ν΄λΉ κ²μλ¬Όμ μ€λͺ λ λͺ¨λ μꡬ μ¬νμ μΆ©μ‘±νλμ§ νμΈν΄μΌν©λλ€.
κ·Έ λͺ¨λ κ²μ΄ μ’λ€λ©΄ μ μ ν ν¨μλ₯Ό νΈμΆνκ³ μλμ§ νμΈνμμμ€. μ μκ²λ ꡬλ
μΈμ± ꡬ맀 λ§ μ¬μ©νλ μ±μ΄ μμμ§λ§ μ€μλ‘ RNIap.getProducts
νΈμΆνκ³ λ¬Όλ‘ λΉ λ°°μ΄μ λμ°Ύμμ΅λλ€. λμ RNIap.getSubscriptions
μ νν΄μΌνκ³ κ΅¬λ
μ΄ λ°νλμμ΅λλ€.
κ°μ λ§₯λ½μμ ꡬλ
μ ꡬ맀νλ κ²½μ° RNIap.buySubscription
, μ νμ ꡬ맀νλ κ²½μ° RNIap.buyProduct
ν΄μΌν©λλ€.
μ΄κ²μΌλ‘ λ μ¬λ§ ν ν λ΄ λ¬Έμ λ μλλ‘μ΄λμ λν κ²½νμ΄ μλ€λ κ²μ΄ λ°νμ‘μ΅λλ€. λλ devμμ ν¨ν€μ§ μ΄λ¦μ μλ§μΌλ‘ λ§λ€κ³ μ₯μΉμμ μ μ€νλλ λμ ν¨ν€μ§ μ΄λ¦μ΄ μλ²½νκ² μ€μ λμ§ μμ λΉ λ°°μ΄μ λ°ννμ΅λλ€. λ€μ ν λ€μ λ¨κ³ λ° μ΄λ€μ κ·Έκ²μ λͺ¨λ μ’μ μ°Ύκ³ μμ΅λλ€.
λλ λν λΉ λ°°μ΄μ μ»μ΅λλ€.
κ·Έλ¦¬κ³ https://developer.android.com/google/play/billing/billing_testing#draft_apps λ¬Έμμ νΌλλ©λλ€. ν
μ€νΈ κ³μ μ΄ νμνκ³ ν
μ€ν°λ₯Ό μΆκ°νλ―λ‘ λꡬλ μ§ λμ μ€ μ μμ΅λλ€.
κ°μ¬!
κ°μ
@bharatidudhjiya @tmjordan μ¬λ¬λΆμ΄ κ΅¬μ± λ¬Έμ μ μ§λ©΄νκ³ μλ€λ©΄, λ¨Όμ μμ μλλ‘μ΄λ iap
νλ‘μ νΈλ₯Ό μλν΄λ³΄κ³ μ λλ‘ μλνλμ§ νμΈνκ³ μΆμ΅λλ€. λν Androidμ iap
sdkλ₯Ό λ μ μ΄ν΄νλ λ° λμμ΄λ©λλ€.
@hyochan κ°μ¬ν©λλ€, μ’μ μκ°μ λλ€. λλ κ·Έλ κ² ν κ²μ΄λ€
@tmjordan μ΄κ²μ κ½€ μ€λλμμ§λ§ κΈ°λ³Έ μ€μ μ λμ μ΄ λ μ μμ΅λλ€.
κ³ λ§μμ @hyochan
λ΄κ° ν΄κ²° νμ΄! μ΄ λ²μ μ μ¬μ©νκ³ μμ΅λλ€.
react-native-iap: ^4.3.0
react-native: 0.60.5
κ·Έλ₯ μ΄λ κ² ν΄
const itemSkus = Platform.select({
ios: [
'100coins' // just remove bundle id from product id
],
android: [
'100coins' // just remove bundle id from product id
]
});
μ ν리μΌμ΄μ μ λν μ¬λ°λ₯Έ ν¨ν€μ§ μ΄λ¦μ΄ μλμ§ νμΈνμμμ€.
κ·Έλ¦¬κ³ react-native λͺ λ Ήμμ λ³κ²½ ν κ²½μ°. μ¬μ ν μλνμ§ μμ΅λλ€.
μλμΌλ‘ ν λ€μ android ν΄λμμ ./gradlew cleanμ μ¬μ©νμ¬ νλ‘μ νΈλ₯Ό μ 리ν΄μΌν©λλ€.
κ·Έ νμ κ·Έκ²μ μλνμμμ€.
ν΄νΌ μ½λ©.
κ°μ₯ μ μ©ν λκΈ
@vadermemo @martinberbesson μλ νμΈμ ~
itemSkus
λν js μ½λλ₯Ό 곡μ ν΄ μ£Όμκ² μ΅λκΉ? μλ μ½λμ κ°μ΄ μ€μ νμ ¨λμ?λν μ΄μ μ± ν μ€νΈλ λ μ΄μ μ§μλμ§ μμ΅λλ€. κ°μ΄λλ₯Ό μ°Έμ‘°νμμμ€. μ±μ μν λλ λ² ν μ±λμ κ²μν΄μΌν©λλ€.