How to call JavaScript function in ionic2 with UIWebView from IOS

I have an ionic2 application embedded in a native iOS webView. How can I call a javaScript function in the ionic app from my native app. Otherwise, I want to pass parameters from my native app to the embedded ionic2 app.
Your help is highly appreciated

So you are not using Cordova, but your own native app with a UIWebView to show an Ionic project?

I’m using ionic2. My native app contains both swift and a UIWebView to show ionic project. I want to pass parameters from my swift code to this UIWebView( ionic2 project)

Okay, you didn’t really answer my question, but I can deduct: You are not using Cordova as the WebView. You have your own Swift + UIWebView XCode project where you load your Ionic 2 project.

Cordova was built for exactly what you are asking for: Offering a bridge between JS code running inside the WebView and native code on the outside, so one can execute the other.

If you have other native functionality that prohibits you using the normal Cordova container that Ionic 2 offers (look into ionic run and ionic emulate) you can also embed a CordovaWebView into your app: https://cordova.apache.org/docs/en/latest/guide/hybrid/webviews/index.html