How to customize the push Received from onesignal.com?

时间:2016-02-12 20:31:35

标签: android onesignal

I USE THES SORCE for get and show notfication but this coode not customize . i need sorce for customized notfication Received from onesignal.com

i need send url by onesignal and Received and show for icon notfication i need send title by onesignal and set title i need send diccription by onesignal and set diccription i need send url and set uri tanks for help

<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
    <style>
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
      #map {
        height: 100%;
      }
    </style>
  </head>
  <body>
    <div id="map"></div>
    <script>
      var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: -34.397, lng: 150.644}, // put your data here 
          zoom: 8
        });
      }
    </script>
    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
    async defer></script>
  </body>
</html>

1 个答案:

答案 0 :(得分:2)

当点击通知时,OneSignal SDK将负责设置标题,图标和打开网址。

默认情况下,当您的应用未关注时,OneSignal将仅在Android的通知区域中显示通知。如果您的应用处于焦点,则会调用NotificationOpenedHandler而不是显示通知。如果您宁愿始终显示通知,则可以在初始化后调用OneSignal.enableNotificationsWhenActive(true);

您也可以删除OneSignal.startInit(this).init();,因为它下面的行也在初始化OneSignal。