Giter Club home page Giter Club logo

Comments (9)

hyochan avatar hyochan commented on June 26, 2024

@brentjanderson
Did you link the project properly?
Actually, it won't work in expo project without detaching.

from react-native-iap.

brentjanderson avatar brentjanderson commented on June 26, 2024

@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.

brentjanderson avatar brentjanderson commented on June 26, 2024

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.

hyochan avatar hyochan commented on June 26, 2024

@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

  1. You've succeeded linking from a clean install from clean expo detached app.
  2. 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.

brentjanderson avatar brentjanderson commented on June 26, 2024

@dooboolab late reply to your previous message:

  1. I have succeeded linking from a clean install from a clean expo detached app
  2. 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.

brentjanderson avatar brentjanderson commented on June 26, 2024

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 and MAIN and LAUNCHER intent.
  • Because the MainActivity class defines the packages we need, but not LauncherActivity, the RNIap 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.

dwyanelin avatar dwyanelin commented on June 26, 2024

@brentjanderson

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.

brentjanderson avatar brentjanderson commented on June 26, 2024

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.

dwyanelin avatar dwyanelin commented on June 26, 2024

@brentjanderson

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.