-
-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Split code into two stores #1336
[Android] Split code into two stores #1336
Conversation
*.js.flow | ||
*.d.ts | ||
*.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it difficult to search inside IapExample folder since vscode ignores all the js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then how about
*.js
!IamExample
And actually, this example project is not currently maintained.
The latest version I am maintaining is here. Well but hopefully the example project still works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for real hard work @andresesfm. You've rocked the Amazon
iap.
I've just given small reviews and would like to test my previous android app if things aren't breaking after changes.
Also, since this is pretty much a heavy update, I would prefer you to update the version to 6.1.0
instead of 6.0.10
.
Lastly, may I add you to a core-conributor
to react-native-iap
. We desperately need a person like you here.
*.js.flow | ||
*.d.ts | ||
*.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then how about
*.js
!IamExample
And actually, this example project is not currently maintained.
The latest version I am maintaining is here. Well but hopefully the example project still works.
@@ -180,7 +191,8 @@ android { | |||
|
|||
dependencies { | |||
implementation fileTree(dir: "libs", include: ["*.jar"]) | |||
implementation "com.facebook.react:react-native:+" // From node_modules | |||
implementation "com.facebook.react:react-native:+" | |||
implementation project(path: ':react-native-iap') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is new to me! I've always digged in node_modules
and sometimes forgot to copy
and paste
the original work 😅
Thanks for sharing.
@@ -13,7 +13,7 @@ | |||
"apsl-react-native-button": "^3.1.1", | |||
"react": "16.9.0", | |||
"react-native": "0.61.5", | |||
"react-native-iap": "^6.0.6", | |||
"react-native-iap": "file:..", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be file:../
? I am afraid if there is any ad-hoc problem.
src/iap.ts
Outdated
@@ -131,7 +131,7 @@ export const endConnection = (): Promise<void> => | |||
const myRNIapModule = getAndroidModule(); | |||
|
|||
if (!RNIapModule || !RNIapAmazonModule) { | |||
console.warn('Native android module does not exist'); | |||
console.info('Native android module does not exist, while ending connection'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What actually does it mean while ending connection
?
src/iap.ts
Outdated
@@ -269,12 +269,14 @@ export const getProducts = <SkuType extends string>( | |||
const myRNIapModule = getAndroidModule(); | |||
|
|||
await checkNativeAndroidAvailable(myRNIapModule); | |||
|
|||
console.log("skus",skus); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to remove this
src/iap.ts
Outdated
const products = await myRNIapModule.getItemsByType( | ||
ANDROID_ITEM_TYPE_IAP, | ||
skus, | ||
); | ||
|
||
console.log("products",products); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. I think we need to remove this
src/iap.ts
Outdated
console.warn("purchase",purchase); | ||
console.warn('isConsumable',isConsumable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andresesfm Hi. I think you're done with the review fixes and I've just tried installing this new version in dooboolab.com pull request by yarn add react-native-iap@next
which is currently version 6.1.0
. However, I am facing the below build error. Could you kindly look into this and see what should be done to solve the build problem?
I am afraid if we are missing additional context for the previous user. The above project was using 6.0.3
which did not have a build problem.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve project :react-native-iap.
Required by:
project :app
> The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'. However we cannot choose between the following variants of project :react-native-iap:
- amazonDebugRuntimeElements
- playDebugRuntimeElements
All of them match the consumer attributes:
- Variant 'amazonDebugRuntimeElements' capability dooboolab:react-native-iap:unspecified declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Provides attribute 'com.android.build.api.attributes.VariantAttr' with value 'amazonDebug' but the consumer didn't ask for it
- Provides attribute 'store' with value 'amazon' but the consumer didn't ask for it
- Variant 'playDebugRuntimeElements' capability dooboolab:react-native-iap:unspecified declares a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Unmatched attributes:
- Provides attribute 'com.android.build.api.attributes.VariantAttr' with value 'playDebug' but the consumer didn't ask for it
- Provides attribute 'store' with value 'play' but the consumer didn't ask for it
The following variants were also considered but didn't match the requested attributes:
- Variant 'amazonDebugApiElements' capability dooboolab:react-native-iap:unspecified declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Incompatible because this component declares an API of a component and the consumer needed a runtime of a component
- Variant 'amazonReleaseApiElements' capability dooboolab:react-native-iap:unspecified:
- Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
- Variant 'amazonReleaseRuntimeElements' capability dooboolab:react-native-iap:unspecified declares a runtime of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
- Variant 'playDebugApiElements' capability dooboolab:react-native-iap:unspecified declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug':
- Incompatible because this component declares an API of a component and the consumer needed a runtime of a component
- Variant 'playReleaseApiElements' capability dooboolab:react-native-iap:unspecified:
- Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
- Variant 'playReleaseRuntimeElements' capability dooboolab:react-native-iap:unspecified declares a runtime of a component:
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 24s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just find out the solution in the README.md
.
missingDimensionStrategy 'store', 'play'
Thanks a lot for your contribution 🙏
I also like to reward you for this PR
.
Could you submit expense in react-native-iap opencollective? I want to reward you with $50. know it isn't much but I want to thank you for helping react-native-iap.
Creates two variants:
play
andamazon
and only uses the required code.NOTE: This would be a breaking change with a very simple fix described in the documentation. To add:
missingDimensionStrategy 'store', 'play'
in build.gradle