CN113010239A - IOS client-based interaction method and device - Google Patents

IOS client-based interaction method and device Download PDF

Info

Publication number
CN113010239A
CN113010239A CN202110328343.0A CN202110328343A CN113010239A CN 113010239 A CN113010239 A CN 113010239A CN 202110328343 A CN202110328343 A CN 202110328343A CN 113010239 A CN113010239 A CN 113010239A
Authority
CN
China
Prior art keywords
data
interaction
ios client
html page
interacted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110328343.0A
Other languages
Chinese (zh)
Inventor
贾平辉
杨天
王军波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lexuebang Network Technology Co Ltd
Original Assignee
Beijing Lexuebang Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lexuebang Network Technology Co Ltd filed Critical Beijing Lexuebang Network Technology Co Ltd
Priority to CN202110328343.0A priority Critical patent/CN113010239A/en
Publication of CN113010239A publication Critical patent/CN113010239A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

An interaction method and device based on an IOS client relate to the technical field of computers, and the interaction method based on the IOS client is applied to an interaction module and comprises the following steps: firstly, acquiring data to be interacted transmitted by an HTML page; generating first JS interactive data comprising data to be interacted and callback identification according to a preset JS calling method, and sending the first JS interactive data to an IOS client, so that the IOS client detects the first JS interactive data and executes corresponding operation according to the data to be interacted in the first JS interactive data to obtain processed data; the callback identifier and the processing data transmitted by the IOS client are fed back to the HTML page, so that data interaction between the IOS client and the HTML page can be simply and quickly realized, a plurality of sets of transmission protocols do not need to be agreed, and the flexibility is high.

Description

IOS client-based interaction method and device
Technical Field
The application relates to the technical field of computers, in particular to an interaction method and device based on an IOS client.
Background
JavaScript (JS for short) is a lightweight, interpreted or just-in-time, programming language with function preference, with which HTML pages can be built. The IOS is a mobile operating system developed by apple inc, with the IOS client running on the IOS system. The existing interaction method of the IOS client and the HTML page generally realizes data interaction of the IOS client and the HTML page based on JavaScript core. However, in practice, the existing technology needs to protocol a plurality of sets of data interaction protocols in advance, and the flexibility is low.
Disclosure of Invention
An object of the embodiments of the present application is to provide an interaction method and an interaction device based on an IOS client, which can simply and quickly implement data interaction between the IOS client and an HTML page, do not need to agree on multiple sets of transport protocols, and have high flexibility.
A first aspect of the embodiments of the present application provides an interaction method based on an IOS client, which is applied to an interaction module, where the interaction module is configured to implement interaction between the IOS client and an HTML page, and includes:
acquiring data to be interacted transmitted by the HTML page;
generating first JS interaction data comprising the data to be interacted and the callback identifier according to a preset JS calling method;
sending the first JS interactive data to the IOS client so that the IOS client detects the first JS interactive data and executes corresponding operation according to the data to be interacted in the first JS interactive data to obtain processed data;
and receiving the processing data fed back by the IOS client, and sending the callback identifier and the processing data to the HTML page.
In the implementation process, when an HTML page needs to transmit data to be interacted to an IOS client, an interaction module firstly acquires the data to be interacted transmitted by the HTML page; then, generating first JS interactive data comprising the data to be interacted and the callback identifier according to a preset JS calling method, and sending the first JS interactive data to the IOS client, so that the IOS client detects the first JS interactive data and executes corresponding operation according to the data to be interacted in the first JS interactive data to obtain processed data; and finally, the callback identification and the processing data transmitted by the IOS client are fed back to the HTML page, so that the data interaction between the IOS client and the HTML page can be simply and quickly realized, a plurality of sets of transmission protocols do not need to be agreed, and the flexibility is high.
Further, generating first JS interaction data comprising the data to be interacted and the callback identifier according to a preset JS calling method, and comprising the following steps of:
judging whether processing data of the IOS client aiming at the data to be interacted needs to be acquired or not;
if so, determining a callback identifier corresponding to the data to be interacted according to a preset operation identifier data table;
and generating first JS interactive data comprising the data to be interacted and the callback identifier according to a preset JS calling method.
In the implementation process, when an HTML page needs processing data called back by an IOS client, a callback identifier is determined, then first JS interactive data comprising data to be interacted and the callback identifier is generated according to a preset JS calling method, no additional transmission protocol is needed, and the IOS client can directly detect the first JS interactive data.
Further, the method further comprises:
when the processing data do not need to be acquired, determining operation data corresponding to the data to be interacted;
determining an operation identifier corresponding to the operation data according to the operation identifier data table;
and generating second JS interactive data which comprise the data to be interacted and the operation identifier, and sending the second JS interactive data to the IOS client so that the IOS client detects the second JS interactive data and according to the operation identifier in the second JS interactive data, the operation identifier is right to execute corresponding operation on the data to be interacted.
In the implementation process, the HTML page may further determine a corresponding operation identifier according to the operation identifier data table, and obtain the subsequent specified operation through unique representation of the operation identifier.
Further, before the acquiring the data to be interacted transmitted by the HTML page, the method further includes:
acquiring a global method agreed by the HTML page and the IOS client in advance; wherein the global method is used to implement data transfer between the IOS client and the HTML page.
In the implementation process, the IOS client can call the data of the HTML page through a pre-agreed global method.
Further, the sending the callback identifier and the processing data to the HTML page includes:
binding the callback identification for the processing data to obtain interactive return data;
and feeding back the interaction return data to the HTML page.
In the implementation process, the interaction module can call back the identifier for processing the data binding and transmit the identifier to the HTML page.
Further, the JS popup window calling method is preset as the JS calling method.
A second aspect of the present application provides an interaction method based on an IOS client, applied to the IOS client, including:
pre-agreement of a global method with an HTML page; wherein the global method is used for realizing data transmission between the IOS client and the HTML page;
detecting first JS interaction data transmitted by an interaction module; the interaction module is used for realizing the interaction between the IOS client and the HTML page;
acquiring data to be interacted according to the first JS interaction data;
executing corresponding operation according to the data to be interacted to obtain processed data;
and transmitting the processing data back to the HTML page through the interaction module and the global method.
In the implementation process, the IOS client pre-agrees with an HTML page to a global method; then detecting first JS interaction data transmitted by the interaction module; acquiring data to be interacted according to the first JS interaction data; then, executing corresponding operation according to the data to be interacted to obtain processed data; and finally, the processing data is transmitted back to the HTML page through an interaction module and a global method, so that the interaction between the IOS client and the HTML page is completed.
A third aspect of the embodiments of the present application provides an interaction apparatus based on an IOS client, which is applied to an interaction module, where the interaction module is configured to implement interaction between the IOS client and an HTML page, and the interaction apparatus based on the IOS client includes:
the first acquisition unit is used for acquiring the data to be interacted transmitted by the HTML page;
the generating unit is used for generating first JS interaction data comprising the data to be interacted and the callback identifier according to a preset JS calling method;
the first sending unit is used for sending the first JS interaction data to the IOS client so that the IOS client can detect the first JS interaction data and execute corresponding operation according to the data to be interacted in the first JS interaction data to obtain processed data;
a receiving unit, configured to receive the processing data fed back by the IOS client;
and the second sending unit is used for sending the callback identifier and the processing data to the HTML page.
In the implementation process, when an HTML page needs to transmit data to be interacted to an IOS client, a first acquisition unit acquires the data to be interacted transmitted by the HTML page; the generating unit generates first JS interactive data comprising the data to be interacted and the callback identifier according to a preset JS calling method; then the first sending unit sends the first JS interactive data to the IOS client so that the IOS client can detect the first JS interactive data and execute corresponding operation according to data to be interacted in the first JS interactive data to obtain processed data; the receiving unit receives processing data fed back by the IOS client; and finally, the second sending unit sends the callback identifier and the processing data to the HTML page, so that the data interaction between the IOS client and the HTML page can be simply and quickly realized, a plurality of sets of transmission protocols do not need to be agreed, and the flexibility is high.
A fourth aspect of the present embodiment provides an electronic device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to make the electronic device execute the interaction method based on the IOS client according to any one of the first aspect of the present embodiment.
A fifth aspect of the present embodiment provides a computer-readable storage medium, which stores computer program instructions, where the computer program instructions, when read and executed by a processor, perform the interaction method based on the IOS client according to any one of the first aspect of the present embodiment.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of an interaction method based on an IOS client according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another IOS client-based interaction method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another interaction method based on an IOS client according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an interaction device based on an IOS client according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of another IOS client-based interaction device according to an embodiment of the present application;
fig. 6 is a schematic diagram of a closed loop of information interaction between an HTML page and an IOS client according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating an interaction method based on an IOS client according to an embodiment of the present application. The IOS client-based interaction method comprises the following steps:
s101, obtaining data to be interacted transmitted by the HTML page.
In the embodiment of the present application, the method is applied to an interaction module, and an execution subject of the method is the interaction module, and specifically, the method may be implemented by a processor, a controller, and the like. The interaction module may specifically run on the IOS system, and is not limited in this embodiment.
In the embodiment of the application, the interaction module can realize interaction between the IOS client and the HTML page, can transmit data or operation of the IOS client to the HTML page, and can also transmit data or operation of the HTML page to the IOS client.
In this embodiment, the IOS client, the interaction module, and the HTML page may all run on the IOS system, and specifically may run on an electronic device of the IOS system, such as a smart phone of the IOS system, a tablet of the IOS system, and a wearable device of the IOS system, and the embodiment is not limited in any way.
In the embodiment of the present application, the HTML page may be implemented by js (javascript) script, and specifically, the HTML page may be an H5 page (that is, an HTML5 webpage), which is not limited in this embodiment of the present application.
In this embodiment of the present application, the data to be interacted includes data or operation that an HTML page needs to be transmitted to an IOS client, which is not limited in this embodiment of the present application.
S102, generating first JS interactive data comprising the data to be interacted and the callback identifier according to a preset JS calling method.
In the embodiment of the application, the preset JS calling method may be a JS popup calling method, specifically, the JS popup calling method is a prompt () popup method, and the embodiment of the application is not limited.
In the embodiment of the application, when the interaction events of the HTML page and the IOS client are more, the interaction method provided by the embodiment of the application is implemented, a plurality of sets of transmission protocols do not need to be agreed, the interaction of the HTML page and the IOS client can be realized only by presetting a JS calling method, and the method is simple and quick and has strong applicability.
In the embodiment of the application, when the JS popup calling method is a prompt () popup method, if an HTML page needs to acquire processing data called back by an IOS client, a unique identifier of the call back (namely, a call back identifier) is determined, and then the data to be interacted and the call back identifier are added to a parameter of promopt () together, so that first JS interaction data is obtained.
S103, sending the first JS interactive data to the IOS client so that the IOS client can detect the first JS interactive data and execute corresponding operation according to data to be interacted in the first JS interactive data to obtain processed data.
It should be noted that, when the IOS client receives the first JS interaction data, the IOS client may analyze the first JS interaction data, determine the data to be interacted and the callback identifier from the first IS interaction data, and call the processing module corresponding to the callback identifier in the electronic device according to the callback identifier, so as to implement processing of the data to be interacted by using the processing module, which IS not described herein again.
And S104, receiving the processing data fed back by the IOS client, and sending the callback identifier and the processing data to an HTML page.
The above method is described in detail below by way of an example:
suppose that an online education APP which can be used to learn english online is installed on the IOS system, and the attendance check-in function on the online education APP can be realized through the H5 page. After the student enters the online education APP, the card punching button can be selected, and then an H5 page pops up, and the user is prompted to scan codes to complete sign-in. That is, the H5 page first sends a check-in request to the interaction module; after receiving the sign-in request, the interaction module analyzes the request, determines that a camera on the IOS device needs to be accessed, configures a corresponding callback identifier for the request, such as a camera ID, and sends the access request and the camera ID for the camera to a processing chip of the IOS terminal; after receiving an access request aiming at the camera, a processing chip of the IOS terminal opens a system camera and scans codes under the operation of a user to obtain a code scanning result; the processing chip of the IOS terminal device feeds back the code scanning result to the interaction module, and the interaction module feeds back the code scanning result and the camera ID to the H5 page, so that the H5 page knows that the code scanning sign-in is finished, and can display final result information to a user according to the code scanning result, for example, according to the corresponding relation between the code scanning result and the result information, the display is carried out. If the code scanning is successful, the displayed result information is successful in sign-in; when code scanning fails, the displayed result information is sign-in failure, and the code scanning is requested again; when the code scanning is repeatedly submitted, the displayed result information is signed in, repeated code scanning is not required, and the like, which is not described in detail.
In other possible embodiments, the data to be interacted which can be processed by the interaction module may be a code scanning request, a photographing request, a payment request, a recording request, an identification request, a positioning request, etc., as long as the JS script-based interaction method between the HTML page and the IOS client is implemented. For example, the HTML page calls functions of a camera, positioning, recording, photographing, fingerprint recognition, face recognition, photo album, etc. on the IOS electronic device, which is not limited in any way.
In the embodiment of the present application, by implementing the steps S101 to S104, the data or the function of the IOS client called by the HTML page can be implemented, and similarly, the interaction module can also implement the data or the function of the IOS client called by the HTML page, which specifically includes the following steps:
receiving a data request sent by the IOS;
analyzing the data request to obtain calling information, and determining a target callback identifier corresponding to the calling information;
sending the calling information and the target callback identifier to an HTML page so that the HTML page executes corresponding operation according to the calling information to obtain HTML page processing data;
receiving HTML page processing data returned by the HTML page;
and processing the data binding target callback identifier for the HTML page, and feeding back the data binding target callback identifier to the IOS client.
In the above embodiment, when the HTML page executes the corresponding operation according to the call information to obtain the HTML page processing data, the HTML page can call the corresponding interface according to the call information, and execute the corresponding operation through the interface to obtain the HTML page processing data.
Therefore, the IOS client-based interaction method described in the figure 1 can simply and quickly realize data interaction between the IOS client and the HTML page, does not need to agree with multiple sets of transmission protocols, and is high in flexibility.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating another interaction method based on an IOS client according to an embodiment of the present application. As shown in fig. 2, the IOS client-based interaction method includes:
s201, obtaining a global method agreed by the HTML page and the IOS client in advance.
In the embodiment of the application, the global method is used for realizing data transmission between the IOS client and the HTML page.
S202, obtaining data to be interacted transmitted by the HTML page.
S203, judging whether the processing data of the IOS client aiming at the data to be interacted needs to be acquired, if so, executing the steps S204 to S206 and the steps S210 to S211; if not, step S207 to step S209 are executed.
And S204, determining a callback identifier corresponding to the data to be interacted according to a preset operation identifier data table.
In the embodiment of the application, the interaction module may pre-configure a set of operation identification data table with unique identification, where the operation identification data table includes multiple operation identifications, and each operation identification uniquely indicates that a subsequent specified operation is obtained.
In the embodiment of the application, the IOS client does not need to configure the operation identifier data table, and only needs to return the operation identifier transmitted by the HTML page to the HTML page.
S205, generating first JS interaction data comprising the data to be interacted and the callback identifier according to a preset JS calling method.
S206, the first JS interactive data are sent to the IOS client, so that the IOS client detects the first JS interactive data and executes corresponding operation according to data to be interacted in the first JS interactive data to obtain processed data.
In the embodiment of the application, the IOS client can detect the first JS interactive data transmitted by the interactive module, and acquires the data to be interacted and the callback identification transmitted by the HTML page by intercepting the first JS interactive data.
And S207, determining operation data corresponding to the data to be interacted.
And S208, determining an operation identifier corresponding to the operation data according to the operation identifier data table.
And S209, generating second JS interactive data comprising the data to be interacted and the operation identifier, and sending the second JS interactive data to the IOS client, so that the IOS client detects the second JS interactive data, executes corresponding operation on the data to be interacted according to the operation identifier in the second JS interactive data, and finishing the process.
In the embodiment of the application, second JS interaction data comprising data to be interacted and an operation identifier can be generated according to a preset JS calling method.
In the embodiment of the application, by implementing the steps S203 to S209, the first JS interaction data including the data to be interacted and the callback identifier can be generated according to the preset JS calling method.
And S210, receiving processing data fed back by the IOS client.
S211, binding the callback identifier for the processed data to obtain interactive return data, and feeding the interactive return data back to the HTML page.
In this embodiment of the application, by implementing the step S211, the interaction module may send the callback identifier and the processing data transmitted by the IOS client to the HTML page, and then complete data interaction between the HTML page and the IOS client.
In the embodiment of the application, for example, by using the interaction method based on the IOS client described in the embodiment, the HTML page can call the camera scan two-dimensional code of the IOS client, that is, the HTML page calls the camera function of the IOS client; and after the IOS client executes the code scanning operation through the camera function, returning a code scanning result (namely processing data) to the HTML page, namely completing the calling of the HTML page by the IOS client.
Specifically, an interaction module, an HTML page and an IOS client are all operated on the IOS system, when the HTML page needs to be subjected to code scanning operation, the HTML page sends a code scanning request to the interaction module, the interaction module firstly analyzes the code scanning request to obtain camera calling information, then the interaction module determines a callback identifier corresponding to the camera calling information according to a preset operation identifier data table and sends the callback identifier and the camera calling information to the IOS client, and the IOS client can intercept the callback identifier and the camera calling information, call a camera function according to the camera calling information and complete code scanning operation, and further obtain a code scanning result; further, the IOS client sends the code scanning result and the callback identifier to the interaction module, the interaction module can bind the callback identifier for the code scanning result to obtain interaction return data, and feeds the interaction return data back to the HTML page, so that data interaction between the IOS client and the HTML page is completed.
Referring to fig. 6, fig. 6 is a schematic diagram of a closed loop of information interaction between an HTML page and an IOS client according to an embodiment of the present application. As shown in fig. 6, a set of operation identifier data table called by the method is preconfigured in the HTML page, the HTML page calls the IOS client through the interaction module only by transmitting the unique operation identifier to the IOS client along with the data, the IOS client only needs to transmit the unique operation identifier and the processing data to the interaction module if the callback data, and then the interaction module can feed back the operation identifier and the processing data sent by the IOS to the HTML page.
Therefore, the IOS client-based interaction method described in FIG. 2 can simply and quickly realize data interaction between the IOS client and the HTML page, does not need to agree with multiple sets of transmission protocols, and is high in flexibility.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating another interaction method based on an IOS client according to an embodiment of the present application. As shown in fig. 3, the IOS client-based interaction method is applied to an IOS client, and includes:
s301, pre-agreement of a global method with the HTML page.
In the embodiment of the application, the global method is used for realizing data transmission between the IOS client and the HTML page.
S302, detecting first JS interactive data transmitted by an interactive module; the interaction module is used for realizing the interaction between the IOS client and the HTML page.
And S303, acquiring the data to be interacted according to the first JS interaction data.
In the embodiment of the application, the IOS client can detect the first JS interactive data transmitted by the interactive module and acquire the data to be interacted transmitted by the HTML page by intercepting the first JS interactive data.
And S304, executing corresponding operation according to the data to be interacted to obtain processed data.
S305, the processing data is transmitted back to the HTML page through the interactive module and the global method.
In the embodiment of the application, after the IOS client finishes data processing according to the first JS interactive data, the processed data is fed back to the interactive module by a pre-agreed global method, and then the processed data and the callback identifier are transmitted to the HTML page by the interactive module.
Therefore, the IOS client-based interaction device described in FIG. 3 can simply and quickly realize data interaction between the IOS client and the HTML page without the need of multiple transmission protocols, and has high flexibility.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an interaction device based on an IOS client according to an embodiment of the present application. As shown in fig. 4, the IOS client-based interaction apparatus, applied to the interaction module, includes:
the first obtaining unit 410 is configured to obtain data to be interacted transmitted by an HTML page.
The generating unit 420 is configured to generate first JS interaction data including the data to be interacted and the callback identifier according to the preset JS calling method.
The first sending unit 430 is configured to send the first JS interaction data to the IOS client, so that the IOS client detects the first JS interaction data and executes corresponding operation according to the data to be interacted in the first JS interaction data to obtain processed data.
A receiving unit 440, which receives processing data fed back by the IOS client;
and a second sending unit 450, configured to send the callback identifier and the processing data to the HTML page.
Referring to fig. 5, fig. 5 is a schematic structural diagram of another IOS client-based interaction device according to an embodiment of the present application. The IOS client-based interaction device shown in fig. 5 is optimized by the IOS client-based interaction device shown in fig. 4. As shown in fig. 5, the generating unit 420 includes:
a determining subunit 421, configured to determine whether to acquire processing data of the IOS client for the to-be-interacted data;
the determining subunit 422 is configured to determine, when it is determined that the processing data needs to be acquired, a callback identifier corresponding to the data to be interacted according to a preset operation identifier data table;
the generating subunit 423 is configured to generate, according to the preset JS calling method, first JS interaction data including the to-be-interacted data and the callback identifier, so that the IOS client processes the to-be-interacted data according to the first JS interaction data to obtain processed data.
As an optional implementation manner, the determining subunit 422 is further configured to determine, when it is determined that the processing data does not need to be acquired, operation data corresponding to the data to be interacted; determining an operation identifier corresponding to the operation data according to the operation identifier data table;
the generating subunit 423 is further configured to generate second JS interaction data including the data to be interacted and the operation identifier, so that the IOS client detects the second JS interaction data and executes a corresponding operation on the data to be interacted according to the operation identifier in the second JS interaction data.
As an optional implementation manner, the IOS client-based interaction apparatus further includes:
the second obtaining unit 460 is configured to obtain a global method agreed in advance by the HTML page and the IOS client before obtaining the data to be interacted transmitted by the HTML page; the global method is used for realizing data transmission between the IOS client and the HTML page.
As an optional implementation, the second sending unit 450 includes:
the binding subunit 451 is configured to call back the identifier for processing data binding, and obtain the interactive return data.
And the feedback subunit 452 is configured to feed back the interaction return data to the HTML page.
In the embodiment of the application, the preset JS calling method is specifically a JS popup calling method, and the embodiment of the application is not limited.
It can be seen that, the interaction device based on the IOS client described in this embodiment can simply and quickly implement data interaction between the IOS client and the HTML page, does not need to agree on multiple sets of transmission protocols, and is high in flexibility.
An embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the interaction method based on the IOS client in any one of embodiment 1 or embodiment 2 of the present application.
An embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions, and when the computer program instructions are read and executed by a processor, the method for performing an interaction method based on an IOS client in any of embodiment 1 or embodiment 2 of the present application is performed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are merely examples of the present application and are not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. An interaction method based on an IOS client is applied to an interaction module, the interaction module is used for realizing interaction between the IOS client and an HTML page, and the method is characterized by comprising the following steps:
acquiring data to be interacted transmitted by the HTML page;
generating first JS interaction data comprising the data to be interacted and the callback identifier according to a preset JS calling method;
sending the first JS interactive data to the IOS client so that the IOS client detects the first JS interactive data and executes corresponding operation according to the data to be interacted in the first JS interactive data to obtain processed data;
and receiving the processing data fed back by the IOS client, and sending the callback identifier and the processing data to the HTML page.
2. The IOS client-based interaction method of claim 1, wherein the generating of the first JS interaction data comprising the data to be interacted and the callback identifier according to a preset JS call method comprises:
judging whether processing data of the IOS client aiming at the data to be interacted needs to be acquired or not;
if so, determining a callback identifier corresponding to the data to be interacted according to a preset operation identifier data table;
and generating first JS interactive data comprising the data to be interacted and the callback identifier according to a preset JS calling method.
3. The IOS client based interaction method of claim 2, further comprising:
when the processing data do not need to be acquired, determining operation data corresponding to the data to be interacted;
determining an operation identifier corresponding to the operation data according to the operation identifier data table;
and generating second JS interactive data which comprise the data to be interacted and the operation identifier, and sending the second JS interactive data to the IOS client so that the IOS client detects the second JS interactive data and according to the operation identifier in the second JS interactive data, the operation identifier is right to execute corresponding operation on the data to be interacted.
4. The IOS client-based interaction method of claim 1, wherein prior to the obtaining of the data to be interacted with delivered by the HTML page, the method further comprises:
acquiring a global method agreed by the HTML page and the IOS client in advance; wherein the global method is used to implement data transfer between the IOS client and the HTML page.
5. The IOS client based interaction method of claim 1, wherein the sending the callback identification and the processing data to the HTML page comprises:
and binding the callback identification for the processing data to obtain interaction return data, and feeding back the interaction return data to the HTML page.
6. The IOS client-based interaction method of claim 1, wherein the preset JS call method is a JS popup call method.
7. An interaction method based on an IOS client is applied to the IOS client and is characterized by comprising the following steps:
pre-agreement of a global method with an HTML page; wherein the global method is used for realizing data transmission between the IOS client and the HTML page;
detecting first JS interaction data transmitted by an interaction module; the interaction module is used for realizing the interaction between the IOS client and the HTML page;
acquiring data to be interacted according to the first JS interaction data;
executing corresponding operation according to the data to be interacted to obtain processed data;
and transmitting the processing data back to the HTML page through the interaction module and the global method.
8. An IOS client-based interaction device applied to an interaction module, wherein the interaction module is used for realizing interaction between the IOS client and an HTML page, and the IOS client-based interaction device is characterized by comprising:
the first acquisition unit is used for acquiring the data to be interacted transmitted by the HTML page;
the generating unit is used for generating first JS interaction data comprising the data to be interacted and the callback identifier according to a preset JS calling method;
the first sending unit is used for sending the first JS interaction data to the IOS client so that the IOS client can detect the first JS interaction data and execute corresponding operation according to the data to be interacted in the first JS interaction data to obtain processed data;
a receiving unit, configured to receive the processing data fed back by the IOS client;
and the second sending unit is used for sending the callback identifier and the processing data to the HTML page.
9. An electronic device, comprising a memory for storing a computer program and a processor for executing the computer program to cause the electronic device to perform the IOS client based interaction method of any one of claims 1 to 7.
10. A readable storage medium having stored thereon computer program instructions, which when read and executed by a processor, perform the IOS client based interaction method of any of claims 1 to 7.
CN202110328343.0A 2021-03-26 2021-03-26 IOS client-based interaction method and device Pending CN113010239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110328343.0A CN113010239A (en) 2021-03-26 2021-03-26 IOS client-based interaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110328343.0A CN113010239A (en) 2021-03-26 2021-03-26 IOS client-based interaction method and device

Publications (1)

Publication Number Publication Date
CN113010239A true CN113010239A (en) 2021-06-22

Family

ID=76408013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110328343.0A Pending CN113010239A (en) 2021-03-26 2021-03-26 IOS client-based interaction method and device

Country Status (1)

Country Link
CN (1) CN113010239A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105224552A (en) * 2014-06-10 2016-01-06 腾讯科技(北京)有限公司 The disposal route of the network information, device and system
EP3043258A1 (en) * 2013-09-05 2016-07-13 Peking University Founder Group Co., Ltd iOS APPLICATION AUTOMATIC COMPILATION METHOD AND SYSTEM
CN106131143A (en) * 2016-06-28 2016-11-16 北京车智赢科技有限公司 A kind of method mutual for HTML with Native realizing Hybrid App
CN106990966A (en) * 2017-03-31 2017-07-28 中国科学技术大学苏州研究院 Mobile terminal cross-platform Development Framework and development approach based on front end frame
CN107133322A (en) * 2017-05-04 2017-09-05 四川长虹电器股份有限公司 The implementation method for the common data channel that HTML is interacted with Native in Mobile solution
CN109656773A (en) * 2017-10-12 2019-04-19 卓望数码技术(深圳)有限公司 A kind of processing frame collapsed extremely based on the application of IOS system
CN110691136A (en) * 2019-09-29 2020-01-14 广州华多网络科技有限公司 Data interaction method and device, electronic equipment and storage medium
CN111443946A (en) * 2020-03-09 2020-07-24 深圳市伊欧乐科技有限公司 Interactive method, system, server and storage medium of IOS system and page

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3043258A1 (en) * 2013-09-05 2016-07-13 Peking University Founder Group Co., Ltd iOS APPLICATION AUTOMATIC COMPILATION METHOD AND SYSTEM
CN105224552A (en) * 2014-06-10 2016-01-06 腾讯科技(北京)有限公司 The disposal route of the network information, device and system
CN106131143A (en) * 2016-06-28 2016-11-16 北京车智赢科技有限公司 A kind of method mutual for HTML with Native realizing Hybrid App
CN106990966A (en) * 2017-03-31 2017-07-28 中国科学技术大学苏州研究院 Mobile terminal cross-platform Development Framework and development approach based on front end frame
CN107133322A (en) * 2017-05-04 2017-09-05 四川长虹电器股份有限公司 The implementation method for the common data channel that HTML is interacted with Native in Mobile solution
CN109656773A (en) * 2017-10-12 2019-04-19 卓望数码技术(深圳)有限公司 A kind of processing frame collapsed extremely based on the application of IOS system
CN110691136A (en) * 2019-09-29 2020-01-14 广州华多网络科技有限公司 Data interaction method and device, electronic equipment and storage medium
CN111443946A (en) * 2020-03-09 2020-07-24 深圳市伊欧乐科技有限公司 Interactive method, system, server and storage medium of IOS system and page

Similar Documents

Publication Publication Date Title
US10635735B2 (en) Method and apparatus for displaying information
CN107665233B (en) Database data processing method and device, computer equipment and storage medium
US9201975B2 (en) Exchange of dynamically updated data using matrix bar codes
CN107302597B (en) Message file pushing method and device
CN107463563B (en) Information service processing method and device of browser
JP2014010723A (en) Retrieval device, retrieval method and program
US20200193109A1 (en) Service process starting method and apparatus
CN108364171B (en) Graphic code generation method, resource sending and receiving method, device and electronic equipment
CN105122760A (en) Page operation processing method, device and terminal
CN110007936B (en) Data processing method and device
US11588822B2 (en) Right control method and apparatus for terminal device
US20170132001A1 (en) Code based configuration of mobile devices
CN112583799A (en) Processing method, related device, equipment and medium for registered account
CN108668241B (en) Information reminding method and device, storage medium and electronic equipment
US11221894B2 (en) Event execution method, device, and system
CN109783606A (en) Data processing method, device, computer equipment and storage medium
CN106055693B (en) Information processing method and terminal
CN113010239A (en) IOS client-based interaction method and device
CN108156071B (en) Method for adding members to community, terminal device and computer readable storage medium
CN116112485A (en) Cloud resource using method and related equipment
CN114429634A (en) Identity authentication information filling method, system, device and storage medium
CN110704498A (en) Data extraction method, device, equipment and computer readable storage medium
CN117479171B (en) Interaction method of NFC business card and computer equipment
CN112307867B (en) Method and device for outputting information
CN112966752B (en) Image matching method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination