[英]The push notification format of Pushwoosh and Phonegap
現在,pushwoosh可以正常工作了。 我可以在Android手機的左上角看到通知。 即使手機處於靜音模式,我如何將通知設置為彈出到屏幕上而不是僅顯示在左上角!
我應該采用哪種方式進行定制? 謝謝
function pwCall( $action, $data = array() ) {
$url = 'https://cp.pushwoosh.com/json/1.3/' . $action;
$json = json_encode( array( 'request' => $data ) );
$res = doPostRequest( $url, $json, 'Content-Type: application/json' );
print_r( @json_decode( $res, true ) ); }
pwCall( 'createMessage', array( '
application' => PW_APPLICATION,
'auth' => PW_AUTH,
'notifications' => array(
array(
'send_date' => 'now',
'content' => 'test',
'ios_badges' => 3,
'data' => array( 'custom' => 'json data' ),
'link' => 'http://pushwoosh.com/'
)
)
)
);
要配置如何顯示傳入的推送通知,您應按照此頁面的說明在Android應用程序的接收器中編寫自己的邏輯。
當前,該教程當前使用以下顯示消息:
private void showMessage(String message)
{
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
}
嘗試在函數中創建自己的邏輯(用戶界面,彈出方法和計時等)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.