简体   繁体   English

pubnub推送通知钛机器人

[英]pubnub push notification titanium android

I using pubnub chat for android using titanium appcelerator platform, I had just crossed about the push notification to android via pubnub , It provides its own development kit for the chat clients but i tried to use it for android, I couldn't there is existing sample for ios but not for android actually. 我使用publdub聊天为Android使用钛appcelerator平台,我刚刚通过pubnub交叉关于android的推送通知,它为聊天客户端提供了自己的开发工具包但我试图用它来安装android,我不可能有现成的ios的样本,但实际上并不适用于android。 Anybody had crossed this issue...let me know how to use this. 任何人都遇到过这个问题......让我知道如何使用它。

Pub nub help link for push notification.... 推送通知的发布会帮助链接....

When using PubNub in an Android app (Phonegap or Native), you do not need to use GCM because you can implement a subscribe at boot service that forwards incoming messages to the background app using Intents. 在Android应用程序(Phonegap或Native)中使用PubNub时,您不需要使用GCM,因为您可以在启动服务上实现订阅,使用Intents将传入的消息转发到后台应用程序。 See this example for more details: https://help.pubnub.com/entries/21720011 CanmyAndroidAppReceiveMessagesWhileInactive 有关更多详细信息,请参阅此示例: https: //help.pubnub.com/entries/21720011 CanmyAndroidAppReceiveMessagesWhileInactive

That KB article has a link (hard to see in the article) that will lead you to the Subcrib-at-Boot example in the PubNub Andriod github repo here: https://github.com/pubnub/java/tree/master/android/examples/SubscribeAtBoot 知识库文章有一个链接(很难在文章中看到),它将引导您到PubNub Andriod github repo中的Subcrib-at-Boot示例: https//github.com/pubnub/java/tree/master/机器人/示例/ SubscribeAtBoot

Android with Phonegap You need to implement a Phonegap JavaScript/Java bridge which has a bit of work that can be implemented by following our Android Subscribe-at Boot (above) service solution and piece it together. 带有Phonegap的Android你需要实现一个Phonegap JavaScript / Java桥接器,它有一些工作可以通过遵循我们的Android订阅引导(上面)服务解决方案并将它们组合在一起来实现。 http://www.tipsfromsiliconvalley.com/2013/07/06/create aserviceonandroidwithphonegapap plication/ http://www.tipsfromsiliconvalley.com/2013/07/06/create aserviceonandroidwithphonegapap plication /

Actually it is pretty simple as i thought to create a pubnub notification. 实际上它很简单,因为我想创建一个pubnub通知。 We have to simply run background service and in that do the following steps., 我们必须简单地运行后台服务,然后执行以下步骤。

  • Add background service using this BOOT_COMPLETED Titanium module , 使用此BOOT_COMPLETED Titanium模块添加后台服务,
  • Before suscribe a new channel inside the background service code. 在后台服务代码中包含新频道之前。 (for eg.: MY_notify_channel ), (例如: MY_notify_channel ),
  • Next go to your chat screen , Next to the line that you are publishing to your private dynamic channel, Publish once again to our MY_notify_channel . 接下来转到您的聊天屏幕,在您要发布到私人动态频道的行旁边,再次发布到我们的MY_notify_channel

  • That's it when ever you publishing you get a message received in your service box, you have segregate your message in that and then create a notification manually. 就是这样,当您发布时,您收到了服务盒中收到的消息,您已将消息隔离,然后手动创建通知。 Titanium.Android.Notification link Titanium.Android.Notification链接

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

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