1

i am using Matomo for my app analytics and was curious if it is possible to show Harmony/HuaweiOS besides the currently displayed Android and iOS on the Matomo Dashboard.

If i use a Huawei phone with their own OS right now, Matomo shows it as Android 10 instead of HarmonyOS. Is there a way to do that?

Mahsum B
  • 23
  • 5
  • If you have an user agent for the device, you can test it here: https://devicedetector.lw1.at/ to see if it is already detected. If not, you can create an issue here: https://github.com/matomo-org/device-detector/issues – lw1.at Jun 29 '21 at 08:52
  • sry i dont quite understand why i need the devicedetector? If i use the app on a Huawei phone with harmonyOS, it gets detected as an huawei phone with the correct model name on Matomo dashboard. My only problem is that it is displayed as Android 10 instead of harmonyOS – Mahsum B Jun 29 '21 at 09:24
  • devicedetector is the module Matomo uses to detect the device data from the User-Agent string the browser (or in your case the app) sends with the request. If you want to change how Matomo detects an User-Agent, you have to contribute this change to devicedetector (and wait for the next Matomo release to include this change) – lw1.at Jun 29 '21 at 11:18

2 Answers2

2

detect harmonyos

Class.forName("ohos.app.Application")

get system version

import ohos.system.version.SystemVersion

SystemVersion.getVersion() //get harmonyos version
SystemVersion.getApiVersion() //get api level 

don't forget ohos.jar, you can find it under harmony sdk sdk/java/2.1.1.21/api/ohos.jar

android_su
  • 1,637
  • 4
  • 21
  • 30
0

User-Agent of the browser read by the devicedetector. This also requires a third-party browser to identify the HarmonyOS and provide data to matomo.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108