Demo 1 implements a JS API that users WeChat native components to view images. This method is much simpler and more efficient than additionally introducing a JS image preview component library.
But WeChat never officially exposed such APIs, they were only provided internally for some Tencent services.
So later WeChat released a Web development kit called JS-SDK, which included dozens of APIs for such scenarios as taking photos, recording, speech recognition, QR code, map, payment, sharing, and coupons etc.
Those WeChat's native capabilities allowed web developers to do what they couldn't do before.
Demo 2 also shows how to view images by calling a native component.
Actually, built on WeixinJSBridge and incorporating some new features, JS-SDK was open to all developers, instead of being only available to internal developers, and became popular among developers quickly.
JS-SDK gave web developers more capabilities by exposing WeChat APIs. However, users still had an unsatisfactory experience when using mobile web pages.
When a user visited a web page, a white screen occurred before the page was displayed on the browser. On a mobile device, this problem was more severe due to lower device performance and network speed.
To help web developers solve this problem, our team designed an enhanced version of JS-SDK, which had an important feature called "WeChat Web Resource Offline Storage".
This design was somewhat similar to HTML5 Application Cache, but eliminated some of HTML5's limitations.
In addition to the white screen, insufficiency of clear action feedback affected the web user experience.
This was mainly reflected in tap delay, and page switching without smooth transitions.
Because of the above problems of JS-SDK, in order to provide a better experience for developers, the Mini Program development documentation is provided in the WeChat platform.
In today's digital age, mobile applications have become an integral part of our daily lives. From ordering food to managing finances, there seems to be an app for every need. Behind the scenes, these apps are powered by a technology that has revolutionize...
Spatial is a metaverse platform that allows anyone to create immersive 3D spaces, which can be instantly shared to the Web, iOS, Android, and VR, and explored by others. The Spatial Creator Toolkit, powered by Unity, allows you to add even more interactiv...