简体   繁体   English

Firebase分析,如何使用UserProperty

[英]Firebase analytics, How to use UserProperty

I'm trying to make an alertDialog: 我正在尝试创建一个alertDialog:

private FirebaseAnalytics mFirebaseAnalytics; 
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    askProxAtualiza();
 }

private void askProxAtualiza() {
        final String[] choices = getResources().getStringArray(R.array.tema_items);
        ContextThemeWrapper ctx = new ContextThemeWrapper(this, R.style.Theme_MediaRouter_Light);
        AlertDialog ad = new AlertDialog.Builder(ctx)
                .setCancelable(false)
                .setTitle(R.string.tema_dialog_title)
                .setItems(choices, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        final String tema = choices[which];
                        setUserFavoriteFood(tema);
                    }
                }).create();
        ad.show();
    }
}



private void setUserFavoriteFood(String next_up) {
    Log.d("XXXX", "Tema Favorito: " + next_up);
    mFirebaseAnalytics.setUserProperty("next_up", next_up);
}

Then this happens: http://i.stack.imgur.com/s0IEN.png 然后发生这种情况: http : //i.stack.imgur.com/s0IEN.png

Dependencies: 依存关系:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.google.android.gms:play-services:9.2.0'
compile 'com.google.firebase:firebase-analytics:9.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.google.android.gms:play-services-ads:9.2.0'
compile 'com.google.android.gms:play-services-identity:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile 'com.google.firebase:firebase-core:9.0.2'

} }

apply plugin: 'com.google.gms.google-services'

I created a User Property on firebase page called next_up. 我在firebase页面上创建了一个名为next_up的用户属性。 There was more one day that I did it. 我做了一天以上。 The Results isn't showing on firebase page!!!: 结果未显示在Firebase页面上!!!:

firebase image Is this the correct way? firebase图像这是正确的方法吗?

The values for "next_up" don't currently show in the auto-suggestions for next_up. “ next_up”的值当前未显示在next_up的自动建议中。 But when you go to the dashboard, select Add Filter->User Property->next_up and manually type a value, it should filter that report by users with that user property value. 但是,当您转到仪表板时,选择“添加过滤器”->“用户属性”->“ next_up”并手动键入一个值,它将按具有该用户属性值的用户过滤该报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM