Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Detection for native Android and iOS...
Detection for native Android and iOS Apps
Detection for native Android and iOS Apps
Hi,
We have a website/platform on domainname.com with template X
We want to be able to show the website/platform with template Y when people use it with native apps for Android & Apple (build with gonative.io, which shows the websites in the apps). Is there a possibility to achieve this with a ruleset for Chameleon of a PHP script?
We now have a simple rule for detecting Android and iPhone devices, but that rule applies also on webbrowsers on these devices, while the default template has to be shown then.
Re: Detection for native Android and iOS Apps
Hi,
I've done some digging on this, and it turns out it's quite easy to achieve.
https://gonativeio.groovehq.com/knowled … om-my-apps
So in Chameleon you can do this in the PHP tab - just return true if the condition is met, which will then trigger the Succeed action (provided any other conditions in the same rule also succeed).
So in your case, you could use this:
if (stripos(@$_SERVER['HTTP_USER_AGENT'], 'gonative') !== FALSE) {
return true;
}
You can detect specifically android or ios versions of GoNative by searching for gonativeios or gonativeandroid instead of just gonative.
Cheers,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Detection for native Android and iOS...
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Total Posts Today:
- 1
- User Info:
- Total Users:
- 7645
- Newest User:
- foocd90
- Members Online:
- 0
- Guests Online:
- 154
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked