Skip to content

Commit b0ac06c

Browse files
1 parent 356624f commit b0ac06c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
## Changelogs
2+
3+
- **[4.0.7]**
4+
- Correctly fix `andDangerouslyFinishTransactionAutomatically` default to `true`.
25
- **[4.0.5]**
36
- Resolve [#788](https://github.com/dooboolab/react-native-iap/issues/788)
47
- **[4.0.4]**

index.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,18 @@ export const requestPurchase = (
283283
ios: async () => {
284284
andDangerouslyFinishTransactionAutomaticallyIOS =
285285
andDangerouslyFinishTransactionAutomaticallyIOS === undefined
286-
? false
286+
? true
287287
: andDangerouslyFinishTransactionAutomaticallyIOS;
288288
if (andDangerouslyFinishTransactionAutomaticallyIOS) {
289289
console.warn(
290290
'You are dangerously allowing react-native-iap to finish your transaction automatically. You should set andDangerouslyFinishTransactionAutomatically to false when calling requestPurchase and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.',
291291
);
292292
}
293293
checkNativeiOSAvailable();
294-
return RNIapIos.buyProduct(sku, andDangerouslyFinishTransactionAutomaticallyIOS);
294+
return RNIapIos.buyProduct(
295+
sku,
296+
andDangerouslyFinishTransactionAutomaticallyIOS,
297+
);
295298
},
296299
android: async () => {
297300
checkNativeAndroidAvailable();
@@ -328,15 +331,18 @@ export const requestSubscription = (
328331
ios: async () => {
329332
andDangerouslyFinishTransactionAutomaticallyIOS =
330333
andDangerouslyFinishTransactionAutomaticallyIOS === undefined
331-
? false
334+
? true
332335
: andDangerouslyFinishTransactionAutomaticallyIOS;
333336
if (andDangerouslyFinishTransactionAutomaticallyIOS) {
334337
console.warn(
335338
'You are dangerously allowing react-native-iap to finish your transaction automatically. You should set andDangerouslyFinishTransactionAutomatically to false when calling requestPurchase and call finishTransaction manually when you have delivered the purchased goods to the user. It defaults to true to provide backwards compatibility. Will default to false in version 4.0.0.',
336339
);
337340
}
338341
checkNativeiOSAvailable();
339-
return RNIapIos.buyProduct(sku, andDangerouslyFinishTransactionAutomaticallyIOS);
342+
return RNIapIos.buyProduct(
343+
sku,
344+
andDangerouslyFinishTransactionAutomaticallyIOS,
345+
);
340346
},
341347
android: async () => {
342348
checkNativeAndroidAvailable();

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-iap",
3-
"version": "4.0.5",
3+
"version": "4.0.7",
44
"description": "React Native In App Purchase Module.",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)