Angular 5 and native IOS/Android communication

时光毁灭记忆、已成空白 提交于 2020-01-06 14:51:17

问题


we are building an angular application, which we will embed in an existing IOS and android application as a webview. I want to create a communication between angular application and native application.

Eg: On certain events like download, angular UI should send some data to native apps to use default app behavior like that ..

From the basic search i found that it can be done by using javascript.

I want to know the best approach to do this(Architecture level), ie communication between angular UI and Native apps.


回答1:


If you already have an native iOS / Android app and just like you embed your Angular responsive web app inside, you can communicate using JavaScript Interfaces.

But if you are interested in giving a complete native performance, look & feel for your Angular app, the choice could be NativeScript. You will have to rewrite your HTML components using the cross platform layouts / components that comes out of the box with NativeScript framework, but still you can reuse your Angular Controllers, Models, Services etc.,

Docs:

https://docs.nativescript.org/code-sharing/intro

https://docs.nativescript.org/angular/start/introduction



来源:https://stackoverflow.com/questions/52591767/angular-5-and-native-ios-android-communication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!