title: How to open notification when app is closed [Flutter][OneSignal]
body: <p>I am using Flutter with OneSignal. All the configs and handlers are working as expected when app is opened or in background. But not when closed.
  I receive notifications if app is closed, but when i tap on them, the app opens but with no params attached and not triggering the event handlers associated to the notification receive.</p>
  
  <p>I have been wondering if my onesignal init script is misplaced.
  And i wanted to know if anyone else have been suffering the same issue. Because i cannot find any issue related.</p>
  
  <pre><code>class FonixTelematicsApp extends StatefulWidget {
    @override
    _FonixTelematicsAppState createState() =&gt; _FonixTelematicsAppState();
  }
  
  class _FonixTelematicsAppState extends State&lt;FonixTelematicsApp&gt; {
    @override
    void initState() {
      super.initState();
      initPlatformState();
    }
  
    Future&lt;void&gt; initPlatformState() async {
     if (!mounted) return;
  
  await pushService.init();
    eventBus.on&lt;AppPushOpenEvent&gt;().listen(
      (AppPushOpenEvent event) =&gt; onAppPushNotification(event.notification));
    }
  
    onAppPushNotification(OSNotification notification) {
      var data = notification.payload.additionalData;
      Map&lt;String, dynamic&gt; pages = {
        'alarm': (Map&lt;dynamic, dynamic&gt; alert) {
          Map&lt;String, dynamic&gt; alertData = {'id': alert['id']};
          return {
            'route': Routes.alertDetails,
            'arguments': new AlertDetailsPageArguments(
                alert: Alert.fromJson(alertData), isPushNotification: true)
          };
        },
        'auth': (Map&lt;dynamic, dynamic&gt; properties) {
          return {
            'route': Routes.auth,
            'arguments': new AuthPageArguments(key: properties['key'])
          };
        }
      };
  
      if (pages[data['page']] != null) {
        Map&lt;dynamic, dynamic&gt; pageData = data['data'];
        Map&lt;String, dynamic&gt; page = pages[data['page']](pageData);
  
        debugPrint('Will push new page! ${page.toString()}');
        navigatorKey.currentState
            .pushNamed(page['route'], arguments: page['arguments']);
      } else {
        debugPrint(
            'onAppPushNotification: unrecognized payload ${notification.payload}');
      }
    }
  }
  </code></pre>
  
  <p>push-service.dart</p>
  
  <pre><code>class PushService extends BasePushService {
    Future&lt;void&gt; init() async {
      // OneSignal.shared.setLogLevel(OSLogLevel.verbose, OSLogLevel.none);
  
      OneSignal.shared.setNotificationReceivedHandler((OSNotification notification) {
        var data = notification.payload.additionalData;
        if (data['page'] == 'auth') {
          eventBus.fire(AppPushOpenEvent(notification));
        }
      });
      OneSignal.shared.setNotificationOpenedHandler((data) {
        eventBus.fire(AppPushOpenEvent(data.notification));
      });
      OneSignal.shared
          .setInAppMessageClickedHandler((OSInAppMessageAction action) {
            print(action);
          });
      OneSignal.shared
          .setSubscriptionObserver((OSSubscriptionStateChanges changes) {
        print("SUBSCRIPTION STATE CHANGED: ${changes.jsonRepresentation()}");
        _subscriptionObserver(changes);
      });
      OneSignal.shared.setPermissionObserver((OSPermissionStateChanges changes) {
        debugPrint("PERMISSION STATE CHANGED: ${changes.jsonRepresentation()}");
      });
  
      await OneSignal.shared
          .init("xxxx-xxxx-xxxx-xxxxx", iOSSettings: {
        OSiOSSettings.autoPrompt: true,
        OSiOSSettings.inAppLaunchUrl: true,
        OSiOSSettings.promptBeforeOpeningPushUrl: false
      });
  
      OneSignal.shared
          .setInFocusDisplayType(OSNotificationDisplayType.notification);
    }
  }
  </code></pre>