FCM与AWS SNS [英] FCM with AWS SNS
问题描述
我正在为我的android项目使用 1.是 2 .Do 3.我试过将FCM API密钥放入SNS应用程序平台中,它显示无效参数为什么? 然而, ,如果您要将 有 GCM-FCM迁移说明由Google提供,但您需要进行的更改主要在应用程序方面。 您需要遵循以下步骤在您的应用程序上使用SNS测试GCM / FCM: 由SNS生成的消息将采用以下格式: 如前所述,如果没有服务, 完成此操作后,请确保您的应用未在设备上运行,然后点击发布消息按钮。您现在应该会看到在您的设备上弹出通知。 当然,您可以通过Amazon SNS API以编程方式完成所有这些操作,但所有示例似乎都使用 I am using 1.Does 2.Do 3.I tried putting FCM api key in SNS application platform, it is showing invalid parameters why? FCM is backwards compatible with GCM. The steps for setting up FCM on AWS are identical to the GCM set up procedure and (at least for the moment) FCM works transparently with GCM and SNS with respect to server-side configuration. However, if you are sending There are GCM-FCM migration instructions provided by Google however the changes you need to make are predominantly on the App side. The steps you need to follow to test GCM/FCM on your app with SNS are: The message that is generated by SNS Will be of the form: As we mentioned earlier, Once you have done this, make sure your app is not running on the device, and hit the Publish Message button. You should now see a notification pop up on your device. You can of course do all this programatically through the Amazon SNS API, however all the examples seem to use the 这篇关于FCM与AWS SNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! AWS
资源,我打算使用 AWS SNS $ c为我的项目添加推送通知服务$ c>。有几个问题困扰我很多。我没有发现任何有关这些问题的问题,除了一两个问题,但解释不清楚。
AWS
支持 FCM
? SNS
使用 GCM
。但Google建议使用FCM而不是 GCM
。我没有找到 AWS
支持 FCM
。
AWS 将消息(或数据)存储到数据库中,甚至在发送推送通知之后?
data
有效载荷发送至Android设备,则除非您实施客户端服务,它扩展了 FirebaseMessagingService
。 AWS控制台中的默认JSON消息生成器会发送 data
消息,除非实现上述服务,否则这些消息将被您的应用忽略。为了解决这个问题,你可以提供一个定制的通知
有效载荷,这个有效载荷将会被你的设备接收(只要你的应用程序不在前台)
FirebaseInstanceIDService
并覆盖 onTokenRefresh
方法才能在您的Android应用程序中查看此内容。 完成此操作后,请卸载并重新安装您的应用程序,并且您的令牌应在首次启动时打印到Android Studio中的调试控制台。
{
GCM:{\data \:{\message \:\test message \}}
}
data
有效载荷将被忽略接收他们已经实施。我们想测试而不写太多的代码,所以我们应该发送一个通知
有效载荷。要做到这一点,只需将JSON消息更改为:
{
GCM:{\通知\:{\text \:\test message \}}
}
data
有效载荷,因此您需要牢记这一点,并生成适合您的用例的有效负载。AWS
resources for my android project, I am planning to add push notification service for my project with AWS SNS
.there are few questions bothering me much. I did not find any questions regarding these, except one or two but with unclear explanations.AWS
support FCM
? SNS
work with GCM
. But Google recommends to use FCM instead of GCM
. I did not find AWS
supporting FCM
.AWS
store messages (or data) into their databases even after sending push notifications?data
payloads to the Android device they will not be processed unless you implement a client side service that extends FirebaseMessagingService
. The default JSON message generator in the AWS console sends data
messages, which will be ignored by your app unless the aforementioned service is implemented. To get around this for initial testing you can provide a custom notification
payload which will be received by your device (as long as your app is not in the foreground)
FirebaseInstanceIDService
and Override the onTokenRefresh
method to see this within your Android App. Once you have done this, un-install and re-install your app and your token should be printed to the Debug console in Android Studio on first boot.{
"GCM": "{ \"data\": { \"message\": \"test message\" } }"
}
data
payloads will be ignored if no service to receive them has been implemented. We would like to test without writing too much code, so instead we should send a notification
payload. To do this, simply change the JSON message to read:{
"GCM": "{ \"notification\": { \"text\": \"test message\" } }"
}
data
payload so you need to keep that in mind and generate a payload appropriate to your use case.