简体   繁体   English

Xamarin.Forms - 适用于 iOS 和 Android 的推送通知

[英]Xamarin.Forms - Push notification for iOS and Android

Hell.地狱。 I'm just write my first mobile app and I use XamarinForms我正在编写我的第一个移动应用程序,我使用 XamarinForms

So I try understand to understand how work push notification here....and i'm a little bit confused所以我试着理解这里的工作推送通知......我有点困惑

So this is what I understand所以这就是我的理解

For android I MUST(!) use google cloud messaging - right?对于 android,我必须(!)使用谷歌云消息传递 - 对吗? For iOS - I MUST(!) use Apple Apple Notification Push Service - right?对于 iOS - 我必须(!)使用 Apple Apple 通知推送服务 - 对吗?

Now my question: If I use xamarin forms - i write 1 code to 2 platfoms andoid/iOS - right??现在我的问题是:如果我使用 xamarin 表单-我将 1 个代码写入 2 个平台 andoid/iOS-对吗? so how i can write 1 code both for gcm and apple notif????那么我如何为 gcm 和 apple notif 编写 1 个代码????

How I think - but not sure - I need write interface in my PCL and then write separate implementation in each platform??我怎么想 - 但不确定 - 我需要在我的 PCL 中编写接口,然后在每个平台中编写单独的实现? This is write way??这是写法??

Why I need Push notifications?为什么我需要推送通知?

I have app and when admin attach task to user - he will get notification about he has new task.我有应用程序,当管理员将任务附加到用户时 - 他会收到有关他有新任务的通知。

Or when user use app - real time get new data - new task或者当用户使用应用程序时 - 实时获取新数据 - 新任务

So if you can give me a tips - thank you.所以,如果你能给我一个提示 - 谢谢。

Sorry for my English grammar)对不起我的英语语法)

Thank you.谢谢你。

Take a look to this plugin https://github.com/rdelrosario/xamarin-plugins/tree/master/PushNotification in the description you can find the proper setup for each platform.在描述中查看此插件https://github.com/rdelrosario/xamarin-plugins/tree/master/PushNotification ,您可以找到每个平台的正确设置。 Also keep in mind that even if you're using Xamarin.Forms you will need to know how works push notifications on each platform.另请记住,即使您使用 Xamarin.Forms,您也需要了解每个平台上推送通知的工作原理。

Android.安卓。 https://developers.google.com/cloud-messaging/ iOS. https://developers.google.com/cloud-messaging/ iOS。 https://developer.apple.com/notifications/ https://developer.apple.com/notifications/

is you have any specific question about it pls let me know你有什么具体问题请告诉我

Azure has "push notification hub" that plugs into both iOS and Google Try that. Azure 具有插入 iOS 和 Google 的“推送通知中心”。 Once youve set it up it will push stuff to google and to apple.一旦你设置了它,它就会把东西推送到谷歌和苹果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM