How to make two platform code to one



I have Two branches in git for android and ios respectively and i want to merge both in one
How can it be done?
somewhere in any video like android.ts or ios.ts file but I don’t know the exact procedure?
can someone help?


I have also used tns-declarations


{N} means to build cross platform apps, even your platform specific code can reside in same repo.

For simple piece of platform specific code, use if conditions to check whether platform is iOS / Android. For code behind files, simply save the file as filename.ios.js /

If your code is much more complex based on platform, try writing as internal or external plugins.


What if I have Common Code to both I have separated component with

and I want some common component to be called which is main
but for some platform dependent code i and android/ios.ts


I have tried with common.ts but dosn’t work


Common + Platform specific files really work, tns-core-modules and almost every plugin uses the structure. Refer the docs in the link above, it has everything you need follow.


i have to override i.e, extend or directly works?


when call console.log() in constructor or ngOnInit() it never show output