Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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.

evolve
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5940
Posts this week:
1
User Info:
 
Total Users:
5193
Newest User:
david2398
Members Online:
1
Guests Online:
183

Online: 
Technichem

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked