Я пытаюсь отправить уведомление о глубоких связях, используя Flurry, вместо этого уведомление открывает приложение и не воспроизводит звук. Я использую для этого автоинтеграцию, и у меня есть класс MyFlurryMessagingListener, как он есть из документации Flurry.У меня нет ошибок, только эта проблема, и да, я обязательно выбрал «Глубокие ссылки» при создании Push In Flurry Dashboard.
Build Gradle
implementation 'com.flurry.android:analytics:11.6.0@aar'
implementation 'com.flurry.android:marketing:11.6.0@aar'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
MyApplication Class
public class MyApplication extends Application {
private static final String TAG = "MyApplication";
@Override
public void onCreate() {
super.onCreate();
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.d(TAG, "REGISTERED TOKEN: " + refreshedToken);
FlurryMarketingOptions flurryMessagingOptions = new FlurryMarketingOptions.Builder()
.setupMessagingWithAutoIntegration()
.withDefaultNotificationIconResourceId(R.drawable.ic_notification)
.withDefaultNotificationIconAccentColor(getResources().getColor(R.color.colorPrimaryDark))
.build();
FlurryMarketingModule marketingModule = new FlurryMarketingModule(flurryMessagingOptions);
new FlurryAgent.Builder()
.withLogEnabled(true)
.withModule(marketingModule)
.build(this, "CCCCCTESTTESTTESTTEST");
}
}
MyFlurryMessagingListener Class
public class MyFlurryMessagingListener implements FlurryMessagingListener {
final static String LOG_TAG = MyFlurryMessagingListener.class.getCanonicalName();
Context context;
public MyFlurryMessagingListener(Context context) {
this.context = context;
}
@Override
public boolean onNotificationReceived(FlurryMessage flurryMessage) {
// determine if you'd like to handle the received notification yourself or not
boolean handled = false;
// flurry will not show notification if app is in foreground, so handle it appropriately
if (FlurryMessaging.isAppInForeground()) {
// handle the notification using data from FlurryMessage
// NOTE: since you are handling the notification, be sure to call logNotificationOpened and logNotificationCancelled after this
handled = true;
}
return handled;
}
@Override
public boolean onNotificationClicked(FlurryMessage flurryMessage) {
// NOTE: THIS WILL ONLY BE CALLED IF FLURRY HANDLED onNotificationReceived callback
// determine if you'd like to handle the clicked notification yourself or not
boolean handled = false;
return handled;
}
@Override
public void onNotificationCancelled(FlurryMessage flurryMessage) {
Log.d(LOG_TAG, "Notification cancelled!");
}
@Override
public void onTokenRefresh(String refreshedToken) {
Log.d(LOG_TAG, "Token refreshed - " + refreshedToken);
}
@Override
public void onNonFlurryNotificationReceived(Object nonFlurryMessage) {
// If Flurry receives a non-Flurry message, it will be passed to you here. You can cast the object
// based on the push provider. For example...
if (nonFlurryMessage instanceof RemoteMessage) {
RemoteMessage firebaseMessage = (RemoteMessage) nonFlurryMessage;
}
}
}