App message push for mobile development

Source: Internet
Author: User

There is a scenario where you enter your message on the mobile app and automatically jump out of a pop-up window to indicate that a task has been executed. The simplest example is when you enter the phone number, click Get Verification code, you will jump out of a dialog box, said "Verification code has been sent to the phone, please check", these are how to achieve.

As an example of a mobile report I'm involved in developing, let's take a look at how to develop a manual push app message Finereport.

This app has such an application, it is possible to fill in the client input data, and then upload data to the database of such a function, that is, the so-called mobile office, which in the Enterprise office use more. When the data entry system succeeds, the message is automatically sent to the app prompting data has been updated.

The implementation of this feature is to add JS in the event of a successful data entry, using AJAX to send a message request

Fr.ajax ({url: ' Http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_messages&op=fs_mobile_main ', type: ' POST ', data: {User: ' Sunlin ', Text: ' Fill success, template A has data update ', URL: ' Http://192.168.1.120:8033/WebReport/ReportServer?reportlet =app.cpt&op=write ', title: ' App '},success:function (msg) {alert ("hint" + msg);});

User: The person receiving the message, can be multiple, multiple users separated by commas, such as "A, B" (required)

Text: Message content (optional)

URL: Open address (optional), enter the app open address after clicking on the message

Title: Open the page title of the address (optional)

Example

Example 1, push plain text messages

In the completed template, add the Success event, the sample code is as follows:

fr.ajax ({url: ' Http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_ Messages&op=fs_mobile_main ',type:  ' POST ',  data: {user: ' Sunlin ',  text: ' Fill success, template A has data update '}, Success: function (msg) { alert (  "hint"  + msg );  } }); 

650) this.width=650; "src=" http://img.blog.csdn.net/20160729133824297 "style=" Border:none;color:rgb (54,46,43); Font-family:arial;font-size:14px;line-height:26px;white-space:normal;background-color:rgb (255,255,255); "/>
650) this.width=650; "src=" http://img.blog.csdn.net/20160729133850829 "style=" Border:none;color:rgb (54,46,43); Font-family:arial;font-size:14px;line-height:26px;white-space:normal;background-color:rgb (255,255,255); "/>

Example 2, click on the message, enter the app, and open the Address page

In the background to fill out the template, add success events, the sample code is as follows:

Fr.ajax ({url: ' Http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_messages&op=fs_mobile_main ', type: ' POST ', data: {User: ' Sunlin ', Text: ' Fill success, template A has data update ', URL: ' Http://192.168.1.120:8033/WebReport/ReportServer?reportlet =app.cpt&op=write ', title: ' App '},success:function (msg) {alert ("hint" + msg);});

650) this.width=650; "src=" http://img.blog.csdn.net/20160729133931127 "style=" Border:none;color:rgb (54,46,43); Font-family:arial;font-size:14px;line-height:26px;white-space:normal;background-color:rgb (255,255,255); "/>
650) this.width=650; "src=" http://img.blog.csdn.net/20160729134734895 "style=" Border:none;color:rgb (54,46,43); Font-family:arial;font-size:14px;line-height:26px;white-space:normal;background-color:rgb (255,255,255); "/>


App message push for mobile development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.