expo-iap 1.0.3 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/.eslintrc.js +9 -0
  2. package/.prettierrc.js +9 -0
  3. package/.swiftlint.yml +10 -0
  4. package/README.md +28 -21
  5. package/android/build.gradle +34 -72
  6. package/android/src/main/AndroidManifest.xml +1 -4
  7. package/android/src/main/java/expo/modules/iap/ExpoIapModule.kt +535 -0
  8. package/android/src/main/java/expo/modules/iap/MissingCurrentActivityException.kt +6 -0
  9. package/android/src/main/java/expo/modules/iap/PlayUtils.kt +124 -0
  10. package/build/ExpoIap.types.d.ts +89 -0
  11. package/build/ExpoIap.types.d.ts.map +1 -0
  12. package/build/ExpoIap.types.js +59 -0
  13. package/build/ExpoIap.types.js.map +1 -0
  14. package/build/ExpoIapModule.d.ts +3 -0
  15. package/build/ExpoIapModule.d.ts.map +1 -0
  16. package/build/ExpoIapModule.js +5 -0
  17. package/build/ExpoIapModule.js.map +1 -0
  18. package/build/index.d.ts +38 -0
  19. package/build/index.d.ts.map +1 -0
  20. package/build/index.js +202 -0
  21. package/build/index.js.map +1 -0
  22. package/build/modules/android.d.ts +40 -0
  23. package/build/modules/android.d.ts.map +1 -0
  24. package/build/modules/android.js +54 -0
  25. package/build/modules/android.js.map +1 -0
  26. package/build/modules/ios.d.ts +41 -0
  27. package/build/modules/ios.d.ts.map +1 -0
  28. package/build/modules/ios.js +44 -0
  29. package/build/modules/ios.js.map +1 -0
  30. package/build/types/ExpoIapAndroid.types.d.ts +113 -0
  31. package/build/types/ExpoIapAndroid.types.d.ts.map +1 -0
  32. package/build/types/ExpoIapAndroid.types.js +23 -0
  33. package/build/types/ExpoIapAndroid.types.js.map +1 -0
  34. package/build/types/ExpoIapIos.types.d.ts +122 -0
  35. package/build/types/ExpoIapIos.types.d.ts.map +1 -0
  36. package/build/types/ExpoIapIos.types.js +2 -0
  37. package/build/types/ExpoIapIos.types.js.map +1 -0
  38. package/bun.lockb +0 -0
  39. package/expo-module.config.json +4 -8
  40. package/ios/ExpoIap.podspec +27 -0
  41. package/ios/ExpoIapModule.swift +498 -0
  42. package/ios/ProductStore.swift +27 -0
  43. package/ios/Types.swift +54 -0
  44. package/package.json +33 -62
  45. package/src/ExpoIap.types.ts +125 -0
  46. package/src/ExpoIapModule.ts +5 -0
  47. package/src/index.ts +397 -0
  48. package/src/modules/android.ts +89 -0
  49. package/src/modules/ios.ts +81 -0
  50. package/src/types/ExpoIapAndroid.types.ts +123 -0
  51. package/src/types/ExpoIapIos.types.ts +141 -0
  52. package/tsconfig.json +9 -0
  53. package/.editorconfig +0 -10
  54. package/.flowconfig +0 -11
  55. package/.monolinterrc +0 -3
  56. package/.yarn/install-state.gz +0 -0
  57. package/.yarn/releases/yarn-3.1.1.cjs +0 -768
  58. package/.yarnrc.yml +0 -3
  59. package/LICENSE +0 -21
  60. package/RNIap.podspec +0 -18
  61. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  62. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  63. package/android/gradle.properties +0 -2
  64. package/android/gradlew +0 -160
  65. package/android/gradlew.bat +0 -90
  66. package/android/libs/in-app-purchasing-2.0.76.jar +0 -0
  67. package/android/src/amazon/AndroidManifest.xml +0 -12
  68. package/android/src/amazon/java/com/dooboolab/RNIap/RNIapAmazonListener.kt +0 -356
  69. package/android/src/amazon/java/com/dooboolab/RNIap/RNIapAmazonModule.kt +0 -128
  70. package/android/src/amazon/java/com/dooboolab/RNIap/RNIapPackage.kt +0 -20
  71. package/android/src/main/java/com/dooboolab/RNIap/DoobooUtils.kt +0 -180
  72. package/android/src/play/java/com/dooboolab/RNIap/PlayUtils.kt +0 -77
  73. package/android/src/play/java/com/dooboolab/RNIap/RNIapModule.kt +0 -698
  74. package/android/src/play/java/com/dooboolab/RNIap/RNIapPackage.kt +0 -20
  75. package/babel.config.js +0 -10
  76. package/index.d.ts +0 -3
  77. package/index.js +0 -3
  78. package/index.js.flow +0 -9
  79. package/ios/RNIap.xcodeproj/project.pbxproj +0 -370
  80. package/ios/RNIap.xcodeproj/xcshareddata/xcschemes/RNIap.xcscheme +0 -80
  81. package/ios/RNIapIos.m +0 -60
  82. package/ios/RNIapIos.swift +0 -932
  83. package/ios/RNIapQueue.swift +0 -35
  84. package/jest.config.js +0 -194
  85. package/src/__test__/iap.test.d.ts +0 -1
  86. package/src/__test__/iap.test.js +0 -59
  87. package/src/hooks/useIAP.d.ts +0 -21
  88. package/src/hooks/useIAP.js +0 -140
  89. package/src/hooks/withIAPContext.d.ts +0 -21
  90. package/src/hooks/withIAPContext.js +0 -142
  91. package/src/iap.d.ts +0 -197
  92. package/src/iap.js +0 -625
  93. package/src/index.d.ts +0 -4
  94. package/src/index.js +0 -4
  95. package/src/types/amazon.d.ts +0 -23
  96. package/src/types/amazon.js +0 -1
  97. package/src/types/android.d.ts +0 -47
  98. package/src/types/android.js +0 -22
  99. package/src/types/apple.d.ts +0 -424
  100. package/src/types/apple.js +0 -165
  101. package/src/types/index.d.ts +0 -117
  102. package/src/types/index.js +0 -40
  103. package/test/mocks/react-native-modules.js +0 -14
package/.eslintrc.js ADDED
@@ -0,0 +1,9 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: ['expo', 'prettier'],
4
+ plugins: ['prettier'],
5
+ rules: {
6
+ 'eslint-comments/no-unlimited-disable': 0,
7
+ 'eslint-comments/no-unused-disable': 0,
8
+ },
9
+ };
package/.prettierrc.js ADDED
@@ -0,0 +1,9 @@
1
+ // prettier.config.js or .prettierrc.js
2
+ module.exports = {
3
+ trailingComma: 'all',
4
+ arrowParens: 'always',
5
+ singleQuote: true,
6
+ jsxSingleQuote: false,
7
+ bracketSpacing: false,
8
+ proseWrap: "never"
9
+ };
package/.swiftlint.yml ADDED
@@ -0,0 +1,10 @@
1
+ opt_in_rules:
2
+ - vertical_whitespace_between_cases
3
+ - vertical_whitespace_closing_braces
4
+ - vertical_whitespace_opening_braces
5
+ - vertical_parameter_alignment_on_call
6
+ - operator_usage_whitespace
7
+ - redundant_type_annotation
8
+
9
+ vertical_whitespace_closing_braces: true
10
+ vertical_whitespace_opening_braces: true
package/README.md CHANGED
@@ -1,32 +1,39 @@
1
- # ![image](https://user-images.githubusercontent.com/27461460/75094417-20321b00-55ce-11ea-8de7-a1df42a4b7df.png)
1
+ # expo-iap
2
2
 
3
- [![runs with expo](https://img.shields.io/badge/Runs%20with%20Expo-000.svg?style=flat&logo=EXPO&labelColor=ffffff&logoColor=000)](https://github.com/expo/expo)
4
- [![Version](http://img.shields.io/npm/v/expo-iap.svg?style=flat-square)](https://npmjs.org/package/expo-iap)
5
- <!-- [![Next](https://img.shields.io/npm/v/react-native-iap/next.svg?style=flat-square)](https://npmjs.org/package/react-native-iap) -->
6
- [![Download](http://img.shields.io/npm/dm/expo-iap.svg?style=flat-square)](https://npmjs.org/package/expo-iap)
7
- [![CI](https://github.com/dooboolab/react-native-iap/actions/workflows/ci.yml/badge.svg)](https://github.com/dooboolab/react-native-iap/actions/workflows/ci.yml)
8
- [![document](https://github.com/dooboolab/react-native-iap/actions/workflows/deploy-document.yml/badge.svg)](https://github.com/dooboolab/react-native-iap/actions/workflows/deploy-document.yml)
9
- [![License](https://img.shields.io/npm/l/react-native-iap.svg)](https://npmjs.org/package/expo-iap)
10
- [![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/dooboolab/expo-iap.svg)](https://github.com/dooboolab/react-native-iap)
11
- [![Issue Opened](https://img.shields.io/opencollective/all/react-native-iap.svg)](https://opencollective.com/react-native-iap#backers)
12
- [![Issue Opened](https://img.shields.io/github/issues/dooboolab/react-native-iap.svg)](https://github.com/dooboolab/react-native-iap/issues)
13
- [![Issue Closed](https://img.shields.io/github/issues-closed/dooboolab/react-native-iap.svg)](https://github.com/dooboolab/react-native-iap/issues?q=is%3Aissue+is%3Aclosed)
14
- [![PR Opened](https://img.shields.io/github/issues-pr/dooboolab/react-native-iap.svg)](https://github.com/dooboolab/react-native-iap/pulls)
15
- [![PR Closed](https://img.shields.io/github/issues-pr-closed/dooboolab/react-native-iap.svg)](https://github.com/dooboolab/react-native-iap/pulls?q=is%3Apr+is%3Aclosed) [![Greenkeeper badge](https://badges.greenkeeper.io/dooboolab/react-native-iap.svg)](https://greenkeeper.io/)
16
- [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdooboolab%2Freact-native-iap.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdooboolab%2Freact-native-iap?ref=badge_shield)
3
+ In App Purchase module in Expo
17
4
 
18
- ## Notice
5
+ # API documentation
19
6
 
20
- This package is forked from [react-native-iap](https://github.com/dooboolab/react-native-iap) which runs in `expo` environment. This also works in managed workflow.
7
+ - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/iap.md)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/iap/)
21
9
 
10
+ # Installation in managed Expo projects
22
11
 
23
- ## Installation
12
+ For [managed](https://docs.expo.dev/archive/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](#api-documentation). If you follow the link and there is no documentation available then this library is not yet usable within managed projects &mdash; it is likely to be included in an upcoming Expo SDK release.
24
13
 
14
+ # Installation in bare React Native projects
15
+
16
+ For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
17
+
18
+ ### Add the package to your npm dependencies
19
+
20
+ ```
21
+ npm install expo-iap
25
22
  ```
26
- yarn add expo-iap
23
+
24
+ ### Configure for iOS
25
+
26
+ Run `npx pod-install` after installing the npm package.
27
+ Sine we only support `StoreKit`, `deploymentTarget` should be `15.0`.
28
+
29
+ ```json
30
+ "ios": {
31
+ "deploymentTarget": "15.0"
32
+ },
27
33
  ```
28
34
 
29
- ## Documentation
35
+ ### Configure for Android
30
36
 
31
- Published in [website](https://react-native-iap.dooboolab.com).
37
+ # Contributing
32
38
 
39
+ Contributions are very welcome! Please refer to guidelines described in the [contributing guide]( https://github.com/expo/expo#contributing).
@@ -1,86 +1,48 @@
1
- buildscript {
2
- ext.DEFAULT_KOTLIN_VERSION = '1.5.10'
3
- ext.safeExtGet={prop, fallback->
4
- return rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5
- }
6
- repositories {
7
- google()
8
- mavenCentral()
9
- }
10
-
1
+ apply plugin: 'com.android.library'
11
2
 
12
- dependencies {
13
- classpath 'com.android.tools.build:gradle:4.2.2'
14
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion',DEFAULT_KOTLIN_VERSION)}"
3
+ group = 'expo.modules.iap'
4
+ version = '0.1.0'
5
+
6
+ def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
+ apply from: expoModulesCorePlugin
8
+ applyKotlinExpoModulesCorePlugin()
9
+ useCoreDependencies()
10
+ useExpoPublishing()
11
+
12
+ // If you want to use the managed Android SDK versions from expo-modules-core, set this to true.
13
+ // The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code.
14
+ // Most of the time, you may like to manage the Android SDK versions yourself.
15
+ def useManagedAndroidSdkVersions = false
16
+ if (useManagedAndroidSdkVersions) {
17
+ useDefaultAndroidSdkVersions()
18
+ } else {
19
+ buildscript {
20
+ // Simple helper that allows the root project to override versions declared by this library.
21
+ ext.safeExtGet = { prop, fallback ->
22
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
23
+ }
24
+ }
25
+ project.android {
26
+ compileSdkVersion safeExtGet("compileSdkVersion", 34)
27
+ defaultConfig {
28
+ minSdkVersion safeExtGet("minSdkVersion", 21)
29
+ targetSdkVersion safeExtGet("targetSdkVersion", 34)
30
+ }
15
31
  }
16
32
  }
17
33
 
18
- apply plugin: 'com.android.library'
19
- apply plugin: 'kotlin-android'
20
-
21
-
22
- def DEFAULT_COMPILE_SDK_VERSION = 30
23
- def DEFAULT_BUILD_TOOLS_VERSION = "30.0.2"
24
- def DEFAULT_MIN_SDK_VERSION = 16
25
- def DEFAULT_TARGET_SDK_VERSION = 30
26
- def DEFAULT_PLAY_SERVICES_VERSION = "17.6.0"
27
-
28
34
  android {
29
- compileSdkVersion safeExtGet("compileSdkVersion", DEFAULT_COMPILE_SDK_VERSION)
30
-
35
+ namespace "expo.modules.iap"
31
36
  defaultConfig {
32
- minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
33
- targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
34
- versionCode 3
35
- versionName "3.0.0"
37
+ versionCode 1
38
+ versionName "0.1.0"
36
39
  }
37
40
  lintOptions {
38
41
  abortOnError false
39
42
  }
40
- compileOptions {
41
- sourceCompatibility JavaVersion.VERSION_1_8
42
- targetCompatibility JavaVersion.VERSION_1_8
43
- }
44
- flavorDimensions "store"
45
- productFlavors {
46
- amazon{
47
- dimension "store"
48
- }
49
- play{
50
- dimension "store"
51
- }
52
- }
53
- }
54
-
55
- repositories {
56
- maven {
57
- // All of React Native (JS, Android binaries) is installed from npm
58
- url "$rootDir/../node_modules/react-native/android"
59
- }
60
- google()
61
- mavenCentral()
62
43
  }
63
44
 
64
45
  dependencies {
65
- implementation project(':expo-modules-core')
66
- playImplementation 'com.android.billingclient:billing:4.0.0'
67
- def playServicesVersion = safeExtGet('playServicesVersion', DEFAULT_PLAY_SERVICES_VERSION)
68
- playImplementation "com.google.android.gms:play-services-base:$playServicesVersion"
69
- amazonImplementation fileTree(dir: 'libs', include: ['*.jar'])
70
-
71
- def supportLibVersion = safeExtGet('supportLibVersion', safeExtGet('supportVersion', null))
72
- def androidXVersion = safeExtGet('androidXVersion', null)
73
- if (supportLibVersion && androidXVersion == null) {
74
- implementation "com.android.support:support-annotations:$supportLibVersion"
75
- implementation "com.android.support:customtabs:$supportLibVersion"
76
- } else {
77
- def defaultAndroidXVersion = "1.2.0"
78
- if (androidXVersion == null) {
79
- androidXVersion = defaultAndroidXVersion
80
- }
81
- def androidXAnnotation = safeExtGet('androidXAnnotation', androidXVersion)
82
- def androidXBrowser = safeExtGet('androidXBrowser', androidXVersion)
83
- implementation "androidx.annotation:annotation:$androidXAnnotation"
84
- implementation "androidx.browser:browser:$androidXBrowser"
85
- }
46
+ implementation "com.android.billingclient:billing-ktx:7.0.0"
47
+ implementation "com.google.android.gms:play-services-base:18.1.0"
86
48
  }
@@ -1,5 +1,2 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- android:exported="true"
3
- package="com.dooboolab.RNIap">
4
-
1
+ <manifest>
5
2
  </manifest>