"react-native-iap": "^2.0.3",
iOS
๊ตฌ๋งค
const ๊ตฌ๋งค = ๋๊ธฐ RNIap.buyProductWithoutFinishTransaction (productId)
const {transactionReceipt, purchaseToken} = ๊ตฌ๋งค
sendToServer (transactionReceipt, {
onSuccess : () => {
RNIap.finishTransaction ()
RNIap.consumeAllItems ()
}})
๋ํ ์์ :โ์ด ์ธ์ฑ ๊ตฌ๋งค๋ ์ด๋ฏธ ๊ตฌ๋งค๋์์ต๋๋ค.โ. ์ด๊ฒ์ ํ๋์ SKU์์๋ง ๋ฐ์ํ๊ณ ๋ค๋ฅธ SKU๋ ์ ์์ ์ผ๋ก ์๋ํฉ๋๋ค. ๋๋ ์ฑ์ด ๋์ ์ํ์ ์๋ค๊ณ ์๊ฐํ๊ณ ๊ทธ๊ฒ์ ๊ณ ์น ๋ฐฉ๋ฒ์ ์ฐพ์ง ๋ชปํ์ต๋๋ค. ์ด๊ธฐํ์ finishTransaction
๋ฐ consumeAllItems
ํธ์ถ์ ์ง ์ณค์ง ๋ง ๋ฌธ์ ๊ฐ ํด๊ฒฐ๋์ง ์์์ต๋๋ค. ๋ค๋ฅธ SKU๋ ๋ฌธ์ ์์ด ์ฌ๋ฌ ๋ฒ ๊ตฌ๋งคํ ์ ์์ต๋๋ค. getPurchaseHistory
๋ํด์๋ ์๋ฌด๊ฒ๋ ๋ฐํ๋์ง ์์ต๋๋ค.
์ฅ์น (์๋ ๋ฐ์ค)
์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
@siderakis ๊ทธ๋ ์ด์ํด. ๋๋ ์ด๋ฏธ stackoverflow ์์ ๋งํ ๊ฒ์ฒ๋ผ์ด ๋ฌธ์ ๋ฅผ ํจ์นํ์ง๋ง ์ผ๋ถ ์ฅ์น์์ ์ฌ์ ํ ๋ฐ์ํฉ๋๋ค. ๋๋ ์ด๊ฒ๋ ๊ธฐ๊บผ์ด ๊ณ ์น ๊ฒ์ ๋๋ค. ์ด๋ค ์ฅ์น๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๊น?
@siderakis ์ด๊ฒ์ ๋ด๊ฐ ์๊ฐํ๊ธฐ์ ๋์ ์ํ์์ ์ฑ์ ํด๊ฒฐํ ์ ์์ต๋๋ค. ์๋ํด ์ฃผ์๊ฒ ์ต๋๊น?
๋๋ ๊ทธ๊ฒ์ ์๋ํ์ง๋ง ์๋ํ์ง ์์์ต๋๋ค. ๋ํ ์ฑ์ ๋ค์ ์ค์นํ์ง๋ง ๋์์ด๋์ง ์์์ต๋๋ค. iPad์์ ์คํ ์ค์ ๋๋ค.
์ค๋จ ์ ์ ์ค์ ํ๋๋ฐ currentQueue.transactions๊ฐ ๋น์ด์๋ ๊ฒ์ฒ๋ผ ๋ณด์ ๋๋ค.
SKPaymentQueue.h์์
// Array of unfinished SKPaymentTransactions. Only valid while the queue has observers. Updated asynchronously.
@property(nonatomic, readonly) NSArray<SKPaymentTransaction *> *transactions NS_AVAILABLE_IOS(3_0);
<strong i="6">@end</strong>
๋ด๊ฐ ๋๋ฌด ๋นจ๋ฆฌ ๋ถ๋ ๋๋ด
๋์ค์ ํ๋ก๊ทธ๋จ ์คํ์์ ์ฝ๋๋ฅผ ํธ์ถํ์ฌ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
@siderakis ๊ท์ฐฎ๊ฒ
transactions
๋ฐฐ์ด์ ์ฐ๋ฆฌ ์ฝ๋์์๋ ๋ฉ์๋๊ฐ ์๋๋ผ ์์ฑ์
๋๋ค.
finishTransaction
์ฐพ์ผ์
จ์ต๋๊น?
์ด ๋ค์ดํฐ๋ธ ์ฝ๋๋ฅผ ํธ์ถ
didFinishLaunchingWithOptions
currentQueue.transactions์์ ํธ์ถํ์ ๋ currentQueue.transactions๊ฐ ๋น์ด ์์ง๋ง applicationDidBecomeActive์์ ํธ์ถํ๋ฉด ์๋ํ์ต๋๋ค.
์ด๊ฒ์ ์๋ํ์ต๋๋ค.
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// take current payment queue
SKPaymentQueue* currentQueue = [SKPaymentQueue defaultQueue];
[currentQueue restoreCompletedTransactions];
// finish ALL transactions in queue
// [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
[currentQueue.transactions enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[currentQueue finishTransaction:(SKPaymentTransaction *)obj];
}];
}
์ด๋ป๊ฒํด์ผํ ์ง ๋ชจ๋ฅด๊ฒ ์ง๋ง์ด ๊ธฐ๋ฅ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ ธ์ถ ํ ์ ์์๊น์?
@siderakis ์. ๊ทธ๊ฒ์ด ์ ๊ฐ 259 ํธ์์ ์๋ฏธ ํ ๋ฐ์
๋๋ค.
๋๋ applicationDidBecomeActive ์ดํ ์ด๋์์๋ ํ๋์ด ๋ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
๊ทธ๋์์ด ๋ฉ์๋๋ฅผ JS ์ธก์ ๋
ธ์ถ์์ผ ์ฌ์ฉ์๊ฐ ์ธ์ ๋ ์ง ํธ์ถ ํ ์ ์์ต๋๋ค.
์กฐ์ธ ๊ฐ์ฌํฉ๋๋ค.
@JJMoon , ๋๋ ๋์ผํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ์์์ ์ธ๊ธ ํ ๋ฐฉ๋ฒ์ ๋ ธ์ถํ๋ ๋ฐ ๋ํ ํด๊ฒฐ์ฑ ์ ์ธ์ ๊ธฐ๋ํ ์ ์์ต๋๊น? ๊ฐ์ฌ.
@sivrihuseyin ๋ฌธ์ ๋ ํ์ฌ ์ ์๋ ค์ ธ ์์ต๋๋ค. ์ด๋ฒ ์ฃผ๋ง์ ํจ์น๋ฅผ ๋ง๋ค ๊ฒ์ ๋๋ค. ๋ชจ๋ ๋ฐํ์์๊ฒ ๊ฐ์ฌํฉ๋๋ค.
2.2.0
์์ ์์๋๋ ์๋ฃจ์
์ ์ถ์ํ์ต๋๋ค. readme๋ฅผ ๋ฐ๋ผ์ด ์ฝ๋ ์ค์ ์๋ํด ๋ณผ ์ ์์ต๋๊น?
์๋ ํ์ธ์ ํจ์ฐฌ,
์ ๋ณด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.
๋ฒ์ 2.2.0์ ์ค์นํ๊ณ ์ฝ๋๋ฅผ ์๋ํ์ต๋๋ค. ๋ถํํ๋
๋ฌธ์ ๋ ์์ง ํด๊ฒฐ๋์ง ์์์ต๋๋ค. * clearTransaction * ํจ์๋
์์ถ๋์์ต๋๋ค. reactNative ํ๊ฒฝ์๋ clearTransaction์ด ์์ต๋๋ค.
RNIap ๋ด๋ถ์ ๊ธฐ๋ฅ.
index.d.ts ํ์ผ์ ํ์ธํ์ง๋ง ๋ค์๊ณผ ๊ฐ์ ๊ธฐ๋ฅ์ ๋ณผ ์ ์์ต๋๋ค.
์ด๊ฒ์ clearTransaction. ํ์ผ.
๊ฐ์ฌํฉ๋๋ค.
ํ์ธ์ธ
2018 ๋
9 ์ 16 ์ผ ์ผ์์ผ ์คํ 2:25 ์ฅํจ์ฐฌ [email protected]
์ผ๋ค :
ํ์ # 257 https://github.com/dooboolab/react-native-iap/issues/257
a5f225d๋ฅผ ํตํด
https://github.com/dooboolab/react-native-iap/commit/a5f225d470af0a85417325d24357667e54aa7078
.โ
๋น์ ์ด ์ธ๊ธ ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ณ GitHub์์ ํ์ธํ์ธ์.
https://github.com/dooboolab/react-native-iap/issues/257#event-1848183078 ,
๋๋ ์ค๋ ๋ ์์๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AiH7bOp96EzsoX82UVxKHK2LkN7PNWVAks5ubjUogaJpZM4WmG_0
.
์๋ ํ์ธ์ ํจ์ฐฌ,
์๋ชป๋ ์ ๋ณด๋ก ์ฃ์กํฉ๋๋ค. ์์ ๋์์ต๋๋ค. ๋ฌธ์ ์์ต๋๋ค
๋ ์ด์.
์ ์ํ ์๋ต๊ณผ ํ๋ฅญํ ์๋ฃจ์ ์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค.
๊ฐ์ฌํฉ๋๋ค.
ํ์ธ์ธ
2018 ๋
9 ์ 16 ์ผ ์ผ์์ผ ์คํ 2:56 Huseyin Sivri [email protected]
์ผ๋ค :
์๋ ํ์ธ์ ํจ์ฐฌ,
์ ๋ณด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค.
๋ฒ์ 2.2.0์ ์ค์นํ๊ณ ์ฝ๋๋ฅผ ์๋ํ์ต๋๋ค. ๋ถํํ๋
๋ฌธ์ ๋ ์์ง ํด๊ฒฐ๋์ง ์์์ต๋๋ค. ํจ์ * clearTransaction *์ด
์์ถ๋์ง ์์์ต๋๋ค. reactNative ํ๊ฒฝ์๋ clearTransaction์ด ์์ต๋๋ค.
RNIap ๋ด๋ถ์ ๊ธฐ๋ฅ.index.d.ts ํ์ผ์ ํ์ธํ์ง๋ง ๋ค์๊ณผ ๊ฐ์ ๊ธฐ๋ฅ์ ๋ณผ ์ ์์ต๋๋ค.
์ด๊ฒ์ clearTransaction. ํ์ผ.๊ฐ์ฌํฉ๋๋ค.
ํ์ธ์ธ
2018 ๋ 9 ์ 16 ์ผ ์ผ์์ผ ์คํ 2:25 ์ฅํจ์ฐฌ [email protected]
์ผ๋ค :ํ์ # 257 https://github.com/dooboolab/react-native-iap/issues/257
a5f225d๋ฅผ ํตํด
https://github.com/dooboolab/react-native-iap/commit/a5f225d470af0a85417325d24357667e54aa7078
.โ
๋น์ ์ด ์ธ๊ธ ๋์๊ธฐ ๋๋ฌธ์ ์ด๊ฒ์ ๋ฐ๊ณ ์์ต๋๋ค.
์ด ์ด๋ฉ์ผ์ ์ง์ ๋ต์ฅํ๊ณ GitHub์์ ํ์ธํ์ธ์.
https://github.com/dooboolab/react-native-iap/issues/257#event-1848183078 ,
๋๋ ์ค๋ ๋ ์์๊ฑฐ
https://github.com/notifications/unsubscribe-auth/AiH7bOp96EzsoX82UVxKHK2LkN7PNWVAks5ubjUogaJpZM4WmG_0
.
๋ฒ์ 2.2.0์์๋ clearTransaction ํจ์๋ฅผ ์ ์ฉํ์ฌ ์์ ๋์์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค
์ซ๋ผ๋ฆฌ
v2์์ v3-5๋ก ์ ๊ทธ๋ ์ด๋ํ๋ ํฅํ Google ์ง์์๊ฒ ๋์์ด๋์๋ค๊ณ ์๊ฐํ์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด ๋ค์ดํฐ๋ธ ์ฝ๋๋ฅผ ํธ์ถ
didFinishLaunchingWithOptions
currentQueue.transactions์์ ํธ์ถํ์ ๋ currentQueue.transactions๊ฐ ๋น์ด ์์ง๋ง applicationDidBecomeActive์์ ํธ์ถํ๋ฉด ์๋ํ์ต๋๋ค.์ด๊ฒ์ ์๋ํ์ต๋๋ค.
์ด๋ป๊ฒํด์ผํ ์ง ๋ชจ๋ฅด๊ฒ ์ง๋ง์ด ๊ธฐ๋ฅ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ ธ์ถ ํ ์ ์์๊น์?