Future versions of iOS/Android gets detected as feature phone

I have this HTTP request, I expected this, but WURFL is returning that. Please provide enough data to reproduce the problem.
kjatin
Posts: 11
Joined: Fri Oct 27, 2017 6:52 am

Future versions of iOS/Android gets detected as feature phone

Postby kjatin » Tue Nov 07, 2017 2:33 am

The future versions of iOS or Android devices gets detected as feature phone with current WURFL latest version. While I understand that these versions would get correctly detected in future versions of WURFL API. I want to highlight that this would mean that we will have to pull the latest versions of WURFL regularly. While this is what we generally follow, there can be a scenario when WURFL is not updated every day. When this gap in updating WURFL would align with major iOS releases, it is possible for a brief period the latest versions are detected as feature phones and have a significant impact on customer experience (since these are latest iOS, they would have high visibility)

What I want to understand is that why can't WURFL detect an iOS device as a smartphone if the iOS version is above a particular threshold value (say for example 2.0). Similarly for Android you may detect anything above Android 2.0 could be detected as smartphone. I think it is very safe to assume that any future versions of iOS and Android would always be a smartphone.

Current version of iOS detected correctly as smartphone: Mozilla/5.0 (iPhone; CPU iPhone OS 11_1 like Mac OS X) AppleWebKit/604.3.1 (KHTML, like Gecko) Version/11.0 Mobile/15B5066f Safari/604.1
Future version of iOS detected as feature phone: Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/604.3.1 (KHTML, like Gecko) Version/11.0 Mobile/15B5066f Safari/604.1

amark
Posts: 40
Joined: Mon May 30, 2016 4:59 am

Re: Future versions of iOS/Android gets detected as feature phone

Postby amark » Tue Nov 07, 2017 12:34 pm

Hi Jatin,
While this is what we generally follow, there can be a scenario when WURFL is not updated every day. When this gap in updating WURFL would align with major iOS releases, it is possible for a brief period the latest versions are detected as feature phones and have a significant impact on customer experience (since these are latest iOS, they would have high visibility)
To clarify, the WURFL snapshots are released every week and the WURFL API releases occur every 3-4 months. As long as you stay on top of the WURFL API releases, you will be able to detect the most recent Android or iOS OS versions.
What I want to understand is that why can't WURFL detect an iOS device as a smartphone if the iOS version is above a particular threshold value (say for example 2.0). Similarly for Android you may detect anything above Android 2.0 could be detected as smartphone. I think it is very safe to assume that any future versions of iOS and Android would always be a smartphone.
WURFL makes a distinction between valid and invalid OS versions and stores a list of valid versions in the WURFL API. One of the reasons we do this is to separate invalid and spoofed user-agents from legitimate traffic. Since many of our customers rely on WURFL to make a distinction between legitimate and invalid user-agents, we are unable to make a change to recognize all future Android and iOS versions as valid.

If WURFL API update frequency is not in-sync with your software update cycle, I would suggest using a patch file to over-ride the `controlcap_is_smartphone` capability for the WURFL device profiles (aka WURFL IDs) you want to detect as smartphones to `force_true`. This way you can customize the WURFL API behavior to your particular installation. The documentation to create a maintain a patch file is here: https://docs.scientiamobile.com/guides/patch-files

I've attached a sample patch file that will detect all iOS and Android devices as smartphones. If you want Android 2.0 and later to be detected as smartphones, you can replace the line `<device id="generic_android" user_agent="DO_NOT_MATCH_GENERIC_ANDROID" fall_back="generic_xhtml">` in the patch file with `<device id="generic_android_ver2" user_agent="DO_NOT_MATCH_GENERIC_ANDROID_2_0" fall_back="generic_android_ver1_6">`.

Best,
Amar
Mobile Data Analyst
ScientiaMobile
Attachments
patch_kjatin.xml
(548 Bytes) Downloaded 999 times

kjatin
Posts: 11
Joined: Fri Oct 27, 2017 6:52 am

Re: Future versions of iOS/Android gets detected as feature phone

Postby kjatin » Thu Nov 16, 2017 7:11 am

I tried using the patch_kjatin.xml you attached to the thread. However, for an unknown Android/iOS version I still get the default behaviour of smartphone being false.
UA: Mozilla/5.0 (iPhone; CPU iPhone OS 13_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1

Code that I tried: Same as in patch_kjatin.xml

amark
Posts: 40
Joined: Mon May 30, 2016 4:59 am

Re: Future versions of iOS/Android gets detected as feature phone

Postby amark » Thu Nov 16, 2017 10:05 am

Hi Jatin,

I have confirmed that the UA you listed is indeed returning true for our is_smartphone capability. Below is some sample code you can use with our Onsite Java API to test.

Code: Select all

import com.scientiamobile.wurfl.core.Device;
import com.scientiamobile.wurfl.core.GeneralWURFLEngine;
import com.scientiamobile.wurfl.core.resource.*;

public class Wurfl {

    public static void main(String[] args) {
        // wurfl.xml and patch path can be either absolute or relative to the application classpath root.
        WURFLResource root = new XMLResource("wurfl.xml");
        WURFLResources patches = new WURFLResources();
        WURFLResource patch1 = new XMLResource("patch_kjatin.xml");
        patches.add(patch1);
        
        
        GeneralWURFLEngine wurfl = new GeneralWURFLEngine(root,patches);
        wurfl.load();

        String user_agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1";

        Device device = wurfl.getDeviceForRequest(user_agent);
        System.out.println("Is Smartphone: " + device.getVirtualCapability("is_smartphone"));
        System.out.println("Form Factor: " + device.getVirtualCapability("form_factor"));
    }
}
If you are still having issue let me know and I will be happy to help.

Best,
Amar
Mobile Data Analyst
ScientiaMobile

kjatin
Posts: 11
Joined: Fri Oct 27, 2017 6:52 am

Re: Future versions of iOS/Android gets detected as feature phone

Postby kjatin » Thu Nov 23, 2017 7:56 am

I was able to get the code working. Thanks for the help.
However, I had a slightly different requirement which was to override the behaviour for any version of iPhone greater than 10.0 to always be smartphone.
For example:
"Mozilla/5.0 (iPhone; CPU iPhone OS 50_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/50.0 Mobile/10A5376e Safari/8536.25" should get smart phone as true because of my override. However, a user agent with "iPhone OS 10_0" should detect as per the current behaviour and my override should not be applicable.
Basically, I would like to override the behaviour only for any of the future versions of iPhone devices and not for any versions already released. Mainly to avoid risk of detecting iPhone 1.0 as smartphone when it may actually be feature phone

Besides, it looks like the latest WURFL API (1.9.1.0) defaults to Android 4.0 when it finds an invalid version (like Android 50.0). And since Android 4.0 is detected as smartphone, any UA with a future android version like "Mozilla/5.0 (Linux; Android 50.0; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19" would now get detected as smartphone.
Can you please confirm this.

Thanks,
Jatin

amark
Posts: 40
Joined: Mon May 30, 2016 4:59 am

Re: Future versions of iOS/Android gets detected as feature phone

Postby amark » Mon Nov 27, 2017 11:07 am

Hi Jatin,

Since the majority of our customers do not have the same use case as you do the best I can offer you is some sample pseudo code to help with your iOS issue.

Code: Select all

// You will need to keep this updated per major iOS release (11, 12, 13 etc.)
$current_ios_version = 12;
// If the current HTTP request's iOS version is greater than the current iOS version, treat it as a smartphone
if (device.getVirtualCapability("advertised_device_os_version") > $current_ios_version) {
    $amazon_smartphone = true 
} else {
    $amazon_smartphone = device.getVirtualCapability("is_smartphone");
}
As for the behavior in 1.9.1 in our API I can confirm the UA you provided will report as true for our is_smartphone capability. Although I can not give you a timeline I can say we are currently looking into the issue . Let me know if the above solution works out and if you have any more questions let me know and I will be happy to help.

Best,
Amar
Mobile Data Analyst
ScientiaMobile

kjatin
Posts: 11
Joined: Fri Oct 27, 2017 6:52 am

Re: Future versions of iOS/Android gets detected as feature phone

Postby kjatin » Tue Nov 28, 2017 4:53 am

Just like Android UA defaults to Android 4.0 when the user agent is an unknown(Android 50); shouldn't iPhone also default to some default version of iPhone (say 2, 3 or 4) instead of defaulting to apple_generic ? Even windows phone are getting defaulted to Windows 7 when version is an unknown.

Besides, just like Android 4 is considered as smart phone; shouldn't the same be applicable to iPhones as well where an unknown version defaults to iPhone x.y (say 3.0) and that gets considered as a smart phone.

I don't understand the disparities amongst different OS and why fallback logic should be different for each of them.

amark
Posts: 40
Joined: Mon May 30, 2016 4:59 am

Re: Future versions of iOS/Android gets detected as feature phone

Postby amark » Tue Nov 28, 2017 12:06 pm

Hi Jatin,
Just like Android UA defaults to Android 4.0 when the user agent is an unknown(Android 50); shouldn't iPhone also default to some default version of iPhone (say 2, 3 or 4) instead of defaulting to apple_generic ? Even windows phone are getting defaulted to Windows 7 when version is an unknown.
It is our practice that HTTP requests/User-Agent strings with unknown/invalid version numbers be treated as generic devices for their platform, since they are by definition illegitimate User-Agent strings. Since we cannot tell what specifications this generic device may or may not have, we generally call all generic mobile devices as non-smartphone devices. All Android 4 devices being considered a smartphone is an anomaly we are currently looking at this issue as we speak.

If you have any other questions or concerns let's continue this conversation through our enterprise support by either creating a ticket (https://scientiamobile.zendesk.com/hc/e ... quests/new) or sending us an email at support@scientiamobile.com.

Best,

Amar
Mobile Data Analyst
ScientiaMobile


Who is online

Users browsing this forum: No registered users and 2 guests