標籤:idt 學習 pcr reg 朋友 hand ima body open
最前面的話:Smobiler是一個在VS環境中使用.Net語言來開發APP的開發平台,也許比Xamarin更方便 控制項說明
WeiXin組件。
效果示範
1. 分享好友
2. 分享朋友圈
方法
方法 |
方法說明 |
registerApp |
應用註冊(只需要註冊一次即可)。 |
loginWithWeixin |
登入。 |
pay |
支付。 |
shareToSession |
分享給好友。 |
shareToTimeline |
分享到朋友圈。 |
控制項使用1. 應用註冊
C#: //每個裝置只需註冊一次 //方法參數中的appid為平台註冊應用的appid weiXin1.registerApp("******");
2. 分享好友
C#: WeiXinShareNewsEntity entity = new WeiXinShareNewsEntity("百度一下你就知道News", "百度一下你就知道", "https://www.baidu.com/"); weiXin1.shareToSession(entity, HandleWeiXinRPCResult);
3. 分享朋友圈
C#: WeiXinShareImageEntity entity = new WeiXinShareImageEntity("美圖", "多美的風景圖", "http://img04.tooopen.com/images/20130712/tooopen_17270713.jpg"); weiXin1.shareToTimeline(entity, HandleWeiXinRPCResult);
4. 委託事件
C#: //簽字圖片儲存 private void HandleWeiXinRPCResult(object sender, Smobiler.Core.RPC.RPCResultArgs e) { Toast(System.String.Format("isError{0},error{1},errorCode{2}", e.isError, e.error, e.errorCode)); }
注意:
1. 只支援打包版
2. 開發平台註冊的應用ios的Bundle ID和安卓版本的包名需和smobiler雲平台應用程式套件名一致,
3. 開放平台註冊應用建立行動裝置 App時,android中平台資訊的應用簽名為簽名檔案的MD5值,且字母小寫,沒有冒號。例如:q1w2e3r4t5y6u7i8o9p0q1w2e3r4t5y6;md5擷取在雲平台應用-應用安卓打包中,
.Net語言 APP開發平台——Smobiler學習日誌:在應用中添加WeiXin組件