标签: notifications

从聊天服务器向Android发送聊天消息的好方法是什么?

我正在编写一个包含聊天系统的应用程序.我正处于一个需要为我的用户聊天的阶段.我有一个服务器端应用程序存储消息很好,但我不知道从Android设备与它通信的最佳方式是什么?

我的应用程序如何知道新数据的最大延迟,例如一秒钟?我是否需要每秒询问服务器,或者是否有任何其他方式通知应用程序已发送新消息,然后调用服务器获取数据.

你有建议如何构建消息吗?我的意思是可能会有很多聊天同时进行.

您认为解决此问题的最佳方法是什么?

谢谢

notifications android

0
推荐指数
1
解决办法
361
查看次数

如何设计引用多个表的灵活MySQL通知模式?

我决定使用另一个StackOverflow帖子的灵感来建立一个通知系统,该帖子建议我从通知正文中分解通知.因此,我有以下架构:

notifications
id | user_id | notification_object_id | is_read

notification_objects
id | message | type
Run Code Online (Sandbox Code Playgroud)

我已经设置了这种方式,因此我可以创建一个通知对象,并在通知对象适用于多个人的情况下将其发送给多个用户.类型是按类型将消息压缩成一个通知,类似于Facebook所说的方式,"John Doe,John Smith和其他27个用户评论......"而不是给你29个单独的通知.

(表和列的命名方案适用于CakePHP 3的'包含')

我需要帮助的是一种方法来绑定将在请求中扮演角色的不同用户或对象.用户可能已经评论过,因此我可能需要消息的用户的user_id,并且需要将其存储在某处.

除了用户之外还有其他情况; 人们可能想知道评论的ID,以便他可以点击通知并直接发表评论/ 81.我有很多用例,我想将不同类型的id存储为其他表(用户,评论,文章等)的外键,其中一些可能需要两个外键(比如说你想提及" Chris has评论了你的文章 '如何向StackOverflow寻求帮助'",并为Chris提供了user_id,并在通知中链接了文章的文章ID.

每种不同类型的通知都可以具有从中提取信息所需的不同值和表.什么是开始创建此架构的好地方?

php mysql schema notifications

0
推荐指数
1
解决办法
2351
查看次数

使用排序集到通知系统

我正在使用redis sorted sets来保存用户通知.但由于我从未做过通知系统,我问的是我的逻辑.

我需要为每个通知保存4件事.

  • POST_ID
  • post_type - A/B.
  • 可见 - Y/N.
  • 检查 - 是/否

我的问题是如何在排序集中存储这种类型的结构?

ZADD users_notifications:1 10 1_A_Y_Y 
ZADD users_notifications:1 20 2_A_Y_N
....
Run Code Online (Sandbox Code Playgroud)

在redis中有更好的方法来做这种类型的东西吗?在上面的例子中,我在每个元素中保存了四个东西,我需要在服务器语言中用下划线分割.

python notifications redis redis-py

0
推荐指数
1
解决办法
94
查看次数

如何在wordpress站点中实现(Noty)jquery通知

我是jquery世界的新手.我不知道如何在wordpress网站中实现"Noty - Notification"插件,如何创建通知和动画等.文档不包含帮助文件

这些是插件的内容

  • 布局[FOLDER](包括bottom.js,bottomleft.js,top.js,topright.js等文件...

  • 打包[FOLDER](包括两个文件jquery.noty.packaged.js和jquery.noty.packaged.min.js)

  • 主题[FOLDER](包括bootstrap.js,defalut.js和relax.js)

  • jquery.noty.js [FILE]

  • promise.js [FILE]

javascript wordpress jquery notifications noty

0
推荐指数
1
解决办法
4281
查看次数

在Android应用程序中设置通知/警报

我正在为java教程构建一个简单的Android应用程序,其中我想保留一个稍后阅读选项,用户可以使用该选项安排时间进行阅读,并且在指定时间我的应用程序应该向用户发出通知.即使我的应用程序当时没有打开,他也应该在通知栏中收到通知.我是android的新手,不知道怎么做.有人可以帮帮我吗?作为ai是新手的详细解释可能会更有帮助.谢谢提前:-)

notifications android

0
推荐指数
1
解决办法
7051
查看次数

无法解析android通知中的方法setLatestEventInfo

我刚刚导入了一个android项目,并且在Notification部分中,我必须使用setLatestEventInfo。但是Android Studio说无法解析方法setLatestEventinfo。这是我的代码段,请在回答时帮助您编辑我的代码

            NotificationManager nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
            Notification notification = new Notification(R.drawable.ic_launcher,"CEPF Mobile",0);
            Intent notify_intent = new Intent(context,SpecialSerivceReportActivity.class);
            notify_intent.putExtra("filename", "Special Service Report");
            notify_intent.putExtra("URL", urls[0]);
            PendingIntent contentIntent = PendingIntent.getActivity(context,(int)System.currentTimeMillis(),notify_intent,PendingIntent.FLAG_ONE_SHOT);
            notification.setLatestEventInfo(context, "CEPF Mobile", "New post in Special Service Report", contentIntent);
            notification.flags = Notification.FLAG_AUTO_CANCEL;
            notification.defaults = Notification.DEFAULT_SOUND ;
            nm.notify((int)System.currentTimeMillis(),notification);
            }
            else if(message.equalsIgnoreCase("Special Columnist Blog"))
            {

            NotificationManager nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
            Notification notification = new Notification(R.drawable.ic_launcher,"CEPF Mobile",0);
            Intent notify_intent = new Intent(context,SpecialSerivceReportActivity.class);
            notify_intent.putExtra("filename", "Special Columnist Blog");
            notify_intent.putExtra("URL", urls[1]);
            PendingIntent contentIntent = PendingIntent.getActivity(context,(int)System.currentTimeMillis(),notify_intent,PendingIntent.FLAG_ONE_SHOT);
            notification.setLatestEventInfo(context, "CEPF Mobile", "New …
Run Code Online (Sandbox Code Playgroud)

notifications android notificationmanager

0
推荐指数
1
解决办法
3653
查看次数

NSLocalNotification的重复.驳回.合适的方式

我想在上午10点创建每日通知,每天都有不同的内容.

func createNotification() {

let dateComp:NSDateComponents = NSDateComponents()
dateComp.hour = 10; // supposed to run each day at 10AM

var myCalendar:NSCalendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)!
var date:NSDate = myCalendar.dateFromComponents(dateComp)!

let localNotification = UILocalNotification()
localNotification.fireDate = date
localNotification.alertBody = getContentStringForNotification() // Method returns different string for each date
localNotification.repeatInterval = .Day // Repeats every day
localNotification.timeZone = NSTimeZone.defaultTimeZone()
UIApplication.sharedApplication().scheduleLocalNotification(localNotification)

}
Run Code Online (Sandbox Code Playgroud)

它重复通知.他们不断重复并返回昨天的通知.我搜索了Stack社区的问题,我没有找到解雇它们的正确方法.

我认为:

  • 应用程序已终止,它们已安排并独立于应用程序执行操作.反复运行应用程序将创建更多通知.
  • 通知没有被正确解雇,并且即使在第二天也会返回昨天的消息.

帮助:

  1. 什么是解雇他们或检查他们是否已被解雇的正确方法(确保他们不重复
  2. 我是否每天都会循环并创建所有年份的通知,或者每次运行应用程序时为明天创建一个新通知

我错过了什么?代码欢迎.谢谢!

notifications ios swift

0
推荐指数
1
解决办法
180
查看次数

如何在vaadin组件上显示通知

谁能帮帮我吗.

我需要在按钮上显示通知编号.就像我们在Facebook或vaadin表格上看到的一样,如下图所示.

我搜索了很多,但我没有得到满意的回答. 在此输入图像描述

提前致谢.潘卡

notifications components button vaadin vaadin7

0
推荐指数
1
解决办法
1262
查看次数

单击通知后调用服务中的方法

我有一个通知,我正在通过服务打电话.我想在通知点击时再次呼叫该服务.但是通知点击无法进入方法.

Intent intent = new Intent(this, MyService.class).setAction(ACTION_1);
PendingIntent resultPendingIntent = PendingIntent.getActivity(this, 0,intent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT);

    NotificationCompat.Builder mBuilder =
            new NotificationCompat.Builder(this)
                    .setSmallIcon(R.drawable.food)
                    .setContentTitle("notification")
                    .setContentText("near by you!");
   NotificationManager mNotificationManager =(NotificationManager) getSystemService(Service.NOTIFICATION_SERVICE);
Run Code Online (Sandbox Code Playgroud)

我想打电话的方法是

if (ACTION_1.equals(resultPendingIntent)) {
        getRecommendation();
    } 
        mBuilder.setContentIntent(resultPendingIntent);
    mNotificationManager.notify(id, mBuilder.build());
Run Code Online (Sandbox Code Playgroud)

我试过以下链接但无法解决我的问题. 如何通过单击通知来执行方法

notifications android

0
推荐指数
1
解决办法
2371
查看次数

每日预定通知

我需要一些指导,所以对于我的应用程序,我正在寻找使用本地通知每天早上7点发送通知.

我遇到的问题是如何使本地通知的内容主要是主体和附加图像?因为它每天都会因用户而异.

什么是最好的方法,因为你无法编辑未来的通知.

notifications swift3

0
推荐指数
1
解决办法
1095
查看次数