- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在尝试通过 Amazon pinpoint 使用 GCM/FCM 向 android 设备发送推送通知。当我在模拟器中调试 Android 应用程序但消息数据为空时,我能够发送消息并可以看到它。不确定如何调试我遗漏的内容。
我正在使用 boto 发送消息。这是示例消息。
response = client.get_gcm_channel(ApplicationId='*****')
responseSendMsg = client.send_messages(
ApplicationId='*****',
MessageRequest={'Addresses': {
'<token>': {
'BodyOverride': 'string',
'ChannelType': 'GCM',
'Context': {
'string': 'string'
},
'RawContent': 'Raw value of message',
'Substitutions': {
'string': [
'string',
]
},
'TitleOverride': 'Title from API'
}
},
'Context': {
'tKey': 'tValue'
},
'MessageConfiguration': {
'GCMMessage': {
'Action': 'OPEN_APP',
'Body': 'Message from message configuration',
'Data': {
'testDataKey': 'testDataValue'
},
'IconReference': 'ic_launchstringer.png',
'ImageIconUrl': 'string',
'ImageUrl': 'string',
'Priority': 'High',
'RawContent': 'test raw content',
'RestrictedPackageName': 'string',
'SilentPush': True,
'SmallImageIconUrl': 'string',
'Sound': 'string',
'Substitutions': {
'string': [
'string',
]
},
'TimeToLive': 36000,
'Title': 'Title from message configuration',
'Url': 'string'
}
},
'TraceId': 'test Trace Id' + str(round(time.time()*1000))
})
请注意, token 是有效 token ,应用程序 ID 是有效的。
我不确定我是否在 API 中设置了正确的参数?我阅读了文档并添加了我认为需要的所有内容。
android端收到消息但是data
为空
这是 Android 端代码。我正在扩展 FirebaseMessagingService
并根据 AWS 设置文档在 list 中注册了服务。
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
Log.d(TAG, "Message: " + remoteMessage.getData());
final NotificationClient notificationClient = HomeActivity.getPinpointManager(getApplicationContext()).getNotificationClient();
final HashMap<String, String> dataMap1 = new HashMap<>(remoteMessage.getData());
final NotificationDetails notificationDetails = NotificationDetails.builder()
.from(remoteMessage.getFrom())
.mapData(remoteMessage.getData())
.intentAction(NotificationClient.FCM_INTENT_ACTION)
.build();
NotificationClient.CampaignPushResult pushResult = notificationClient.handleCampaignPush(notificationDetails);
if (!NotificationClient.CampaignPushResult.NOT_HANDLED.equals(pushResult)) {
/**
The push message was due to a Pinpoint campaign.
If the app was in the background, a local notification was added
in the notification center. If the app was in the foreground, an
event was recorded indicating the app was in the foreground,
for the demo, we will broadcast the notification to let the main
activity display it in a dialog.
*/
if (NotificationClient.CampaignPushResult.APP_IN_FOREGROUND.equals(pushResult)) {
/* Create a message that will display the raw data of the campaign push in a dialog. */
final HashMap<String, String> dataMap = new HashMap<>(remoteMessage.getData());
broadcast(remoteMessage.getFrom(), dataMap);
}
return;
}
}
如果有人使用过这个 api 并能给我指出一个示例,无论是直接调用 api 还是通过一些客户端包,这将非常有帮助。
注意:我可以使用 AWS 控制台发送消息,并使用我在自己的服务器上使用的相同 token 。
如果您有任何问题,请告诉我。
最佳答案
用一些参数再次播放。这些参数集起作用。我的假设是 pinpoint api 在发现不同用例的覆盖时无法将数据发送到 FCM。AWS 团队应该在该文档中明确添加哪些内容是必需的,哪些内容不能使用他们的 API。无论如何可能对某人进行调试有用。
response = client.get_gcm_channel(ApplicationId='*****')
responseSendMsg = client.send_messages(
ApplicationId='*****',
MessageRequest={'Addresses': {
'<token>': {
'ChannelType': 'GCM',
'TitleOverride': 'Title from API'
}
},
'MessageConfiguration': {
'GCMMessage': {
'Action': 'OPEN_APP',
'Body': 'Message from message configuration',
'Priority': 'High',
'SilentPush': False,
'TimeToLive': 36000,
'Title': 'Title from message configuration'
}
},
'TraceId': 'test Trace Id' + str(round(time.time()*1000))
})
关于android - 以编程方式使用 Amazon pinpoint 发送推送通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53437164/
我正在使用 Pinpoint JS SDK 向我的应用程序发送 APNS 推送通知。我正在尝试启用发送深层链接以在用户点击通知时打开应用程序的特定页面。 根据docs我应该路过Action: "DEE
1、背景 随着项目微服务的进行,微服务数量逐渐增加,服务间的调用也越来越复杂,我们急切需要一个APM工具帮我们监控各个服务的性能及对服务间的调用进行跟踪,而通过调研多个开源APM工具后,最终我们选择
1、PinPoint出现与其他相似概念比较 1.1、PinPoint概念 PinPoint是由java/PHP编写而成的,用来对大规模的分布式系统提供应用性能管理。pinpoint可以解决复杂架构
有两种安装方式,一种是通过docker-compose安装,另一种就是手动自己安装 1、Docker方式安装 安装docker docker-compose yum update -y yum
1、PinPoint介绍 PinPoint是开源在github上的一款APM监控工具,它是由java编写的,用于大规模分布式系统的监控;它对性能的影响最小(只增加约3%资源利用率),安装agent是
PinPoint是一种用于监视分布式系统性能的开源工具。它可以帮助开发人员更快地诊断问题并改进系统性能。Linux是PinPoint常用的操作系统之一,下面将简要介绍如何在Linux上搭建PinPoi
在 APM pinpoint 中,我可以在“实时 Activity 线程图表”上看到 Java 示例应用程序的所有 http 调用线程。但我找不到任何后台运行线程的内部线程。有没有办法在图表中显示这些
在我工作的公司,我被要求使用 AWS 的新推送通知服务 Amazon Pinpoint 进行一些测试。 我决定跟随 Amazon 的 a tutorial,教授如何构建一个能够记录笔记的简单应用程序。
1、全链路监控概述 1.1 什么是全链路监控 在分布式微服务架构中,系统为了接收并处理一个前端用户请求,需要让多个微服务应用协同工作,其中 的每一个微服务应用都可以用不同的编程语言构建,由不同的团
我是 Pinpoint 的新手,并试图了解端点/端点Id 如何在 Pinpoint 语义中工作。来自 aws doc : When a user starts a session (for examp
我目前有一个 Node.js 服务来通过 AWS Pinpoint 发送语音调用。但是,我收到了 Resource not found调用电话后回复。我用 PinpointSMSVoice.sendV
我正在使用react-native和amplify通过AWS Pinpoint向设备发送推送通知。我可以获得设备生成的 token 。但我只需要使用用户 ID 发送推送通知。我尝试更新端点,但它不起作
尝试让本教程发挥作用 https://docs.aws.amazon.com/pinpoint/latest/developerguide/send-messages-voice.html . 当前阻
我正在尝试使用 boto3 向我发送带有精确定位的消息,但是 update_endpoint 和 send_messages 的函数一直返回找不到资源 client = boto3.client('p
我正在尝试通过 Amazon pinpoint 使用 GCM/FCM 向 android 设备发送推送通知。当我在模拟器中调试 Android 应用程序但消息数据为空时,我能够发送消息并可以看到它。不
亲爱的 friend 们,大家好, 我正在尝试将推送通知的阅读收据发送回 Amazon Pinpoint,以便我可以知道用户何时阅读了之前发送到我的应用程序的推送通知。在 iOS 上,在 Swift
我需要查找和操作 从一张 table 。目前我有一个非常简朴的功能: function testAjaxCheckBoxes() { var table = document.getEleme
我正在尝试使用 AWS Pinpoint 发送推送通知。除了 AWS 前端必须提供的任何功能之外,我还希望能够从我的 Java Web 应用程序以编程方式发送推送通知。这些是针对特定设备的单一通知,我
我正在阅读关于javaagent的pinpoint代码,我发现了一个连线问题。 通常,java 代理应该由 App 类加载器加载,因为它在类路径中。但是我发现pinpoint是由bootstrap类加
我被要求开发一个与 Amazon Pinpoint 集成的示例应用程序。由于我不是开发应用程序的专业人士,因此我决定遵循此 simple tutorial并按照其中描述的步骤开发应用程序。唯一的区别是
我是一名优秀的程序员,十分优秀!