title: LocalNotification with AlarmManager and BroadcastReceiver not firing up in Android O (oreo)
body: <p><strong>I've got my local notifications running on androids prior to SDK 26</strong></p>
  
  <p>But in a Android O I've got the following warning, and the broadcast receiver is not fired.</p>
  
  <pre><code>W/BroadcastQueue: Background execution not allowed: receiving Intent { act=package.name.action.LOCAL_NOTIFICATION cat=[com.category.LocalNotification] flg=0x14 (has extras) } to package.name/com.category.localnotifications.LocalNotificationReceiver
  </code></pre>
  
  <p>From what I've read broadcast receivers are more restricted in android O, but if so, how should I schedule the broadcast if I want it launching even if the main activity is not running?</p>
  
  <p>Should I use services instead of receivers?</p>
  
  <p>This is the AlarmManager launch code:</p>
  
  <pre><code>public void Schedule(String aID, String aTitle, String aBody, int aNotificationCode, long aEpochTime)
  {
      Bundle lExtras = new Bundle();
      lExtras.putInt("icon", f.getDefaultIcon());
      lExtras.putString("title", aTitle);
      lExtras.putString("message", aBody);
      lExtras.putString("id", aID);
      lExtras.putInt("requestcode", aNotificationCode);
  
      Intent lIntent = 
        new Intent(LocalNotificationScheduler.ACTION_NAME)
        .addCategory(NotificationsUtils.LocalNotifCategory)
        .putExtras(lExtras);
  
      PendingIntent lPendIntent = PendingIntent.getBroadcast(f.getApplicationContext(), aNotificationCode,
                                                             lIntent, PendingIntent.FLAG_UPDATE_CURRENT);
  
      AlarmManager lAlarmMgr = (AlarmManager) f.getSystemService(Context.ALARM_SERVICE);
      lAlarmMgr.set(AlarmManager.RTC, 1000, lPendIntent);
  }
  </code></pre>
  
  <p>This is the receiver code:</p>
  
  <pre><code>public class LocalNotificationReceiver extends BroadcastReceiver {
  
  public static native void   nativeReceiveLocalNotification (String aID, String aTitle, String aMessage, boolean aOnForeground );
  
  /** This method receives the alarms set by LocalNotificationScheduler,
  *   notifies the CAndroidNotifications c++ class, and (if needed) ships a notification banner 
  */
  @Override
  public void onReceive(Context aContext, Intent aIntent)
  {
      Toast.makeText(context, text, duration).show();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Android manifest:</p>
  
  <pre><code>&lt;receiver android:name="com.category.localnotifications.LocalNotificationReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="${applicationId}.action.LOCAL_NOTIFICATION" /&gt;
              &lt;category android:name="com.category.LocalNotification" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>