我正在寻找一个适当的触摸事件,当用户触摸地图时会触发该事件(谷歌地图Android API).有没有人知道如何做到这一点?
我有一个应用程序应该显示抬头通知,而应用程序在前台和后台(不在历史记录中).
在前景的情况下,我通过以下方法实现了这一点.
PendingIntent pendingIntent = PendingIntent.getActivity(ctx, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx);
builder.setFullScreenIntent(pendingIntent,true);
Run Code Online (Sandbox Code Playgroud)
但在后台,它总是显示在通知区域.任何人都可以告诉如何在背景中实现这一点(不是在历史中)
我尝试了以下参数进行通知但无法正常工作.
{
"to" : "_Token_",
"priority":"high",
"data":
{
"title": "Test",
"text": "Fcm"
},
"notification":
{
"title": "Test",
"text": "Fcm"
}
}
Run Code Online (Sandbox Code Playgroud) 我的应用程序未收到genymotion模拟器上安装的任何通知。Firebase令牌未生成。