如何收到一条消息,当应用程序在后台? (机器人,团结,GCM) [英] How to receive a message when the app is in background? (Android, Unity, GCM)

查看:341
本文介绍了如何收到一条消息,当应用程序在后台? (机器人,团结,GCM)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常有经验的团结和iOS,我可以部署我的应用程序统一到Android。但我不知道原生Android的东西什么。

I'm very experienced on Unity and iOS and I can deploy my Unity app to Android. But I don't know anything about native Android stuff.

我的问题是关于接收GCM消息,并呈现出通知时,Android应用程序是在后台。我实现了它和它的作品完美的,当应用程序在前台,但我的GCM消息监听器没有被触发时,应用程序在后台,我不能显示通知。

My problem is about receiving a GCM message and showing a notification when the android app is in background. I implemented it and it works perfect when the app is in foreground but my GCM message listener isn't being triggered when the app is in background and I can't show the notification.

我使用这个插件用于接收GCM消息: https://github.com/kskkbys/unity-gcm
我用这个用于显示通知: HTTPS://www.assetstore.unity3d。 COM / EN /#!/内容/ 9484

I use this plugin for receiving GCM messages : https://github.com/kskkbys/unity-gcm I use this for showing the notification : https://www.assetstore.unity3d.com/en/#!/content/9484

我试着伸手这些插件的作者,但他们并没有很长一段时间答复...

I tried to reach out the authors of these plugins but they didn't reply for a long time...

推荐答案

我用Android原生插件从资产存储StansAssets解决我的问题。随着他的实现,Android设备显示了当云邮件到达,即使应用程序在后台的通知。轻敲通知打开的应用程序。

I solved my problem by using "Android Native" plugin from StansAssets in asset store. With his implementation, android device shows a notification when the cloud message arrives even if the app is in the background. Tapping on the notification opens up the app.

这篇关于如何收到一条消息,当应用程序在后台? (机器人,团结,GCM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆