Interface calling method and device and computer-readable storage medium for hybrid application

A kind of interface calling and hybrid technology, applied in the computer field, can solve problems such as unusable, poor compatibility and user experience, and hybrid application cannot be completed, so as to improve efficiency, ensure safety, and ensure normal use.

Active Publication Date: 2018-12-18
PING AN TECH (SHENZHEN) CO LTD
View PDF4 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] During the use of hybrid applications, native code and JavaScript (a literal scripting language) code call each other and pass parameters, and can call back data, but the following problems exist in the process of mutual calling between native and JavaScript: in hybrid applications During the development process, the native code and JavaScript code are usually developed separately. When a new function needs to be added to the hybrid application, it is necessary to add a calling method corresponding to the new function in the JavaScript code, and at the same time update the native code. The update enables the native code to add an API (Application Programming Interface) corresponding to the new function; the new version of the hot-updated JavaScript code is directly released online, so the updated JavaScript code can be used directly, but the native The updated version of the code can only be used after the user updates the hybrid application, but in actual use, the user usually does not update the hybrid application in time, and will not obtain the new version of the native code in time, then when the new When the version of JavaScript executes the newly added calling method to call the native, because the native code of the old version does not include the corresponding API, the new calling method in JavaScript cannot complete the call, and the hybrid application cannot complete the corresponding function startup , or even can not continue to use, poor compatibility and user experience

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Interface calling method and device and computer-readable storage medium for hybrid application
  • Interface calling method and device and computer-readable storage medium for hybrid application
  • Interface calling method and device and computer-readable storage medium for hybrid application

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0030] Please refer to figure 1 , shows the specific steps of the method for invoking the interface of the hybrid application, the hybrid application includes both native and JavaScript script files, and the native and JavaScript script files call each other to realize the functions of the entire hybrid application. Among them, the native is developed based on the development tools and languages ​​supported by the hardware platform, which is installed on a computer device based on this type of hardware platform and can call the hardware functions of the computer device (such as speakers, acceleration sensors and cameras, etc.), for example, native It can be developed based on Xcode or Objective-c supported by the IOS platform and installed on a computer device based on the IOS platform, or natively developed based on Eclipse or Java supported by the Android platform and installed on a computer device based on the Android platform. JavaScript script files are developed based on...

Embodiment 2

[0038] Please refer to figure 2 , which shows the specific steps when the hybrid application is allowed to call the target API during the interface call process, that is, the steps of the specific implementation method of step 140 in the first embodiment above, including:

[0039] Step 141, if the target API is included in the native API, it means that the current JavaScript script file matches the current native version, and this call can be completed, then execute the call to the target API through the current JavaScript script file, and generate the corresponding Callback ID. The callback ID is used to identify the callback function of this call. The generation method is usually: Obtain the call trigger parameters through the current JavaScript script file. The call trigger parameters are the parameters of the call trigger operation. The call trigger parameters include but Not limited to receiving the timestamp information of the call trigger operation, the number of times...

Embodiment 3

[0048] Please refer to image 3 , shows a hybrid application interface call device 300, the device is divided into one or more program modules, each program module can be further divided into one or more program sub-modules and program units, the one or more program modules A plurality of program modules are stored in a storage medium and executed by one or more processors to implement the present invention. The program module, program sub-module and program unit in the present invention refer to a series of computer program instruction segments capable of completing specific functions, which are more suitable than the program itself to describe the execution process of the interface calling device in the storage medium. The following description will introduce in detail Functions such as each module, submodule and unit of the present embodiment:

[0049] A version determination module 310, configured to determine the version number of the hybrid application when the hybrid a...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

An interface calling method for a hybrid application includes the following steps: upon receiving a trigger operation for calling the target API from the current JavaScript script file through the hybrid application, determining the version number of the hybrid application, and determining whether the target API is included in the native API defined in the hybrid application according to the version number and the current JavaScript script file, thereby prohibiting or permitting the calling of the target API. The invention realizes the version control of the pseudo protocol between JavaScriptand native interaction; in cases where the current JavaScript script file does not match native due to a hot update of JavaScript but the application is not upgraded, if it is detected that the call cannot be completed in the current version, the target API is prohibited from being called and the call is skipped directly when the above triggering operation is responded to through the current JavaScript script file, so as to ensure the normal use of the mixed application body function.

Description

technical field [0001] The present invention relates to the field of computers, in particular to a hybrid application interface calling method, device and computer-readable storage medium. Background technique [0002] Hybrid App (Hybrid App) is an application between Web App (Web App) and Native App (Native App), which means that some functions in the native (Native) code of the application use dynamic web pages (HTML5+JavaScript) To achieve this, it has both the good user interaction experience of native applications and the advantages of cross-platform development of web applications. [0003] During the use of hybrid applications, native code and JavaScript (a literal scripting language) code call each other and pass parameters, and can call back data, but the following problems exist in the process of mutual calling between native and JavaScript: in hybrid applications During the development process, the native code and JavaScript code are usually developed separately....

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/60
CPCG06F8/60
Inventor 邹国忠
Owner PING AN TECH (SHENZHEN) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products