微信开发系列之五 - 将SAP UI5应用嵌入到微信中

简介: 微信开发系列之五 - 将SAP UI5应用嵌入到微信中

文章系列目录

Wechat development series 1 – setup your development environment

Wechat development series 2 – development Q&A service using nodejs

Wechat development series 3 – Trigger C4C Account creation in Wechat app

Wechat development series 4 – Send C4C Data change notification to Wechat app

Wechat development series 5 – embedded your UI5 application to Wechat app

Wechat development series 6 – Retrieve Wechat User info via oAuth2 and display it in UI5 application

Wechat development series 7 – use Redis to store Wechat conversation history

Wechat development series 8 – Map integration

Wechat development series 9 – Create C4C Social Media Message and Service within Wechat app

Wechat development series 10 – Use Wechat app to receive Service Request reply made from C4C

If you have your UI5 application already running smoothly on some cloud platform like SCP or Heroku, it is then very easy to embed it in the Wechat app. The typical scenario is, when a Wechat user has subscribed your Wechat subscription account, he/she will see some available meu inside the Wechat app defined by you.

In example below, “UI5” is top level menu and “Jerry List” is sub menu item.


image.png

image.pngYou can define the logic to react to the menu item click, for example opening your UI5 application runnming on cloud platform.

When you click the “Jerry List” menu, the UI5 application is opened by a built-in browser inside the Wechat app.

image.pngimage.pngHere below is implementation detail.

(1) Create your custom Wechat menu via postman:

image.pngurl: https://api.weixin.qq.com/cgi-bin/menu/create?access_token=4_otQpSMfcwvmcL-T-DovhnozCAYCpy6wiKU3t4LUeZcQOF_i85a9NbpKpx7seLyEeHlrxl1rtlztL0miJthojqlqHqJArx7sm5OUdnsAupPpUwGr2EWljdJrLlrAVDNcADACKU


http type: post


payload:

{
                 "button":[
                     {
                       "name":"UI5",
                       "sub_button":[{
                            "type": "view",
                            "name": "Jerry List",
                            "url": "http://wechatjerry.herokuapp.com/ui5"
                       },{
                            "type": "click",
                            "name": "Other UI5 application",
                             "key": "dataQuery"
                       }]
                     }
                 ]
  }

The access token could be retrieved by http get via url: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=&secret=.


(2) since in previous step the UI5 application url http://wechatjerry.herokuapp.com/ui5 is configured to the button “Jerry List”, so you have to ensure this url works correctly. Deploy your UI5 application to a given cloud platform. You can refer to this blog Step by step to host your UI5 application in Heroku for detail step.



image.png

image.pngIn my example my UI5 application is located in a sub folder “webapp” under root folder wechat,

image.pngAnd the mapping of url ui5 to this folder is done in my nodejs server:

var express = require('express');    
var app = express();
app.use('/ui5', express.static(process.cwd() + '/webapp'));

After that you could test the scenario in your Wechat app.

相关文章
|
23天前
|
人工智能
10 分钟构建 AI 客服并应用到网站、钉钉或微信中简说
10 分钟构建 AI 客服并应用到网站、钉钉或微信
|
20天前
|
Linux C++ Windows
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
|
1天前
|
人工智能 数据可视化 API
10 分钟构建 AI 客服并应用到网站、钉钉或微信中测试评
10 分钟构建 AI 客服并应用到网站、钉钉或微信中测试评
10 2
|
1月前
|
人工智能 自然语言处理 Serverless
阿里云百炼应用实践系列-让微信公众号成为智能客服
本文主要介绍如何基于百炼平台快速在10分钟让您的微信公众号(订阅号)变成 AI 智能客服。我们基于百炼平台的能力,以官方帮助文档为参考,让您的微信公众号(订阅号)成 为AI 智能客服,以便全天候(7x24)回应客户咨询,提升用户体验,介绍了相关技术方案和主要代码,供开发者参考。
阿里云百炼应用实践系列-让微信公众号成为智能客服
|
23天前
|
存储 人工智能 API
阿里云百炼应用实践系列-10分钟在企业微信中集成一个 AI 助手
在阿里云平台上,您只需十分钟,无需任何编码,即可在企业微信上为您的组织集成一个具备大模型能力的AI助手。此助手可24小时响应用户咨询,解答各类问题,尤其擅长处理私域问题,从而成为您企业的专属助手,有效提升用户体验及业务竞争力。
|
30天前
|
小程序 开发者
第一个微信小程序的初始化过程、小程序微信开发平台的下载、如何注册一个微信小程序的账号
这篇文章介绍了微信小程序的初始化过程,包括如何注册微信小程序账号、下载微信小程序开发者平台,并指导了新建小程序的详细步骤。
第一个微信小程序的初始化过程、小程序微信开发平台的下载、如何注册一个微信小程序的账号
|
1月前
数字化核心构建问题之SAP为应用软件扎根客户打基础如何解决
数字化核心构建问题之SAP为应用软件扎根客户打基础如何解决
13 0
|
3月前
|
Java Linux API
微信API:探究Android平台下Hook技术的比较与应用场景分析
微信API:探究Android平台下Hook技术的比较与应用场景分析
|
3月前
|
开发工具
云控微信开发SDK使用教程--手机微信朋友圈图片上传服务端
云控微信开发SDK使用教程--手机微信朋友圈图片上传服务端
|
3月前
|
小程序 JavaScript 索引
【微信开发】微信小程序多层wx:for嵌套的使用
【微信开发】微信小程序多层wx:for嵌套的使用