Skip to content
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

capacitor 如何配置? #606

Open
mfyang opened this issue Mar 8, 2022 · 5 comments
Open

capacitor 如何配置? #606

mfyang opened this issue Mar 8, 2022 · 5 comments

Comments

@mfyang
Copy link

mfyang commented Mar 8, 2022

根据文档,cordova是安装的时候直接在命令行配置wechat app id。

有哪位大侠指教一下,capacitor用npm安装,npx cap sync。之后在哪里配置wechat app id和universal link呢?

@yuangu
Copy link

yuangu commented Mar 8, 2022

  1. android在res/xml 下有一个config.xml文件。在这里面写上。
<preference name="WECHATAPPID" value="您的appid"/>

image

  1. 同理,在ios下面也有一个config.xml。如l图所示。

image

另:实测在capacitor里可以使用preference配置,但是
由于npx cap sync不会同步plugin.xml 里的preference,每次 sync后都需要手动修改,造成比较大的麻烦,不晓得capacitor下为啥不能同步cordova的preference配置?

@mfyang
Copy link
Author

mfyang commented Mar 8, 2022

好棒,谢谢!

@Ong26
Copy link

Ong26 commented Apr 3, 2022

@mfyang 你能在ionic v6做到微信登录吗?

@mfyang
Copy link
Author

mfyang commented Apr 3, 2022

没试过ionic,但是quasar在android下没问题了。具体就是上面二楼的回复,有效。

@luoliang222
Copy link

在capacitor.config.json中新增插件属性:
"cordova": { "preferences": { "WECHATAPPID": "wxxxxxxxxxxxx" } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants