After the report is successfully filled out, sending a message to the APP will prompt that the data has been updated. During the second time, the user needs to have the permission to view the template. If not, the prompt information cannot be received. So in FineReport mobile terminal, how to push APP messages manually?
specific usage
Add js to the event after the report is successfully filled out , and use ajac 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: 'The report is successful, template A has data updated', url: 'http://192.168.1.120:8033/WebReport/ReportServer?reportlet=app.cpt&op=write',title: 'app'}, success: function(msg){ alert( "Alert" + msg ); } });
User : The person who receives the message, which can be multiple, separated by commas, such as "A, B" (required)
Text : message content (required)
Url : open the address (optional), enter the address where the app is opened after clicking the message
Title : The title of the page where the address is opened (optional)
Example
Effect 1. Pushing plain text messages
Fill in the template, add a successful 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: 'The report is successful, template A has data updated'}, success: function(msg){ alert( "Alert" + msg ); } });
Effect 2. After clicking on the message, enter the app and open the address page
Fill in the template, add a successful 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: 'The report is successful, template A has data updated', url: 'http://192.168.1.120:8033/WebReport/ReportServer?reportlet=app.cpt&op=write',title: 'app'}, success: function(msg){ alert( "Alert" + msg ); } });