Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a message prompting method, a storage medium, an electronic device and a system for multi-dimensional verification, which can verify the message prompting work more stably under the multi-verification condition and ensure that a user has better use experience.
In order to achieve the above purposes, the technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a message prompting method for multidimensional verification, which includes the following steps:
obtaining return information of a configuration interface function after the app is started, wherein the return information comprises a message returned to the client by the server;
sending a message prompt notification in response to the return information, wherein the message prompt notification comprises a unique character string corresponding to the return information;
screening the message prompt notification by judging whether the sent notification contains the unique character string, monitoring the message prompt notification corresponding to the unique character string by using an addObserver function, and judging whether a callback function of the message prompt notification is executed or not;
if the callback function of the message prompt notification is executed, receiving and displaying the message prompt notification; wherein,
using an addObserver function to monitor the message prompt notification corresponding to the unique character string, and judging whether a callback function of the message prompt notification is executed, wherein the method comprises the following steps:
calling a navigation controller of the app to listen for primary prompt information inside the app;
acquiring a notification center NSNotification center;
monitoring the message prompt notification corresponding to the unique character string by using a defaultCenter function of a notification center NSNotification center for acquiring a default notification;
and judging whether the callback function notified by the message prompt is executed or not through the addObserver function.
On the basis of the technical scheme, before the callback function notified by the message prompt is executed, the method further comprises the following steps:
checking the app version, and judging whether the app is a checking version or not;
and when the app is not the audit version, receiving and displaying the message prompt notification.
On the basis of the technical scheme, after the return information of the configuration interface function after the app is started is obtained, the method further comprises the following steps:
and converting the message returned by the server side to the client side in the returned information into a field through a network request function, taking out a newGame field in the field, and storing the newGame field in a memory by using a variable isGameCenterRedNot.
On the basis of the technical scheme, the app version is checked, and whether the app is the audit version is judged in the operation of:
if the current version number of the app is larger than the online configured version number, the app is represented as an audit version;
and if the current version number of the app is not greater than the online configured version number, indicating that the app is not a review version.
On the basis of the technical scheme, the unique character string is SHOW _ GAREECOMMEND _ RED.
On the basis of the technical scheme, when the message prompt notification is received and displayed, the method further comprises the following steps:
calling a judggetToShowOrHide function to judge whether the red point needs to be displayed;
when red dot display is needed, determining the position needing the red dot display;
and calling a showBadgeOnitemeIndex method to display the red point.
The showBadgeOnitemeIndex method is a self-defined function and is used for displaying red points.
In a second aspect, the present invention also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method in the embodiments of the first aspect.
In a third aspect, the present invention further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program running on the processor, and the processor executes the computer program to implement the method in the first aspect.
In a fourth aspect, the present invention further discloses a multidimensional verification message prompting system, which includes:
the system comprises a return information acquisition unit, a configuration interface function acquisition unit and a configuration interface function acquisition unit, wherein the return information acquisition unit is used for acquiring return information of the configuration interface function after app is started, and the return information comprises a message returned to a client by a server;
a message prompt notification unit for issuing a message prompt notification in response to the return information, the message prompt notification including a unique character string corresponding to the return information;
the callback function detection unit is used for judging whether the sent notification contains a unique character string or not, screening out the message prompt notification, monitoring the message prompt notification corresponding to the unique character string by using an addObserver function, and judging whether a callback function of the message prompt notification is executed or not;
the message prompt pushing unit is used for receiving and displaying the message prompt notification if a callback function of the message prompt notification is executed; wherein,
the callback function detection unit is also used for calling a navigation controller of the app to monitor primary prompt information in the app;
the callback function detecting unit is further configured to acquire a notification center NSNotificationCenter;
the callback function detecting unit is further configured to monitor the message prompt notification corresponding to the unique character string by using a default center function of a notification center NSNotificationCenter, which is a method for acquiring a default notification;
the callback function detection unit is further configured to determine whether the callback function notified by the message prompt is executed through the addObserver function.
Compared with the prior art, the invention has the advantages that:
(1) after receiving the message returned by the client side from the server side, the invention verifies whether the message prompt is needed in multiple dimensions, thereby verifying and verifying the message prompt work under the condition of multiple verifications, more stably performing the message prompt work and ensuring that the user has better use experience.
Detailed Description
Interpretation of terms:
addObserver function, addObserver is a method for adding an observer in an Ios system;
a defaultCenter function is a method for an Ios system to acquire a notification center;
a judggettoshworhide function for determining whether the app in the Ios system needs to display a red dot;
a didFinishLannchingWithOptions function for starting an app in the Ios system;
the postnotifiationname method is a method of throwing out a notification in the Ios system.
Embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, embodiments of the present invention provide a message prompting method, a storage medium, an electronic device, and a system for multidimensional verification, which verify a message prompting job under a multi-verification condition, so that the message prompting job is performed more securely, and a better user experience is ensured.
In order to achieve the technical effects, the general idea of the application is as follows:
a multidimensional verified message prompting method is at least based on an IOS system and comprises the following steps:
s1, obtaining return information of the configuration interface function after the app is started, wherein the return information comprises a message returned by the server to the client;
s2, sending out a message prompt notice responding to the return information, wherein the message prompt notice comprises a unique character string corresponding to the return information;
s3, screening out message prompt notifications by judging whether the sent notifications contain unique character strings, monitoring the message prompt notifications corresponding to the unique character strings by using an addObserver function, and judging whether callback functions of the message prompt notifications are executed or not;
and S4, if the callback function of the message prompt notice is executed, receiving the message prompt notice and displaying the message prompt notice.
After receiving the message returned by the client side from the server side, the embodiment of the invention verifies whether the message prompt is needed in a multi-dimensional way, thereby verifying the message prompt work under the multi-verification condition, more stably performing the message prompt work and ensuring that the user has better use experience.
Example one
Referring to fig. 1, a first embodiment of the present invention provides a message prompting method for multidimensional verification, in which:
in step S1, obtaining return information of the configuration interface function after the app is started, where the return information includes a message returned by the server to the client, and the message returned by the server to the client may be information such as a notification that a message prompt needs to be performed, data information provided for the client to process, or a parameter provided for the client to display;
it should be noted that, when the app is started, an app start function is called, the app start function may be a didfinishlaunchwithoptions, and a configuration interface function is called in the start function, and the configuration interface function does not need to input parameters, and there is a return value after the configuration interface function is successfully called, where the return value is actually a code block, and the code block contains three pieces of information, which are respectively an error code, error information, and information data returned by the server to the client, and the return information of the application at least includes the information data returned by the server to the client;
the configuration interface function is used for interface configuration, and may specifically be a get function, and during actual operation, the configuration interface function may be selected according to an actual situation.
Further, after obtaining the return information of the configuration interface function after the app is started:
and converting the message returned by the server side to the client side in the returned information into a field through a network request function, taking out a newGame field in the field, and storing the newGame field in a memory by using a variable isGameCenterRedNot.
In step S2, a message prompting notification is sent in response to the return information, where the message prompting notification includes a unique character string corresponding to the return information, that is, after the return information is obtained, a message prompting notification is sent, and the message prompting notification corresponds to the return information, and in a specific processing manner, the message prompting notification includes the unique character string corresponding to the return information.
As an optional implementation, a method of specifically sending a message prompting notification may be a method of using a postNotificationName, where the postNotificationName is a method of throwing out a notification by an apple system.
As an alternative embodiment, the unique string is SHOW _ gammemend _ RED.
In step S3, the message prompt notification is screened out by determining whether the issued notification includes a unique character string, and the addObserver function is used to monitor the message prompt notification corresponding to the unique character string, and determine whether a callback function of the message prompt notification is executed.
The addObserver is a method for adding an observer in the apple system, the callback function can be a showGameRedNoton function, the showGameRedNoton function can be called when a message prompt notification is received, and the showGameRedNoton function is used for displaying the message prompt, and in specific implementation, when red point prompt is required, the function is used for displaying the red point prompt.
As an optional implementation manner, the operation of monitoring the message prompt notification corresponding to the unique character string by using an addObserver function specifically includes the following steps:
invoking a navigation controller of the app to listen for the primary reminder information inside the app;
acquiring a notification center NSNotification center;
monitoring the message prompt notification corresponding to the unique character string by using a defaultCenter function of a notification center NSNotification center for acquiring a default notification;
judging whether a callback function notified by a message prompt is executed or not through an addObserver function;
the navigation controller can be a tabBar controller which has an initialization method by which the interior can be monitored;
here, the addObserver function is used to monitor the message alert notification corresponding to the unique character string, because the message alert notification corresponding to the unique character string can be monitored only according to the unique character string, and the defaultCenter is a method for the apple system to acquire the notification center.
Specifically, the callback function notified by the message prompt may be showGameRedNoton.
Further, before the callback function notified by the message prompt is executed, the method further includes the following steps:
checking the app version, and judging whether the app is a checking version or not;
when the app is not the audit version, receiving and displaying the message prompt notification;
in actual operation, the version condition can be marked by using a variable showreommend, when the app version is an audit version, the message prompt is not displayed, at this time, the value of the variable showreommend is set to be NO, when the app version is not an audit version, the message prompt is displayed, and when the app version is an audit version, the message prompt YES is not displayed.
Specifically, the app version is checked, and whether the app is the audit version is judged in the operation:
if the current version number of the app is larger than the online configured version number, the app is represented as an audit version;
and if the current version number of the app is not greater than the online configured version number, indicating that the app is not a review version.
It should be noted that when the message prompt is needed, firstly, whether the red dot needs to be displayed is judged;
when red dot display is needed, determining the position needing the red dot display;
and then red dot display is performed.
The specific implementation mode is that when message prompt is needed, a judggetShowOrHide function is called to judge whether red points need to be displayed;
when red dot display is needed, determining the position needing the red dot display;
calling a showBadgeOnitemendex method to display red points;
the number of the self-controllers of the tabBarController controller needs to be obtained, the index value userIndex of the controller is the number of the sub-controllers of the tabBarController minus 1, and the reason for subtracting 1 is that the index value userIndex is 0, and if 4 controllers exist, the corresponding first index value userIndex is 0, and the fourth index value userIndex is 3, so that 1 is subtracted;
and taking the value showReconmend stored by the version starting interface, simultaneously taking the value isGameCenterRedNot of the interface obtained by starting the computer, if the values are YES, the result is not an audit version, and simultaneously, new content needs to display the red point, calling a method showBangOnItemIndex for displaying the red point, and if the judgment is not satisfied, not needing to display the red point.
The showBadgeOnitemeIndex method is a self-defined function and is used for displaying red points.
After receiving the message returned by the client side from the server side, the embodiment of the invention verifies whether the message prompt is needed in a multi-dimensional way, thereby verifying the message prompt work under the multi-verification condition, more stably performing the message prompt work and ensuring that the user has better use experience.
It should be noted that the red dot prompt in this application at least includes a red dot-shaped message prompt appearing on the app identifier when the app needs to perform message prompt.
Based on the same inventive concept, the application provides a multi-dimensional verification message prompting system corresponding to the embodiment, which is detailed in the second embodiment.
Example two
As shown in fig. 2, a second embodiment of the present invention further provides a multidimensional verification message prompting system, which includes:
the system comprises a return information acquisition unit 1, a client and a server, wherein the return information acquisition unit is used for acquiring return information of a configuration interface function after app is started, and the return information comprises a message returned by the server to the client;
a message prompt notification unit 2 for issuing a message prompt notification in response to the return information, the message prompt notification including a unique character string corresponding to the return information;
the callback function detection unit 3 is used for judging whether the sent notification contains a unique character string, screening out the message prompt notification, monitoring the message prompt notification corresponding to the unique character string by using an addObserver function, and judging whether a callback function of the message prompt notification is executed or not;
and the message prompt pushing unit 4 is used for receiving and displaying the message prompt notification if the callback function of the message prompt notification is executed.
After receiving the message returned by the client side from the server side, the embodiment of the invention verifies whether the message prompt is needed in a multi-dimensional way, thereby verifying the message prompt work under the multi-verification condition, more stably performing the message prompt work and ensuring that the user has better use experience.
In the embodiment of the present invention, after determining that the callback function of the message prompt notification is executed, before the callback function of the message prompt notification is executed, the method further includes the following steps:
checking the app version, and judging whether the app is a checking version or not;
and when the app is not the audit version, receiving and displaying the message prompt notification.
In the embodiment of the present invention, after obtaining the return information of the configuration interface function after the app is started, the method further includes the following steps:
and converting the message returned to the client by the server in the returned information into a field through a network request function, taking out the newGame field in the field, and storing the newGame field into a memory by using a variable isGameCenterRedNot.
In the embodiment of the present invention, in the operation of monitoring the message prompt notification corresponding to the unique character string by using the addObserver function, the method specifically includes the following steps:
invoking a navigation controller of the app to listen for the primary reminder information inside the app;
acquiring a notification center NSNotification center;
monitoring the message prompt notification corresponding to the unique character string by using a defaultCenter function of a notification center NSNotification center for acquiring a default notification;
and judging whether the callback function notified by the message prompt is executed or not through the addObserver function.
In the embodiment of the present invention, the app version is checked, and whether the app is the audit version is determined in the operation of:
if the current version number of the app is larger than the version number configured on the line, the app is represented as an audit version;
and if the current version number of the app is not greater than the online configured version number, indicating that the app is not a review version.
In the embodiment of the present invention, the unique string is slow _ game _ RED.
In the embodiment of the present invention, when receiving and displaying the message prompt notification, the method further includes the following steps:
calling a judggetToShowOrHide function to judge whether the red point needs to be displayed;
when red dot display is needed, determining the position needing the red dot display;
calling a showBandgeOnItemIndex method to display the red point, wherein the showBandgeOnItemIndex is a self-defined function which has the function of displaying the red point.
Based on the same inventive concept, the present application provides an embodiment of a storage medium corresponding to the embodiment described in the third embodiment
EXAMPLE III
A third embodiment of the invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out all or part of the method steps of the first embodiment.
The present invention can implement all or part of the flow in the method of the first embodiment, and can also be implemented by instructing related hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments can be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, in accordance with legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunications signals.
Based on the same inventive concept, the present application provides an embodiment of an electronic device corresponding to the first embodiment, which is detailed in the fourth embodiment
Example four
The fourth embodiment of the present invention further provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program running on the processor, and the processor executes the computer program to implement all or part of the method steps in the first embodiment.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center of the computer device and the various interfaces and lines connecting the various parts of the overall computer device.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the computer device by executing or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.