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

第三方库不同环境需要不同的KEY,这个支持切换吗 #14

Open
petma opened this issue Apr 20, 2019 · 4 comments
Open

第三方库不同环境需要不同的KEY,这个支持切换吗 #14

petma opened this issue Apr 20, 2019 · 4 comments

Comments

@petma
Copy link

petma commented Apr 20, 2019

第三方库不同环境需要不同的KEY,这个支持切换吗

@CodeXiaoMai
Copy link
Owner

CodeXiaoMai commented Apr 20, 2019

参考文档 切换 SDK 开发环境,把URL中值配置成你的 key 就可以了

@CodeXiaoMai
Copy link
Owner

理论上,EnvironmentSwitcher 是可以切换所有可以动态配置的选项的,只要把你要切换的值写到 Url 中就行😁

@Pigcasso
Copy link

参考文档 切换 SDK 开发环境,把URL中值配置成你的 key 就可以了

请问假如每个环境下有多个 Key 时应该如何编码?
比如有 Release 和 Debug 两个环境。这两个环境下都有 wxKey 和 aliKey,应该如何编码?

@CodeXiaoMai
Copy link
Owner

CodeXiaoMai commented Mar 24, 2022

参考文档 切换 SDK 开发环境,把URL中值配置成你的 key 就可以了

请问假如每个环境下有多个 Key 时应该如何编码? 比如有 Release 和 Debug 两个环境。这两个环境下都有 wxKey 和 aliKey,应该如何编码?

@Pigcasso 其实你把多个 key 理解成是不同的模块(module)就知道怎么写了。

    @Module
    private class WXKey {
        @Environment(url = "xxxxxxxx", isRelease = true, alias = "正式")
        private String online;
        @Environment(url = "22223334", alias = "测试")
        private String debug;
    }

    @Module()
    private class ALiKey {
        @Environment(url = "aaaaaa", isRelease = true, alias = "正式")
        private String online;

        @Environment(url = "bbbbbbb", alias = "测试")
        private String test;
    }

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

3 participants