Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230106

Common code between Ionic React and PHP

$
0
0

In my case, I have a Drupal 9 website built in PHP, and an Ionic app for iOS and Android.

Originally, I had used the Drupal site for everything, but I built the Ionic app because users kept asking for an app.

As I improved the ionic app, the Ionic app’s features surpassed what was available on my Drupal site in terms of functionality, so at that point, I just added the Ionic app as a PWA on my Drupal server.

So now I use the Ionic app functionality everywhere-- on iOS, Android, and on my Drupal site. And then I am still using the Drupal site for everything not provided in Ionic.

if you only want to use the chat part of the app on your web server, you may be able to create a limited version by gating the non-chat functionality by checking for the platform.

To check if I am running on mobile, I use this code:

export const isPlatformMobile = (): boolean => (isPlatform('capacitor'));

This way, you could just upload the full app to the webserver, but it would disable all the unneeded functionality (after adding the appropriate gates by checking the platform).


Viewing all articles
Browse latest Browse all 230106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>