Copy lines to proguard-rules.pro
:
-keep class com.tencent.mm.sdk.** {
*;
}
Integrating with login and share
If you are going to integrate login or share functions, you need to
create a package named 'wxapi' in your application package and a class
named WXEntryActivity
in it.
package your.package.wxapi;
import android.app.Activity;
import android.os.Bundle;
import com.theweflex.react.WechatModule;
public class WXEntryActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 冷启动、热启动自己应用需要自己处理跳转到指定页面
WechatModule.handleIntent(getIntent());
finish();
}
}
Then add the following node to AndroidManifest.xml
:
<manifest>
<application>
<activity
android:name=".wxapi.WXEntryActivity"
android:label="@string/app_name"
android:exported="true"
/>
</application>
</manifest>
Integrating the WeChat Payment
If you are going to integrate payment functionality by using this library, then
create a package named also wxapi
in your application package and a class named
WXPayEntryActivity
, this is used to bypass the response to JS level:
package your.package.wxapi;
import android.app.Activity;
import android.os.Bundle;
import com.theweflex.react.WechatModule;
public class WXPayEntryActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 冷启动、热启动自己应用需要自己处理跳转到指定页面
WechatModule.handleIntent(getIntent());
finish();
}
}
Then add the following node to AndroidManifest.xml
:
<manifest>
<application>
<activity
android:name=".wxapi.WXPayEntryActivity"
android:label="@string/app_name"
android:exported="true"
/>
</application>
</manifest>