@@ -56,6 +56,37 @@ public static GenerateSchemeJsonResult GenerateScheme(string accessTokenOrAppId,
5656 } , accessTokenOrAppId ) ;
5757 }
5858
59+ /// <summary>
60+ /// 获取 NFC 的小程序 scheme
61+ /// <para>该接口用于获取用于 NFC 的小程序 scheme 码,适用于 NFC 拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放,详见 NFC 标签打开小程序</para>
62+ /// <para>详见<see langword="获取 NFC 的小程序 scheme" cref="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/url-scheme/generateNFCScheme.html"/></para>
63+ /// <para>https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/url-scheme/generateNFCScheme.html</para>
64+ /// </summary>
65+ /// <param name="accessTokenOrAppId"></param>
66+ /// <param name="jumpWxa">(必填)跳转到的目标小程序信息。</param>
67+ /// <param name="isExpire">(非必填)生成的scheme码类型,到期失效:true,永久有效:false。</param>
68+ /// <param name="expireTime">(非必填)到期失效的scheme码的失效时间,为Unix时间戳。生成的到期失效scheme码在该时间前有效。生成到期失效的scheme时必填。</param>
69+ /// <param name="timeOut"></param>
70+ /// <returns></returns>
71+ public static GenerateNFCSchemeJsonResult GenerateNFCScheme ( string accessTokenOrAppId , GenerateNFCSchemeJumpWxa jumpWxa = null , string model_id = "" ,
72+ string sn = null , int timeOut = Config . TIME_OUT )
73+ {
74+ return WxOpenApiHandlerWapper . TryCommonApi ( accessToken =>
75+ {
76+ string urlFormat = Config . ApiMpHost + "/wxa/generatenfcscheme?access_token={0}" ;
77+
78+ var data = new
79+ {
80+ jump_wxa = jumpWxa ,
81+ model_id = model_id ,
82+ sn = sn
83+ } ;
84+
85+ return CommonJsonSend . Send < GenerateNFCSchemeJsonResult > ( accessToken , urlFormat , data , timeOut : timeOut ,
86+ jsonSetting : new CO2NET . Helpers . Serializers . JsonSetting ( true ) ) ;
87+ } , accessTokenOrAppId ) ;
88+ }
89+
5990 #endregion
6091
6192 #region 异步方法
@@ -90,6 +121,37 @@ public static async Task<GenerateSchemeJsonResult> GenerateSchemeAsync(string ac
90121 jsonSetting : new CO2NET . Helpers . Serializers . JsonSetting ( true ) ) ;
91122 } , accessTokenOrAppId ) . ConfigureAwait ( false ) ;
92123 }
124+
125+ /// <summary>
126+ /// 获取 NFC 的小程序 scheme
127+ /// <para>该接口用于获取用于 NFC 的小程序 scheme 码,适用于 NFC 拉起小程序的业务场景。目前仅针对国内非个人主体的小程序开放,详见 NFC 标签打开小程序</para>
128+ /// <para>详见<see langword="获取 NFC 的小程序 scheme" cref="https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/url-scheme/generateNFCScheme.html"/></para>
129+ /// <para>https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/url-scheme/generateNFCScheme.html</para>
130+ /// </summary>
131+ /// <param name="accessTokenOrAppId"></param>
132+ /// <param name="jumpWxa">(必填)跳转到的目标小程序信息。</param>
133+ /// <param name="isExpire">(非必填)生成的scheme码类型,到期失效:true,永久有效:false。</param>
134+ /// <param name="expireTime">(非必填)到期失效的scheme码的失效时间,为Unix时间戳。生成的到期失效scheme码在该时间前有效。生成到期失效的scheme时必填。</param>
135+ /// <param name="timeOut"></param>
136+ /// <returns></returns>
137+ public static async Task < GenerateNFCSchemeJsonResult > GenerateNFCSchemeAsync ( string accessTokenOrAppId , GenerateNFCSchemeJumpWxa jumpWxa = null , string model_id = "" ,
138+ string sn = null , int timeOut = Config . TIME_OUT )
139+ {
140+ return await WxOpenApiHandlerWapper . TryCommonApiAsync ( async accessToken =>
141+ {
142+ string urlFormat = Config . ApiMpHost + "/wxa/generatenfcscheme?access_token={0}" ;
143+
144+ var data = new
145+ {
146+ jump_wxa = jumpWxa ,
147+ model_id = model_id ,
148+ sn = sn
149+ } ;
150+
151+ return CommonJsonSend . Send < GenerateNFCSchemeJsonResult > ( accessToken , urlFormat , data , timeOut : timeOut ,
152+ jsonSetting : new CO2NET . Helpers . Serializers . JsonSetting ( true ) ) ;
153+ } , accessTokenOrAppId ) . ConfigureAwait ( false ) ;
154+ }
93155 #endregion
94156 }
95157}
0 commit comments