A method and device for implementing sharing
By initializing and registering dependent components, using the unified sharing method of basic components, free selection and customization of sharing channels are achieved, solving the problems of high access costs and fixed sharing channels in the existing technology, reducing the size of the compiled package and Review risks.
Patent Information
- Application Number
- CN202010274528.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-09
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-04-09
AI Technical Summary
The official SDK for accessing sharing channels in the prior art increases the access cost, and the sharing channels provided by the sharing components are fixed and cannot be customized, resulting in an increase in compilation package and may exceed the application platform restrictions, resulting in failure to pass the review.
By initializing the dependent components, selecting and registering sharing channels, calling the unified sharing methods provided by the basic components, displaying and executing the sharing operations of the target sharing channels, free selection and customization of sharing channels are achieved.
Save development and maintenance costs, reduce the size of the compiled package, realize customization of sharing channels, and avoid auditing issues caused by the package size exceeding the limit.
Smart Images

Figure CN113535185B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a sharing implementation method and device. Background Art
[0002] A mature market-oriented application usually includes a sharing function, which allows users to easily promote products or enrich application usage. At present, there are various sharing channels, such as WeChat, Sina, QQ, etc. Each sharing channel will share an SDK (software development kit) for application access. Using different sharing channels requires calling different channel methods, and when some channel SDKs are updated, the corresponding access channels must also be updated at the same time. There are also sharing components that encapsulate some sharing channels for people to call, and the sharing method calls are unified into one method. The specific sharing channel is judged internally through logic, and the corresponding channel method is called. However, the sharing channels contained in these components are fixed and not necessarily very suitable for a certain application. For example, an application only wants to use one or several sharing channels, but the sharing channels encapsulated by the component are very complete.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] Accessing the corresponding sharing channel official SDK increases the access cost. After the sharing channel official maintains or updates the corresponding SDK, the user needs to update the corresponding SDK or code to ensure that the sharing method is available, which increases the access and maintenance costs.
[0005] With the existing packaged sharing components, applications cannot choose sharing channels from them and can only receive all of them in a package, which leads to redundancy in the application compilation package, increases the size of the compilation package, and makes it impossible to customize the sharing channels. If it exceeds the application platform restrictions, there is a risk of failure in the review. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides a sharing implementation method and device, which can realize the free selection of sharing channels on the basis of saving development access costs and maintenance costs, and users can customize sharing channels, thereby solving the problem of fixed sharing channels provided by existing sharing components, reducing the size of the compiled package, and preventing the installation package from being rejected due to the size of the installation package exceeding the application platform limit.
[0007] To achieve the above objective, according to one aspect of an embodiment of the present invention, a sharing implementation method is provided.
[0008] A sharing implementation method includes: initializing one or more dependent components to select sharing channels corresponding to the one or more dependent components; calling a sharing method provided by a basic component to display the selected sharing channel; after receiving a sharing instruction from a user for a target sharing channel in the displayed sharing channels, executing the sharing method of the target sharing channel to complete the sharing operation.
[0009] Optionally, the initialization of one or more dependent components to select the sharing channels corresponding to the one or more dependent components includes: initializing the one or more dependent components separately, wherein, when initializing each of the dependent components, calling the registration channel method provided by the basic component to add the sharing channel corresponding to the dependent component to the sharing channel array, thereby selecting the sharing channel corresponding to the dependent component.
[0010] Optionally, before initializing one or more dependent components, the method includes: in each of the dependent components, establishing a subclass of the sharing channel corresponding to the dependent component, the subclass inheriting the base class to which the sharing method provided by the basic component belongs; and implementing the sharing method of the sharing channel corresponding to the dependent component in the subclass.
[0011] Optionally, before displaying the selected sharing channel, it is confirmed that the sharing channel corresponding to the dependent component is a sharing channel supported by the basic component according to a subclass of the sharing channel corresponding to the dependent component.
[0012] Optionally, it further includes: implementing a sharing callback method of a corresponding sharing channel in the dependent component; after the sharing operation is completed, it further includes: executing a sharing callback method of the target sharing channel.
[0013] According to another aspect of an embodiment of the present invention, a sharing implementation device is provided.
[0014] A sharing implementation device includes: a sharing channel selection module, which is used to initialize one or more dependent components to select the sharing channels corresponding to the one or more dependent components; a sharing channel display module, which is used to call the sharing method provided by the basic component to display the selected sharing channel; and a sharing operation execution module, which is used to execute the sharing method of the target sharing channel after receiving a sharing instruction from a user to a target sharing channel in the displayed sharing channels to complete the sharing operation.
[0015] Optionally, the sharing channel selection module is also used to: initialize the one or more dependent components respectively, wherein, when initializing each dependent component, call the registration channel method provided by the basic component to add the sharing channel corresponding to the dependent component to the sharing channel array, thereby selecting the sharing channel corresponding to the dependent component.
[0016] Optionally, it also includes a dependent component implementation module, which is used to: in each of the dependent components, establish a subclass of the sharing channel corresponding to the dependent component, the subclass inherits the base class to which the sharing method provided by the basic component belongs; and implement the sharing method of the sharing channel corresponding to the dependent component in the subclass.
[0017] Optionally, a sharing channel verification module is further included, which is used to confirm that the sharing channel corresponding to the dependent component is a sharing channel supported by the basic component according to the subclass of the sharing channel corresponding to the dependent component before displaying the selected sharing channel.
[0018] Optionally, the dependent component implementation module is further used to: implement a sharing callback method of a corresponding sharing channel in the dependent component; the sharing operation execution module is further used to: execute the sharing callback method of the target sharing channel after the sharing operation is completed.
[0019] According to yet another aspect of the embodiments of the present invention, an electronic device is provided.
[0020] An electronic device includes: one or more processors; and a memory for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the sharing implementation method provided in an embodiment of the present invention.
[0021] According to yet another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0022] A computer readable medium stores a computer program, which, when executed by a processor, implements the sharing implementation method provided in an embodiment of the present invention.
[0023] An embodiment of the above invention has the following advantages or beneficial effects: initializing one or more dependent components to select the sharing channels corresponding to the one or more dependent components; calling the sharing method provided by the basic component to display the selected sharing channel; after receiving the user's sharing instruction for the target sharing channel in the displayed sharing channel, executing the sharing method of the target sharing channel to complete the sharing operation. On the basis of saving development access costs and maintenance costs, it is possible to freely select sharing channels, and users can customize sharing channels, which solves the problem of fixed sharing channels provided by existing sharing components, reduces the size of the compiled package, and prevents the review from failing due to the size of the installation package exceeding the application platform limit.
[0024] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0026] Figure 1 is a schematic diagram of main steps of a sharing implementation method according to an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram of a sharing implementation process according to an embodiment of the present invention;
[0028] Figure 3 is a schematic diagram of main modules of a sharing implementation device according to an embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of the framework of a sharing implementation device according to an embodiment of the present invention;
[0030] Figure 5 is a schematic diagram of a sharing module implementation process of a basic part according to an embodiment of the present invention;
[0031] Figure 6 is a schematic diagram of an implementation flow of a dependent part according to an embodiment of the present invention;
[0032] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0033] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0035] Figure 1 It is a schematic diagram of main steps of a sharing implementation method according to an embodiment of the present invention.
[0036] like Figure 1 As shown, a sharing implementation method according to an embodiment of the present invention mainly includes the following steps S101 to S103.
[0037] Step S101: Initialize one or more dependent components to select sharing channels corresponding to the one or more dependent components.
[0038] Step S102: calling the sharing method provided by the basic component to display the selected sharing channel.
[0039] Step S103: after receiving a sharing instruction from the user for a target sharing channel among the displayed sharing channels, executing a sharing method of the target sharing channel to complete the sharing operation.
[0040] Among them, a sharing method and a registration channel method are provided in the basic component. The sharing method provided by the basic component of the embodiment of the present invention is a unified sharing method, the purpose of which is to reduce access costs and maintenance costs, and the basic component of the embodiment of the present invention does not include any SDK for sharing channels. In addition to providing a unified sharing method, it only adds a base class for sharing channels. The function of this base class is to provide identity proof of the sharing channel. As long as it is a class that inherits this protocol, it can indicate that the sharing channel corresponding to this class is a sharing channel supported by the basic component.
[0041] The basic components also provide supported sharing data types, as well as processing functions such as obtaining the sharing panel status, canceling sharing, and intercepting the jump method between APPs (applications).
[0042] Dependent components correspond to sharing channels one by one. When customizing sharing channels, you only need to customize the corresponding dependent components. In the dependent components, you need to strongly depend on the basic components and create a subclass that inherits the base class of the sharing method provided by the basic component and implements the relevant sharing methods.
[0043] When selecting one or several sharing channels from the defined sharing channels, you only need to initialize the corresponding dependent components.
[0044] In one embodiment, one or more dependent components are initialized to select the sharing channels corresponding to the one or more dependent components, specifically including: initializing one or more dependent components separately, wherein when each dependent component is initialized, a registration channel method provided by the basic component is called to add the sharing channel corresponding to the dependent component to the sharing channel array, thereby selecting the sharing channel corresponding to the dependent component.
[0045] In one embodiment, before initializing one or more dependent components, a subclass of the sharing channel corresponding to the dependent component is established in each dependent component, and the subclass inherits the base class to which the sharing method provided by the basic component belongs; the sharing method of the sharing channel corresponding to the dependent component is implemented in the subclass.
[0046] Before displaying the selected sharing channel, the sharing channel corresponding to the dependent component can be confirmed to be a sharing channel supported by the basic component according to the subclass of the sharing channel corresponding to the dependent component. Specifically, if the subclass inherits the corresponding base class in the basic component, it means that the sharing channel is a sharing channel supported by the basic component.
[0047] In one embodiment, a sharing callback method of a corresponding sharing channel may also be implemented in a dependent component.
[0048] After completing the sharing operation, you can also execute the sharing callback method of the target sharing channel.
[0049] Figure 2 It is a schematic diagram of the sharing implementation process according to an embodiment of the present invention.
[0050] like Figure 2 As shown, the sharing implementation process of an embodiment of the present invention includes steps S201 to S207.
[0051] Step S201: Initialize the sharing channel array;
[0052] The sharing channels in the sharing channel array are added through dependency component initialization.
[0053] The basic components can be divided into three small modules according to their functions: channel module, data module, and sharing module. The channel module provides a base class that can be inherited. This class provides methods for returning current channel data and sharing callbacks. As long as you create a subclass and implement the parent class method (the relevant methods of the base class, such as the sharing method, etc.), it can be used as a sharing channel; the role of the data module is to provide supported sharing data types; the sharing module provides registration channels, unified sharing methods, sharing panel status acquisition, sharing cancellation, and interception and processing of jump methods between apps.
[0054] You can initialize the sharing channel array after initializing the sharing module of the basic component.
[0055] Step S202: calling the sharing method provided by the basic component;
[0056] Step S203: Obtain sharing channel array;
[0057] Step S204: displaying a sharing interface;
[0058] Step S205: receiving a sharing instruction from a user for a certain sharing channel in the sharing interface;
[0059] For example, when a user clicks a sharing channel button on the sharing interface, it means that a sharing instruction for the sharing channel has been issued.
[0060] Step S206: running the sharing method implemented by the channel subclass through the channel identifier;
[0061] The channel identifier is used to identify the sharing channel in the sharing channel array.
[0062] Step S207: After the sharing operation is completed, if there is a sharing callback method, the sharing callback method is called to complete the sharing process.
[0063] The sharing callback method is mainly used to implement some actions after the sharing operation, such as a pop-up window prompting the user that the sharing is completed, etc.
[0064] Figure 3 It is a schematic diagram of main modules of a sharing implementation device according to an embodiment of the present invention.
[0065] like Figure 3 As shown, a sharing implementation device 300 according to an embodiment of the present invention mainly includes: a sharing channel selection module 301 , a sharing channel display module 302 , and a sharing operation execution module 303 .
[0066] The sharing channel selection module 301 is used to initialize one or more dependent components to select the sharing channels corresponding to the one or more dependent components.
[0067] The sharing channel display module 302 is used to call the sharing method provided by the basic component to display the selected sharing channel.
[0068] The sharing operation execution module 303 is used to execute the sharing method of the target sharing channel after receiving a sharing instruction from the user to a target sharing channel among the displayed sharing channels, so as to complete the sharing operation.
[0069] In one embodiment, the sharing channel selection module 301 is specifically used to initialize one or more dependent components respectively, wherein when each dependent component is initialized, the registration channel method provided by the basic component is called to add the sharing channel corresponding to the dependent component to the sharing channel array, thereby selecting the sharing channel corresponding to the dependent component.
[0070] In one embodiment, the sharing implementation device 300 also includes a dependent component implementation module, which is used to: in each dependent component, establish a subclass of the sharing channel corresponding to the dependent component, the subclass inherits the base class to which the sharing method provided by the basic component belongs; and implement the sharing method of the sharing channel corresponding to the dependent component in the subclass.
[0071] In one embodiment, the sharing implementation device 300 further includes a sharing channel verification module, which is used to confirm that the sharing channel corresponding to the dependent component is a sharing channel supported by the basic component according to the subclass of the sharing channel corresponding to the dependent component before displaying the selected sharing channel.
[0072] In one embodiment, the dependent component implementation module may also be used to: implement a sharing callback method of a corresponding sharing channel in the dependent component.
[0073] The sharing operation execution module 303 may also be used to: after completing the sharing operation, execute the sharing callback method of the target sharing channel.
[0074] In addition, the specific implementation content of the sharing implementation device in the embodiment of the present invention has been described in detail in the above-described sharing implementation method, so the repeated content will not be described again here.
[0075] Figure 4 It is a schematic diagram of the framework structure of a sharing implementation device according to an embodiment of the present invention.
[0076] like Figure 4 As shown, the sharing implementation device of one embodiment of the present invention is specifically implemented as a sharing component, wherein the basic part of the sharing component (hereinafter referred to as the basic part) is the basic component, and the dependent part of the sharing component (hereinafter referred to as the dependent part) is the dependent component. The embodiment of the present invention decouples the basic part and the dependent part of the sharing component.
[0077] This embodiment provides a unified sharing method in the basic part, thereby reducing access cost and maintenance cost.
[0078] Existing sharing components are all SDKs that integrate various sharing channels, which leads to redundancy in the application compilation package and increases the size of the compilation package. However, the basic part of this embodiment does not include any SDK of any sharing channel. In addition to providing a unified sharing method, it only adds a base class of a sharing channel. The function of this base class is to provide identity proof of the sharing channel. As long as it is a class that inherits this protocol, it can be indicated that this class is a sharing channel supported by the present invention. The sharing component of the embodiment of the present invention overcomes the above-mentioned defects of the sharing component of the prior art.
[0079] The basic part of this embodiment can specifically include three small modules: a channel module, a data module, and a sharing module. Among them, the channel module provides a base class that can be inherited. This class provides a method for returning the current channel data and a sharing callback method. As long as a subclass is created and the parent class method (the relevant method of the base class, such as the sharing method, etc.) is implemented, it can be used as a sharing channel; the function of the data module is to provide the data type that can be supported for sharing; the sharing module provides registration channels, a unified sharing method, sharing panel status acquisition, sharing cancellation, and interception processing of the jump method between apps.
[0080] The implementation process of the basic sharing module is as follows Figure 5As shown, it includes: initializing the sharing module; initializing the sharing channel array; calling the sharing method (the sharing method here refers to the unified sharing method provided by the basic component); obtaining the sharing channel array; and displaying the sharing interface.
[0081] The implementation process of the dependent part is as follows Figure 6 As shown, the dependent part of the embodiment of the present invention decouples each sharing channel, creates a subclass in each dependent component that inherits the base class of the channel module of the basic part, and implements relevant methods. The role of this subclass is to allow the basic component to verify its identity to indicate that this dependent component is one of the sharing channels supported by the basic part, thereby solving the problem that the sharing channels of the sharing components in the prior art are fixed and cannot be customized. The embodiment of the present invention calls the registration channel method of the sharing module of the basic component when the subclass is initialized, and adds the sharing channel to the sharing channel array supported by the basic component. When the user wants to add a customized sharing channel, the implementation is very convenient. In implementing a customized dependent component, it is necessary to strongly depend on the basic component, create a subclass that inherits the channel module of the basic component ( Figure 6 The dependent channel in represents the subclass) and implements related methods. The sharing callback method of the subclass is the actual calling method of the channel. If the SDK includes the sharing channel, the corresponding SDK must also be introduced.
[0082] The custom sharing channel function of the embodiment of the present invention is an open mode different from the sharing component of the prior art, which allows users to add sharing channels needed for their own business in addition to the existing sharing channels provided by the sharing component of the embodiment of the present invention. In the sharing component of the prior art, since custom sharing channels are not provided, for developers who have already connected to some sharing channels, if they want to add new sharing channels, they will face the risk of rewriting related codes, and may even have to reconstruct their code architecture. However, in the embodiment of the present invention, if the user wants to add a sharing channel, there is no need to change the calling method in the original code, but only to add a custom channel name when entering the parameters. This greatly reduces the access cost and maintenance cost, and realizes the function of user-defined sharing channels, and the implementation method is more flexible.
[0083] Figure 7 An exemplary system architecture 700 is shown to which the sharing implementation method or sharing implementation apparatus according to the embodiment of the present invention can be applied.
[0084] like Figure 7As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0085] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0086] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0087] The server 705 may be a server that provides various services, such as a backend management server (only for example) that supports shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only for example) to the terminal device.
[0088] It should be noted that the sharing implementation method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the sharing implementation device is generally set in the server 705 .
[0089] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0090] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device or server suitable for implementing an embodiment of the present application. Figure 8 The terminal device or server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0091] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0092] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0093] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present application are executed.
[0094] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0095] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0096] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor including a sharing channel selection module, a sharing channel display module, and a sharing operation execution module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the sharing channel selection module may also be described as "a module for initializing one or more dependent components to select the sharing channels corresponding to the one or more dependent components."
[0097] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: initializing one or more dependent components to select the sharing channels corresponding to the one or more dependent components; calling the sharing method provided by the basic component to display the selected sharing channel; after receiving the user's sharing instruction for the target sharing channel in the displayed sharing channels, executing the sharing method of the target sharing channel to complete the sharing operation.
[0098] According to the technical solution of the embodiment of the present invention, one or more dependent components are initialized to select the sharing channels corresponding to the one or more dependent components; the sharing method provided by the basic component is called to display the selected sharing channel; after receiving the user's sharing instruction for the target sharing channel in the displayed sharing channel, the sharing method of the target sharing channel is executed to complete the sharing operation. On the basis of saving development access costs and maintenance costs, it is possible to freely select sharing channels, and users can customize sharing channels, which solves the problem of fixed sharing channels provided by existing sharing components, reduces the size of the compiled package, and prevents the review from failing due to the size of the installation package exceeding the application platform limit.
[0099] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A sharing implementation method, characterized in that: include: Before initializing one or more dependent components, in each dependent component, a subclass of a sharing channel corresponding to the dependent component is established, wherein the subclass inherits the base class to which the sharing method provided by the basic component belongs; and the sharing method of the sharing channel corresponding to the dependent component is implemented in the subclass; Initialize one or more dependent components respectively, wherein when initializing each dependent component, call the registration channel method provided by the basic component to add the sharing channel corresponding to the dependent component to the sharing channel array, so as to select the sharing channel corresponding to the dependent component; Calling the sharing method provided by the basic component to display the selected sharing channel; before displaying the selected sharing channel, confirming that the sharing channel corresponding to the dependent component is a sharing channel supported by the basic component according to the subclass of the sharing channel corresponding to the dependent component; After receiving a sharing instruction from the user for a target sharing channel among the displayed sharing channels, the sharing method of the target sharing channel is executed to complete the sharing operation.
2. The method according to claim 1, characterized in that Also includes: Implementing the sharing callback method of the corresponding sharing channel in the dependent component; After the sharing operation is completed, the method further includes: executing a sharing callback method of the target sharing channel.
3. A sharing implementation device, characterized in that: include: The dependent component implementation module is used to: establish a subclass of the sharing channel corresponding to the dependent component in each dependent component, wherein the subclass inherits the base class to which the sharing method provided by the basic component belongs; and implement the sharing method of the sharing channel corresponding to the dependent component in the subclass; A sharing channel selection module, used to respectively initialize one or more dependent components, wherein when each dependent component is initialized, a registration channel method provided by the basic component is called to add the sharing channel corresponding to the dependent component to the sharing channel array, thereby selecting the sharing channel corresponding to the dependent component; The sharing channel display module is used to call the sharing method provided by the basic component to display the selected sharing channel; A sharing operation execution module, configured to execute a sharing method of a target sharing channel among the displayed sharing channels after receiving a sharing instruction from a user to the target sharing channel, so as to complete the sharing operation; The sharing channel verification module is used to confirm that the sharing channel corresponding to the dependent component is a sharing channel supported by the basic component according to the subclass of the sharing channel corresponding to the dependent component before displaying the selected sharing channel.
4. The device according to claim 3, characterized in that The dependent component implementation module is further used to: implement a sharing callback method of a corresponding sharing channel in the dependent component; The sharing operation execution module is further used to: after the sharing operation is completed, execute the sharing callback method of the target sharing channel.
5. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 2.
6. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 2 is implemented.
Citation Information
Patent Citations
Data sharing method and device, computer device and storage medium
CN110119277A
Block chain punctuation code cryptography and application scene thereof
CN110166517A
Modularized merge compiling method and device, equipment and storage medium
CN110457045A
Interest graph-powered feed
US20140280121A1
System and method for identifying and ranking trending named entities in digital content objects
US20180032636A1
