FineReport如何手動(dòng)推送APP消息
在報(bào)表填報(bào)成功后,發(fā)送消息至APP會(huì)提示數(shù)據(jù)已更新。再次期間用戶需要有查看該模板的權(quán)限,如果沒有的話,則無法接受到提示信息。那么在FineReport移動(dòng)端中,如何手動(dòng)推送APP消息呢?
具體用法
在報(bào)表填報(bào)成功后事件中添加js,使用ajac發(fā)送消息請(qǐng)求
FR.ajax({
url: 'http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_messages&op=fs_mobile_main',
type: 'POST',
data: {user:'sunlin', text:'填報(bào)成功,模板A有數(shù)據(jù)更新',url:'http://192.168.1.120:8033/WebReport/ReportServer?reportlet=app.cpt&op=write',title:'app'},
success: function(msg){
alert( "提示" + msg );
}
});
url: 'http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_messages&op=fs_mobile_main',
type: 'POST',
data: {user:'sunlin', text:'填報(bào)成功,模板A有數(shù)據(jù)更新',url:'http://192.168.1.120:8033/WebReport/ReportServer?reportlet=app.cpt&op=write',title:'app'},
success: function(msg){
alert( "提示" + msg );
}
});
User:接受消息的人,可以是多個(gè),多個(gè)用戶之間用逗號(hào)分割,如“A,B”(必填)
Text:消息內(nèi)容(必填)
Url:打開地址(選填),在點(diǎn)擊消息之后進(jìn)入app打開的地址
Title:打開地址的頁(yè)面標(biāo)題(選填)
示例
效果一、推送純文本消息
填報(bào)的模板,增加填報(bào)成功事件,示例代碼如下:
FR.ajax({
url: 'http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_messages&op=fs_mobile_main',
type: 'POST',
data: {user:'sunlin', text:'填報(bào)成功,模板A有數(shù)據(jù)更新'},
success: function(msg){
alert( "提示" + msg );
}
url: 'http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_messages&op=fs_mobile_main',
type: 'POST',
data: {user:'sunlin', text:'填報(bào)成功,模板A有數(shù)據(jù)更新'},
success: function(msg){
alert( "提示" + msg );
}
});
效果二、點(diǎn)擊消息后,進(jìn)入app,并且打開地址頁(yè)面
填報(bào)的模板,增加填報(bào)成功事件,示例代碼如下:
FR.ajax({
url: 'http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_messages&op=fs_mobile_main',
type: 'POST',
data: {user:'sunlin', text:'填報(bào)成功,模板A有數(shù)據(jù)更新',url:'http://192.168.1.120:8033/WebReport/ReportServer?reportlet=app.cpt&op=write',title:'app'},
success: function(msg){
alert( "提示" + msg );
}
});
url: 'http://192.168.1.120:8033/WebReport/ReportServer?cmd=send_messages&op=fs_mobile_main',
type: 'POST',
data: {user:'sunlin', text:'填報(bào)成功,模板A有數(shù)據(jù)更新',url:'http://192.168.1.120:8033/WebReport/ReportServer?reportlet=app.cpt&op=write',title:'app'},
success: function(msg){
alert( "提示" + msg );
}
});
posted on 2017-01-19 10:39 喝水居然長(zhǎng)肉 閱讀(135) 評(píng)論(0) 編輯 收藏