title: NotificationExtenderService not firing handleNotificationReceived
body: <p>I am extending <code>NotificationExtenderService</code> inside a Java class as per OneSignal documentation here <a href="https://documentation.onesignal.com/v3.0/docs/android-customizations" rel="nofollow noreferrer">One signal doc</a>, but I realized that returning true prevents the notification from showing. Perfect so far, the problem is I still need to trigger the <code>handleNotificationReceived</code> inside my typescript code.</p>
  
  <p>Here below the Java code extending :</p>
  
  <pre><code>public class NotificationExtenderBareBonesExample extends NotificationExtenderService {
  @Override
  protected boolean onNotificationProcessing(OSNotificationReceivedResult receivedResult) {
      receivedResult.payload.lockScreenVisibility = Integer.parseInt("-1");
      JSONObject data = receivedResult.payload.additionalData;
      OverrideSettings overrideSettings = new OverrideSettings();
      overrideSettings.extender = new NotificationCompat.Extender() {
          @Override
          public NotificationCompat.Builder extend(NotificationCompat.Builder builder) {
              // Sets the background notification color to Green on Android 5.0+ devices.
              builder = builder.setVisibility(Integer.parseInt("-1"));
              builder = builder.setVibrate(new long[]{0L});
              return builder.setColor(new BigInteger("800d2f66", 16).intValue());
          }
      };
      OSNotificationDisplayedResult displayedResult = displayNotification(overrideSettings);
      Log.d("OneSignalExample", "Notification displayed with id: " + displayedResult.androidNotificationId);
      return true;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The issue I am having is that I need to call <code>displayNotification</code> for having my <code>NotificationReceivedHandler</code> triggered (it analyses the additionalData and run portions accordingly).</p>
  
  <p>Ionic 2 code: </p>
  
  <pre><code>this.oneSignal.handleNotificationReceived().subscribe((result) =&gt; {
    alert('received ' + JSON.stringify(result));
    thisRef.writeDebug('notification received');
    let data = result.payload.additionalData;
    let chatmessage = "";
    if (data != null) {
        if(typeof data !== 'undefined' &amp;&amp; data.length != 0)
        {
          if(typeof data.chatmessage !== 'undefined')
            console.log('chatmessage ok');
          if(typeof data.id !== 'undefined')
            thisRef._callbackOnChatMessage({chatmessage: data.chatmessage, id: data.id.toString()})
          if(typeof data.shortgeolocation !== 'undefined')
          {
            this._callbackRequestShortLocation(data.shortgeolocation);
          }
        }
        if(typeof data.othertyping !== 'undefined' &amp;&amp; typeof thisRef._callbackOnOtherTyping !== 'undefined')
        {
          thisRef._callbackOnOtherTyping(data.othertyping);
        }
    }
  });
  </code></pre>
  
  <p>Here is a preview of my notification once it arrives into my Ionic handler:</p>
  
  <p><a href="https://i.stack.imgur.com/k10hc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k10hc.png" alt="enter image description here"></a></p>
  
  <p>Is there any way to change the <code>displayType</code> and <code>Shown</code> value to be respectively 0 and false from the <code>NotificationExtenderService</code> so that my NotificationReceivedHandler in Ionic is called and the alert not shown? (I got this behaviour working under iOS, struggling to do the same in Android).</p>
  
  <p>SOLVED, partially, I had to downgrade onesignal library to 3.5.6
  in platforms/android.properties, using cordova.system.library.[keep your number x]=com.onesignal:OneSignal:3.5.6
  fixes the issue. 
  For ionic, the file is under platforms/android/
  <a href="https://i.stack.imgur.com/qNcSe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qNcSe.png" alt="project.properties in Android platform"></a></p>
  
  <p>See <a href="https://github.com/OneSignal/OneSignal-Cordova-SDK/issues/220#issuecomment-332254428" rel="nofollow noreferrer">this</a> post absolutely related.</p>