React-native-wechat: Android Pay promise not resolving

Created on 7 Dec 2016  ·  4Comments  ·  Source: yorkie/react-native-wechat

iOS is working fine, and I've got Android pay completing but the PayResp isn't firing.

async pay(options) {
  try {
    // Hangs forever
    result = await WeChat.pay(options);
  } catch (error) { }
  return result;
}

I feel like it's an issue with WXEntryActivity, but I can't work it out.
I've added /android/app/src/main/java/com/app/wxapi/WXEntryActivity.java
And linked it in the AndroidManifest, but the responses don't seem to be coming through.

<application
  android:name=".MainApplication"
  android:allowBackup="true"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:theme="@style/AppTheme">

  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:launchMode="singleTop"
    android:screenOrientation="portrait"
    android:configChanges="keyboard|keyboardHidden|screenSize">
    <intent-filter>
      <action android:name="android.intent.action.MAIN" />
      <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>

  <activity
    android:name=".wxapi.WXEntryActivity"
    android:label="@string/app_name"
    android:exported="true"/>

</application>

Is there something really dumb I've missed?

Most helpful comment

All 4 comments

Perfect, thank you.

@eulo How to solve this problem?

Saved my day.

Was this page helpful?
0 / 5 - 0 ratings