Firebase Analytics-按操作系统主要版本的受众

时间:2019-02-25 11:25:33

标签: ios firebase firebase-analytics

我试图在Firebase Analytics中创建一个受众群体,以按主要iOS版本对用户进行分组。

因此,我创建了一个按流过滤的新受众群体,因为项目包含的不仅仅是生产iOS应用程序,然后我设置了另一个条件以按 User Property-> OS version 进行过滤。对于iOS 11.x,我将其设置为包含ios 11。或尝试使用正则表达式 ios 11。* 。没有一个有效,我总是得到0个用户,即使在未经过滤的仪表板上也有这样的用户。

没有人知道什么是正确的条件吗?谢谢

1 个答案:

答案 0 :(得分:0)

由于iOS版本(major.minor.patch)中有两个小数点,因此该属性是字符串而不是数字。最简单的方法是在Firebase Web控制台中创建一个名为“ iOSMajorVersion”的用户属性。转到分析:用户属性以执行此操作。然后在您的代码中,获取主要版本并向Firebase报告。这有助于确保每个用户会话仅执行一次此操作。在Objective-C中,您可以通过块或异步GDC调度来实现。

您没有提到要使用Objective-C还是Swift,但这是您可以使用的方法。

Objective-C

@Query(value = "select u from users u join users_role ur on u.id = ur.user_id join roles r on ur.role_id = r.id where r.role = 'ROLE_PL' ")
List<User> findPersonels();

迅速

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.287 s <<< FAILURE! - in com.backend.AuthentificationJwtApplicationTests
[ERROR] contextLoads(com.backend.AuthentificationJwtApplicationTests)  Time elapsed: 0.004 s  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'personnelController': Unsatisfied dependency expressed through field 'repository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personnelRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.backend.repository.PersonnelRepository.findPersonels()!
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personnelRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.backend.repository.PersonnelRepository.findPersonels()!
Caused by: java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.backend.repository.PersonnelRepository.findPersonels()!
Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: users is not mapped [select u from users u join users_role ur on u.id = ur.user_id join roles r on ur.role_id = r.id where r.role = 'ROLE_PL' ]
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: users is not mapped [select u from users u join users_role ur on u.id = ur.user_id join roles r on ur.role_id = r.id where r.role = 'ROLE_PL' ]
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: users is not mapped