почему мой уровень открытия моего отдельного элемента push-уведомлений в firebase всегда показывает нулевой счет? - PullRequest
0 голосов
/ 08 апреля 2019

enter image description here

Как видно из изображения выше, все push-уведомления всегда показывают нулевую скорость открытия, даже если я уверен, что по крайней мере 1% откроет pushУведомление.

Я хочу отслеживать скорость открытия для каждого отправленного сообщения в день.

, но если открыть общий отчет на основе дня из консоли Firebase, он будет отслеживать скорость открытиявсе сообщения, отправленные за день, как на изображении ниже:

enter image description here

, так почему коэффициент открытия одного отправленного сообщения, как на первом рисунке, всегда показывает ноль?

в Android Я использую этот gradle:

    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-ads:17.1.3'
    implementation 'com.google.firebase:firebase-auth:16.2.0'
    implementation 'com.google.firebase:firebase-messaging:17.4.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
 implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.8@aar') {
        transitive = true;
    }

мой класс службы сообщений:

public class MyFirebaseMessagingService extends FirebaseMessagingService {


    //*********** Called when the Notification is Received ********//


    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {

        Bitmap notificationBitmap = null;
        String notification_title, notification_message, notification_image = "";


        if (remoteMessage.getData().size() > 0) {
            notification_title = remoteMessage.getData().get("title");
            notification_message = remoteMessage.getData().get("message");
            notification_image = remoteMessage.getData().get("image");
        } else {
            notification_title = remoteMessage.getNotification().getTitle();
            notification_message = remoteMessage.getNotification().getBody();
        }


        notificationBitmap = getBitmapFromUrl(notification_image);


        Intent notificationIntent = new Intent(getApplicationContext(), MainActivity.class);
        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);

        NotificationHelper.showNewNotification
                (
                        getApplicationContext(),
                        notificationIntent,
                        notification_title,
                        notification_message,
                        notificationBitmap
                );

    }


    public Bitmap getBitmapFromUrl(String imageUrl) {
        if ("".equalsIgnoreCase(imageUrl)) {
            return null;
        }
        else {
            try {
                URL url = new URL(imageUrl);
                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                connection.setDoInput(true);
                connection.connect();
                InputStream input = connection.getInputStream();
                return BitmapFactory.decodeStream(input);

            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }
    }

}

что здесь не так?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...