@@ -94,17 +94,39 @@ public class WxMaOpenCommitExtInfo implements Serializable {
94
94
@ SerializedName ("tabBar" )
95
95
private WxMaOpenTabBar tabBar ;
96
96
97
+ /**
98
+ * 关于新增 requiredPrivateInfos 说明
99
+ * 关于地理位置接口新增与相关流程调整可以查看社区公告:
100
+ * <a href="https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01">点击查看</a>
101
+ * 7.14后,在代码中使用的地理位置相关接口(共计 8 个,见表1),第三方开发者均需要在 ext_json 参数中 requiredPrivateInfos 配置项中声明
102
+ * 在ext_json参数中配置requiredPrivateInfos,其规则为「整体替换」。即如果在 app.json 里也配置了,那么最终会是ext_json的配置会覆盖 app.json
103
+ * 配置的requiredPrivateInfos。其余规则可查看下方的「ext_json补充说明」
104
+ * 在ext_json参数中配置 requiredPrivateInfos 示例如下
105
+ * {
106
+ * "template_id": "95",
107
+ * "ext_json": "{\"requiredPrivateInfos\":[\"onLocationChange\",\"startLocationUpdate\"]}",
108
+ * "user_version": "V1.0",
109
+ * "user_desc": "test"
110
+ * }
111
+ * requiredPrivateInfos主要会检查格式是否正确,填入的 api 名称是否正确,填入的 api 名称是否有权限,填入的 api 名称是否互斥。对应的错误码可查看文档末尾的错误码文档。
112
+ * requiredPrivateInfos在2022.7.14后才会生效,文档提前更新是为了方便开发者可以提前了解接口的参数变更规则,提前进行调整。
113
+ */
114
+ @ SerializedName ("requiredPrivateInfos" )
115
+ private String [] requiredPrivateInfos ;
116
+
97
117
/**
98
118
* 添加扩展项
99
119
*
100
120
* @param key
101
121
* @param value
102
122
*/
103
123
public void addExt (String key , String value ) {
104
- if (extMap == null )
124
+ if (extMap == null ) {
105
125
extMap = new HashMap <>();
106
- if (StringUtils .isNoneBlank (key , value ))
126
+ }
127
+ if (StringUtils .isNoneBlank (key , value )) {
107
128
extMap .put (key , value );
129
+ }
108
130
}
109
131
110
132
/**
@@ -114,10 +136,12 @@ public void addExt(String key, String value) {
114
136
* @param page
115
137
*/
116
138
public void addExtPage (String pagePath , WxMaOpenPage page ) {
117
- if (extPages == null )
139
+ if (extPages == null ) {
118
140
extPages = new HashMap <>();
119
- if (StringUtils .isNotBlank (pagePath ) && page != null )
141
+ }
142
+ if (StringUtils .isNotBlank (pagePath ) && page != null ) {
120
143
extPages .put (pagePath , page );
144
+ }
121
145
}
122
146
123
147
/**
@@ -126,10 +150,12 @@ public void addExtPage(String pagePath, WxMaOpenPage page) {
126
150
* @param pagePath
127
151
*/
128
152
public void addPage (String pagePath ) {
129
- if (pageList == null )
153
+ if (pageList == null ) {
130
154
pageList = new ArrayList <>();
131
- if (StringUtils .isNotBlank (pagePath ))
155
+ }
156
+ if (StringUtils .isNotBlank (pagePath )) {
132
157
pageList .add (pagePath );
158
+ }
133
159
}
134
160
135
161
public static WxMaOpenCommitExtInfo INSTANCE () {
0 commit comments