Comments (9)
@brentjanderson
Did you link
the project properly?
Actually, it won't work in expo
project without detaching.
from react-native-iap.
@dooboolab You're right about expo
requiring a detach, which I did. And I have run react-native link react-native-iap
several times. I have verified with the manual steps as well, and I can't figure out what the difference is - I tried from a fresh Expo project, detached, installed the module, and it worked fine.
from react-native-iap.
Also tried unlinking and relinking the project just now, targeting a prod build instead of a debug build, still no dice. Also, thank you for your prompt reply!
from react-native-iap.
@brentjanderson
Don't actually understand why that is happening either because it is not happening in my environment. Also, my understanding from your writing is that
- You've succeeded linking from a clean install from
clean
expo detached app. - However, linking is still having a problem when unlinking and linking again. But this time I feel like you are referring to ios. If so, sharing more resources would be helpful like
header search path
.
Am I right with above?
I hope you give us more examples of your flow. Because to understand the actual problem, it is hard to guess without looking into any sorts of environment of your project.
Thank you.
from react-native-iap.
@dooboolab late reply to your previous message:
- I have succeeded linking from a clean install from a clean expo detached app
- At one point it was working on Android and iOS. It now only works on iOS, so I am troubleshooting Android
One error that I noticed when starting Android Studio that may be useful:
Unsupported Modules Detected: Compilation is not supported for following modules: react-native-iap. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
I am still baffled by this and will be shipping the iOS version with IAP (Thanks again for this marvelous module) but holding back on the Android IAP until getting this resolved.
from react-native-iap.
Figured it out. For future reference:
- Expo Detach produces all the stuff that goes into the android project, including AndroidManifest.xml
- I modified the AndroidManifest.xml to accommodate deep linking schemes, and in doing so I disabled the
.MainActivity
section, relying instead on the.LauncherActivity
section for deep linking andMAIN
andLAUNCHER
intent. - Because the
MainActivity
class defines the packages we need, but notLauncherActivity
, theRNIap
module wouldn't get loaded, leading to the issues.
Now that I am using the MainActivity
for running the app, the module is available and all is right with the world.
from react-native-iap.
Sorry, I have no idea about how to modify the AndroidManifest.xml to accommodate deep linking schemes, and how to disable the .MainActivity section, relying instead on the .LauncherActivity section for deep linking and MAIN and LAUNCHER intent.
May i ask how to implement that?
from react-native-iap.
Here is a snippet from my AndroidManifest.xml file (located in android/app/src/main
in my detached ExpoKit project), showing the <application>
XML element (which I did not modify), followed by the MainActivity declaration:
<application
android:name=".MainApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true">
<!-- This is the start of the activity that used to say LauncherActivity -->
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<data android:scheme="my-app-deep-linking-scheme"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
<intent-filter>
<data android:scheme="exp123456789abcdefetcetcetc"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
I commented out the section of AndroidManifest.xml a few lines lower that refers to android:name=".MainActivity"
since it would seem to me to be conflicting to have two activities like that.
The LauncherActivity is not in use in my project, just the MainActivity.
from react-native-iap.
Thank you very much! I learned how to add deep link scheme, and how to add intent to another activity. I added it into the same intent block. Thanks again!
from react-native-iap.
Related Issues (20)
- Android installation documentation - is this step still needed?
- iOS version - purchaseUpdatedListener keeps receiving the same transaction id when testing with sandbox HOT 3
- getProducts always empty on android HOT 6
- iOS 17 (and 16.6.1) Cannot read property 'transactionReceipt' of undefined HOT 4
- Invalid Product ID (iOS, Expo 49) HOT 1
- [iOS] EXC_BAD_ACCESS and NSInvalidArgumentException HOT 14
- getAvailablePurchases returns also expired purchases on iOS. So, how can I get a user's current active subscription in iOS? HOT 8
- transactionListener not called after subscription purchase - iOS Storekit2 HOT 1
- PBL 6 support HOT 3
- [IOS] requestPurchaseWithOfferIOS getting "Invalid product ID" and "type NSMutableDictionary cannot be converted to NSString" HOT 1
- [iOS] How can I implement Apple Promotional Offers HOT 1
- Redeem promo codes from Play store (outside of app) in Android HOT 1
- Support for React Native Macos HOT 14
- [iOS] Storekit2 - subscription status is same for every skus
- build failed due to => No such module 'React' HOT 2
- beginRefundRequest can't find product for sku HOT 1
- Android purchaseUpdateListener not emit unfinished transactions
- Android - "Billing is unavailable. This may be a problem with your device, or the Play Store may be down." HOT 9
- transactionReceipt is empty on iOS HOT 6
- How to use developerPayload in react-native-iap HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-iap.