Search

KR-102960295-B1 - Method and apparatus for message communication of bridge for linking native apps and web apps

KR102960295B1KR 102960295 B1KR102960295 B1KR 102960295B1KR-102960295-B1

Abstract

The present invention relates to a method and apparatus for message communication of a bridge for linking between a native app and a web app. A method for message communication of a bridge according to one embodiment of the present invention includes the steps of initializing a bridge protocol between a native app and a web app executed in a webview embedded within the native app, communicating from the web app to the native app through an action callback listener in a predefined bridge protocol, and communicating from the native app to the web app through an app event listener in a predefined bridge protocol.

Inventors

  • 박성수
  • 노두현
  • 김주현
  • 강기혁

Assignees

  • (주)뉴빌리티

Dates

Publication Date
20260507
Application Date
20240716

Claims (16)

  1. In a bridge message communication method performed by a bridge message communication device, A step of initializing a bridge protocol between a native app and a web app running in a WebView embedded within the native app; A step of communicating from the web app to the native app through an action callback listener in a predefined bridge protocol; and Includes the step of communicating from a native app to a web app through an app event listener in a predefined bridge protocol, The step of communicating from the native app to the web app is, Register an event listener in the browser via a bridge in the web app, and when the native app sends an event, call the registered event listener, provided that data conforming to the second data specification is passed as a parameter to the event listener. The above second data specification is, A message communication method of a bridge for integration between a native app and a web app, including an action type, a bridge version, data, and a callback function identification number when transmitting data from a web app to a native app.
  2. In paragraph 1, The above initialization step is, A message communication method for a bridge for integration between a native app and a web app, which registers an action callback listener to receive a response to an action and registers an app event listener to receive app events.
  3. In paragraph 2, The above initialization step is, A message communication method for a bridge for integration between a native app and a web app, wherein the web app sends an initialization completion action for actions and events to a native app, and the native app responds to the web app through the registered action callback listener.
  4. In paragraph 1, The step of communicating from the above web app to the native app is, A message communication method for a bridge for integration between a native app and a web app, which registers an action callback function to an action callback listener, requests data communication from the web app to the native app, and receives the message requested from the web app through an application programming interface (API) built into the native app.
  5. In paragraph 4, The step of communicating from the above web app to the native app is, A message communication method for a bridge for linking between a native app and a web app, wherein the native app uses data to process completed data and sends a response to the web app, and upon the response, the native app calls the registered action callback function, wherein the data regarding the response is placed as a parameter of the action callback function in accordance with the first data specification.
  6. In paragraph 5, The above first data specification is, A method for message communication of a bridge for interaction between a native app and a web app, including success status, error code, error message, bridge version, native app version, and data when transmitting data from a native app to a web app.
  7. delete
  8. delete
  9. User interface; Memory for storing one or more programs; and It includes a processor that executes one or more of the above-mentioned stored programs, and The above processor is, Initialize the bridge protocol between the native app and the web app running in the WebView embedded within the native app, and Communicate from the web app to the native app through action callback listeners in the predefined bridge protocol, and Communicate from the native app to the web app through app event listeners in the predefined bridge protocol, but The above processor is, Register an event listener in the browser via a bridge in the web app, and when the native app sends an event, call the registered event listener, provided that data conforming to the second data specification is passed as a parameter to the event listener. The above second data specification is, A message communication device of a bridge for interaction between a native app and a web app, including an action type, a bridge version, data, and a callback function identification number when transmitting data from a web app to a native app.
  10. In Paragraph 9, The above processor is, A message communication device of a bridge for integration between a native app and a web app, which registers an action callback listener to receive a response to an action and registers an app event listener to receive app events.
  11. In Paragraph 10, The above processor is, A message communication device of a bridge for interaction between a native app and a web app, which transmits an initialization completion action for actions and events from the web app to the native app, and the native app responds to the web app through the registered action callback listener.
  12. In Paragraph 9, The above processor is, A message communication device of a bridge for interaction between a native app and a web app, which registers an action callback function to an action callback listener, requests data communication from the web app to the native app, and receives the message requested by the web app through an API (Application Programming Interface) built into the native app.
  13. In Paragraph 12, The above processor is, A message communication device of a bridge for linking between a native app and a web app, wherein the native app uses data to respond to the web app with data that has been processed, and upon response, the native app calls the registered action callback function, wherein the data regarding the response is called as a parameter of the action callback function in accordance with the first data specification.
  14. In Paragraph 13, The above first data specification is, A message communication device of a bridge for interoperability between a native app and a web app, comprising success status, error code, error message, bridge version, native app version, and data when transmitting data from a native app to a web app.
  15. delete
  16. delete

Description

Method and apparatus for message communication of bridge for linking native apps and web apps The present invention relates to a technology for linking between a native app and a web app, and more specifically, to a method and apparatus for message communication of a bridge for linking between a native app and a web app. The advancement of web technology and the widespread adoption of smartphones have fueled the rapid growth of the mobile app market. Consequently, developers are focusing on developing applications using web-based technologies to ensure compatibility across various platforms and efficient development. Web apps have the advantages of being platform-independent, easy to update, and having lower development costs compared to native apps. However, they also have the disadvantage of being difficult to provide the same performance and user experience as native apps. Native apps must be developed in different languages depending on the platform. iOS must be developed using Swift with Xcode, while Android must be developed using Java or Kotlin with Android Studio. You must develop screens and features to be provided to users in the native app, and the more screens and features there are, the longer the development period takes. To distribute a new version of a native app, you must register the new version on the store and undergo a review. In other words, it takes several days or more to distribute a new version with bugs and other issues fixed. As a solution to this, a native app development method with embedded WebViews has emerged. This method combines the advantages of web apps and native apps, enabling developers to efficiently develop cross-platform applications. However, due to the lack of an efficient communication system between WebViews and native apps, there were limitations to the interaction between the two platforms. This resulted in constraints on the functional scalability and user experience improvement of web apps. Therefore, a new technical approach is needed to enable seamless communication between web apps and native apps, thereby increasing development productivity and improving the user experience. There are difficulties in developing and distributing native apps that run on a platform. To develop a native app that operates on a platform, one must learn a programming language. This requires time to learn the language. Furthermore, additional time is required to learn a new language to develop native apps for other platforms. Additionally, extra development time is needed depending on the screens and features the native app supports for the user. Development time can be reduced by providing web apps via a WebView within the native app. To distribute a native app with modified screens or features provided to users, it must pass a review by each platform's store. Since passing the review takes several days, troubleshooting errors also requires several days. Distribution time can be reduced by serving the web app via a WebView instead of the native app. There are difficulties in transmitting messages between web apps and native apps. Message transmission between web apps running within a WebView embedded in a native app has traditionally been provided in the form of simply sending strings. Development productivity must be enhanced through seamless communication between the two domains by distinguishing meaningful information and establishing protocols for transmission methods. FIG. 1 is a diagram illustrating the structure between a native app and a web app to which an embodiment of the present invention is applied. FIG. 2 is a diagram illustrating the process of initializing a bridge protocol between a native app and a web app executed in a webview embedded within the native app, according to one embodiment of the present invention. FIG. 3 is a diagram illustrating the process (action) of communicating from the web to a native app via a bridge protocol according to an embodiment of the present invention. FIG. 4 is a diagram illustrating the process (event) of communicating from a native app to a web app via a bridge protocol according to an embodiment of the present invention. FIG. 5 is a diagram showing information on data received when communicating from a web app to a native app and from a native app to a web app according to an embodiment of the present invention. FIG. 6 is a diagram showing the handling process of a bridge version according to one embodiment of the present invention. FIG. 7 is a configuration diagram of a message communication device of a bridge for linking between a native app and a web app according to an embodiment of the present invention. The present invention is capable of various modifications and may have various embodiments; specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, and it should be understood that it