[英]Flurry push - issue with Kotlin
I am not finding an easy way to integrate Flurry push with Kotlin.我没有找到将 Flurry push 与 Kotlin 集成的简单方法。
I added the first parts of the auto installation.我添加了自动安装的第一部分。 and I get red lines under key parts of the script.我在脚本的关键部分下得到了红线。
Mainly .withFlurryMessagingListener(flurryMessagingListener)
seems it can't find flurryMessagingListener主要是.withFlurryMessagingListener(flurryMessagingListener)
好像找不到flurryMessagingListener
val flurryMessagingOptions = FlurryMarketingOptions.Builder()
.setupMessagingWithAutoIntegration()
.withDefaultNotificationChannelId()
.withDefaultNotificationIconResourceId(R.drawable.ic_dialog_alert)
.withDefaultNotificationIconAccentColor()
.withFlurryMessagingListener(flurryMessagingListener)
.build()
The other issue is I don't want to put an .withDefaultNotificationChannelId()
.另一个问题是我不想放置.withDefaultNotificationChannelId()
。 According to the how to on their website - which seem out of date.根据他们网站上的 how to - 这似乎已经过时了。 I don't need to yet it tells me I have too.我还不需要它告诉我我也有。
Question why could this not be as easy as iOS version - that was a lot easier to install.问为什么这不像 iOS 版本那么容易 - 安装起来容易得多。 But if anyone has a how to install with Kotlin - since Flurry support has not gotten back to me I would be grateful.但是,如果有人知道如何使用 Kotlin 进行安装 - 由于 Flurry 的支持尚未回复我,我将不胜感激。
You need to define your listener.你需要定义你的听众。 Eg,例如,
import com.flurry.android.marketing.messaging.FlurryMessagingListener;
FlurryMessagingListener flurryMessagingListener = new FlurryMessagingListener() {
@Override
public boolean onNotificationReceived(FlurryMessage flurryMessage) {
return false;
}
@Override
public boolean onNotificationClicked(FlurryMessage flurryMessage) {
return false;
}
@Override
public void onNotificationCancelled(FlurryMessage flurryMessage) {
}
@Override
public void onTokenRefresh(String s) {
}
@Override
public void onNonFlurryNotificationReceived(Object o) {
}
};
And No, it's not required to define your own channel ID (by withDefaultNotificationChannelId
).不,不需要定义您自己的频道 ID(通过withDefaultNotificationChannelId
)。 Flurry SDK will apply the default if no explicitly defined.如果没有明确定义,Flurry SDK 将应用默认值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.