如何在android中实现推送通知
我正在对推送通知进行大量研究,但我不明白如何在 android 1.6 中实现。我想问一下这个有什么要求吗?我们从服务器端获取哪种类型的信息,无论是以标签形式还是仅以信息形式?与此相关的输入或输出是什么。我向服务器提供哪些输入以及来自服务器的输出。 是否需要任何设备 ID?请推荐我谢谢。
I am doing lots of Research on push notification but i don't understand how to implement in android 1.6. I want to ask what is the requirements for this? which type of information we get from the server end either in tags form or just information? what will be the input or output regarding this.Which input i give to the server and which output comes from the server.
is there any device id to be require for this? Please suggest me Thanks .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是 Google 提供的文档的链接。他们将 PushNotification 的概念命名为 C2DM(云到设备消息传递)。
您可以通过访问给定的链接获得清晰的描述。我将为您的问题提供一些简短的回答。
版本
This is the link to documentation given by the Google. They named the concept of PushNotification as C2DM (Cloud To Device Messaging)
You can get a clear description by visiting the given link. I'll give you some short answere for your questions.
version
在Firebase中,我们可以将包含多条信息的通知推送到特定或多个设备,因为我们需要从android端实现一些代码,首先,我们需要在您的应用程序中设置firebase配置,我将介绍如何重定向将通知推送到移动应用程序中的特定或默认屏幕。
两种打开应用程序屏幕的方式
默认情况下,当您只需要打开应用程序时(如启动屏幕)
创建一个名为“FirebaseMessagingService”的类并扩展“FirebaseMessagingService”
代码来实现
创建通知管理器类来管理具有不同参数的显示方法
现在只需通过 Firebase 控制台触发通知或通过 API 发送,例如:-
2.重定向到中的特定屏幕该应用程序。
打开 AndroidManifest.xml 并在您需要定义的活动标记中...
现在调用 API
In Firebase we can push notification with multiple pieces of information to the specific or multiple devices for that we need to implement some code from the android side, first, we need to set up the firebase configuration in your app, I will cover how to redirect push notification to specific or default a screen in the mobile application.
Two ways to open the application screen
By default when you only need to open the application(Like splash screen)
Create a class Named "FirebaseMessagingService" and extends "FirebaseMessagingService"
Code to implement
Create Notification Manager class to manage the display method with different parameters
Now just trigger the notification through Firebase console or send through API like:-
2.Redirect to the specific screen in the application.
Open the AndroidManifest.xml and in activity tag you need to define ...
now call the API