Calling typescript method from Native code

We can call native method from typescript class using custom cordova plugin but how to call typescript method from native java code.

I have to store notification on ionic db but notification is received in native java code

You can just handle the notification with your push plugin and do whatever you want in there. We are talking about push notifications, right?

not ionic push notification, i am using oracle push notification.

so how to get msg data in ionic when it is received in java code

It doesn’t matter which push provider you use. They are just dump backends, sending data to Google or Apple to be delivered to the device.

Did you implement anything from Oracle push in your app?

If you install https://ionicframework.com/docs/native/push/ and implement its code you already have the notification in your app.

yes i have received notification but it is in my native java code, so how to send this to ionic

Please read my posts and answer the question I asked. I won’t repeat what I wrote above.

yes i used oracle push notification in my app using custom plugin

What exactly does the plugin do?
If you install and use https://ionicframework.com/docs/native/push/ everything should be taken care of. Or is Oracle push special?

The plugin will register user to oracle pushio porta when app openl & it will receive notification when we send it from portal. so how can i return that notification data to ionic typescript file.

The requirement is to use oracle pushi io.

Is the source code of the plugin available somewhere?
What did you implement in your app?

Normally a push plugin does exactly that: It receives the the notification and makes it available to be handled in your app and ts code.

yes the notification is received in my app but as it is a custom cordova plugin so i received the notification msg data in my native java code of custom plugin.

so how can i send this to ts code when i received notification from portal bcoz it will happen at run time.

Look at any of the available push notification plugins for Cordova and replicate what they do.

As ur suggestion i applied other notification plugin logic to get notification data to my plugin.js file of custom cordova plugin.

So now how can i pass this data to my ts file?

I would attempt in the first instance (and this is merely a suggestion based on past experience) to build your ‘Cordova’ plugin strictly as a cordova plugin - forget TS / Ionic.

If you can make that work then at the very least you can wrap the function within a provider and call it with type safety.

There’s probably good docs out there on building an Ionic Native wrapper if you wish to go the full hog. I’d only bother personally if I intended to make the plugin public.