Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the application provides an information pushing method, an information pushing device, an electronic device and a storage medium.
In a first aspect, an embodiment of the present application provides an information pushing method, including:
receiving push information;
determining an application program corresponding to the pushing information;
delaying preset time to acquire message push switch state information corresponding to the application program;
and executing corresponding pushing operation according to the state information of the message pushing switch.
In one possible embodiment, the method further comprises:
intercepting a push identifier of the application program when the push identifier is received;
acquiring control operation triggered by a user;
determining the state information of a message push switch corresponding to the application program according to the control operation;
and when the message push switch state information is on, sending the push identification to the application program.
In one possible embodiment, the method further comprises:
when the application program is in a running state and the state information of the message push switch is on, acquiring the closing operation of a user on the message push switch;
turning off the message push switch state information according to the turning-off operation;
and intercepting the push message of the application program.
In a second aspect, an embodiment of the present application further provides an information pushing method, including:
intercepting a push identifier of an application program when the push identifier is received;
acquiring control operation triggered by a user;
determining the state information of a message push switch corresponding to the application program according to the control operation;
and when the message push switch state information is on, sending the push identification to the application program.
In a third aspect, an embodiment of the present application further provides an information pushing method, including:
when the application program is in a running state and the state information of the message push switch is on, acquiring the closing operation of a user on the message push switch;
turning off the message push switch state information according to the turning-off operation;
and intercepting the push message of the application program.
In a fourth aspect, an embodiment of the present application further provides an information pushing apparatus, including:
the receiving module is used for receiving the push information;
the determining module is used for determining an application program corresponding to the push information;
the acquisition module is used for delaying preset time to acquire the state information of the message push switch corresponding to the application program;
and the execution module is used for executing corresponding pushing operation according to the information pushing switch state information.
In a fifth aspect, an embodiment of the present application further provides an information pushing apparatus, including:
the device comprises an interception module, a pushing module and a judging module, wherein the interception module is used for intercepting a pushing identifier of an application program when the pushing identifier is received;
the acquisition module is used for acquiring control operation triggered by a user;
the determining module is used for determining the state information of the message push switch corresponding to the application program according to the control operation;
and the sending module is used for sending the push identification to the application program when the message push switch state information is on.
In a sixth aspect, an embodiment of the present application further provides an information pushing apparatus, including:
the acquisition module is used for acquiring the closing operation of a user on the message push switch when the application program is in the running state and the state information of the message push switch is on;
a generating module, configured to turn off the message push switch state information according to the turning-off operation;
and the interception module is used for intercepting the push message of the application program.
In a seventh aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the above method steps when executing the computer program.
In an eighth aspect, embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, where the computer program is executed by a processor to implement the above method steps.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: the state information of the message push switch corresponding to the application program can be accurately acquired by delaying the preset time, and when the state information is on, the message push can be timely performed on the application program.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The application provides an information pushing method and device, electronic equipment and a storage medium. The method provided by the embodiment of the invention can be applied to any required electronic equipment, for example, the electronic equipment can be electronic equipment such as a server and a terminal, and the method is not particularly limited herein, and is hereinafter simply referred to as electronic equipment for convenience in description. First, an information pushing method provided by an embodiment of the present invention is described below.
Fig. 1 is a flowchart of an information pushing method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S11, receiving push information;
step S12, determining an application program corresponding to the push information;
step S13, obtaining the state information of the message push switch corresponding to the application program by delaying the preset time;
and step S14, executing corresponding push operation according to the message push switch state information.
In this embodiment, when the iOS push server receives a push message sent by a server corresponding to an application program, the pushed application program needs to be determined according to the push message, but at this time, an API of the iOS system is called, so that a state of a message push switch of the application program cannot be directly obtained, so that the push message is intercepted first, and when the application program is in a preset state, state information of the message push switch corresponding to the application program is obtained by delaying a preset time, where the preset state is: the application is being viewed or running in the background. The preset time in this example is 0.5 s.
After the state information of the message push switch is determined, corresponding push operation can be executed on the push information according to the state information of the message push switch. Such as: when the state information of the message pushing switch is on, the pushing message is sent to the corresponding application program; or when the state information of the message push switch is closed, caching the push message, and acquiring the state of the message push switch at regular time, and when the state information of the message push switch is opened, sending the push message to the corresponding application program.
In another embodiment of the present application, the inventor further finds that when an application is installed on an iOS system for the first time, whether to allow information push is actively sent to a user, if the user does not operate the application, the application sends an access request to an iOS push server to obtain a push identifier of the application, and after the application receives the push identifier, a developer may send the push identifier to a server corresponding to the application, and the server may push a message according to the push identifier, which is imperceptible to the user.
Therefore, another embodiment of the present application provides an information pushing method to solve the above problem, and fig. 2 is a flowchart of an information pushing method provided in another embodiment of the present application, as shown in fig. 2, the method further includes the following steps:
step S21, intercepting the push identification when receiving the push identification of the application program;
step S22, acquiring control operation triggered by a user;
step S23, determining the information push switch state information corresponding to the application program according to the control operation;
and step S24, when the message push switch status information is on, sending the push identification to the application program.
In this embodiment, when the application is installed for the first time, the received push identifier of the application is intercepted and cached, and when the application is in a preset state, a control operation triggered by a user is obtained, where in this embodiment, the preset state may be: the application program is being browsed or running in the background, and the control operation can be clicking, sliding and the like.
And generating a corresponding control instruction according to the control operation, wherein the control instruction is used for controlling the state of the message push switch. In this embodiment, when it is determined that the message push switch state information corresponding to the application program is on according to the control operation, the push identifier is sent to the application program.
Or when the state information of the message push switch corresponding to the application program is determined to be closed according to the first control operation, the state information of the message push switch is acquired in real time until a second control operation triggered by the user is monitored, and when the state information of the message push switch corresponding to the application program is determined to be opened according to the second control operation, the cached push identification is released to the application program.
In this embodiment, the intercepted push identifier is only released when the user allows receiving, so that the user can be effectively prevented from receiving the push message without being aware of the push message.
In another embodiment of the present application, the inventor further finds that in the iOS system, after the message push switch corresponding to the application program is turned off when the application program is running, the application program can receive the push message, which goes against the original intention of the user, thereby resulting in poor user experience.
Therefore, another embodiment of the present application provides an information pushing method to solve the above problem, and fig. 3 is a flowchart of an information pushing method provided in another embodiment of the present application, as shown in fig. 3, the method further includes the following steps:
step S31, when the application program is in running state and the message push switch state information is on, obtaining the closing operation of the user to the message push switch;
step S32, changing the message push switch status information to off according to the closing operation;
and step S33, intercepting the push message of the application program.
In this embodiment, when a push message sent by an iOS push server is received, an application program corresponding to the push message is determined, if the application program is currently in an operating state, a preset time is delayed to obtain state information of a message push switch corresponding to the application program, if the message push switch is in an on state, a closing operation of a user on the message push switch is obtained, and a closing instruction is generated according to the closing operation, and the closing instruction is used to turn the state information of the message push switch off and intercept the push message of the application program according to the closing instruction.
This embodiment is through the status information of real-time detection message push switch, and when the state of message push switch was for closing, intercept push information, guarantee not bothering the user to followed user's original intention, improved user's use and experienced.
At least two of the three embodiments provided by the present application can be implemented in combination with each other.
Fig. 4 is a block diagram of an information pushing apparatus provided in an embodiment of the present application, where the apparatus may be implemented as part of or all of an electronic device through software, hardware, or a combination of the two.
As shown in fig. 4, the apparatus includes:
a receiving module 401, configured to receive push information;
a determining module 402, configured to determine an application program corresponding to the push information;
an obtaining module 403, configured to delay preset time to obtain state information of a message push switch corresponding to an application;
the executing module 404 is configured to execute a corresponding push operation according to the message push switch state information.
Fig. 5 is a block diagram of an information pushing apparatus provided in an embodiment of the present application, where the apparatus may be implemented as part of or all of an electronic device through software, hardware, or a combination of the two.
As shown in fig. 5, the apparatus includes:
the intercepting module 501 is configured to intercept a push identifier of an application program when the push identifier is received;
an obtaining module 502, configured to obtain a control operation triggered by a user;
a determining module 503, configured to determine, according to the control operation, information of a message push switch state corresponding to the application program;
the sending module 504 is configured to send the push identifier to the application program when the message push switch status information is on.
Fig. 6 is a block diagram of an information pushing apparatus provided in an embodiment of the present application, where the apparatus may be implemented as part of or all of an electronic device through software, hardware, or a combination of the two.
As shown in fig. 6, the apparatus includes:
the obtaining module 601 is configured to obtain a closing operation of a message push switch by a user when the application program is in an operating state and the message push switch state information is on;
an executing module 602, configured to turn off the message push switch state information according to a turning-off operation;
the intercepting module 603 is configured to intercept a push message of an application program.
An embodiment of the present application further provides an electronic device, as shown in fig. 7, the electronic device may include: the system comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above embodiments when executing the computer program stored in the memory 1503.
The communication bus mentioned in the electronic device may be a Peripheral component interconnect (pci) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving push information;
determining an application program corresponding to the push information;
delaying preset time to acquire message push switch state information corresponding to an application program;
and executing corresponding pushing operation according to the state information of the message pushing switch.
Optionally, the computer program, when executed by the processor, further implements the steps of:
intercepting a push identifier of an application program when the push identifier is received;
acquiring control operation triggered by a user;
determining the state information of a message push switch corresponding to the application program according to the control operation;
and when the message push switch state information is on, sending the push identification to the application program.
Optionally, the computer program, when executed by the processor, further implements the steps of:
when the application program is in a running state and the state information of the message push switch is on, acquiring the closing operation of a user on the message push switch;
changing the message push switch state information to off according to the closing operation;
and intercepting the push message of the application program.
The computer program when executed by a processor implements the steps of:
intercepting a push identifier of an application program when the push identifier is received;
acquiring control operation triggered by a user;
determining the state information of a message push switch corresponding to the application program according to the control operation;
and when the message push switch state information is on, sending the push identification to the application program.
The computer program when executed by a processor implements the steps of:
when the application program is in a running state and the state information of the message push switch is on, acquiring the closing operation of a user on the message push switch;
changing the message push switch state information to off according to the closing operation;
and intercepting the push message of the application program.
It should be noted that, for the above-mentioned apparatus, electronic device and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
It is further 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.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.