dtnmuyoiw680512744 2016-04-15 09:35
浏览 41
已采纳

Pubnub在ios聊天

There is project which have chat feature which is been done by using PubNub. I had gone through the tutorial provided by PubNub and had integrated the pubnub.framework and CocoaLumberjack in my project. And had added the coded as shown in this tutorial

My questions are:

  1. Do i have to create different channel to chat with the different friends? Or how the channel in the PubNub will work? I want to do only one-one chat. I don't want to implement any group chats. As per my study from using PubNub for multi users chatting every user have their own channel. But in that case how can I load the unread message count or messages when I am offline.

  2. What is the process to install the PubNub server in my backend server? I am using backend as PHP Laravel.

  • 写回答

2条回答 默认 最新

  • doulouxun6756 2016-04-15 21:47
    关注
    1. you are free to create an unlimited number of channels, so for 1-1 chats, every user is subscribed to their own private channel. to chat with you, I publish a message to your private channel. here is a write-up that outlines this in more detail. for short periods of being offline (less than 10 mins), you can rely on the catch-up mechanism (make sure you configure this). for retrieving the actual messages while you were offline, you can use the history() function of Storage & Playback. retrieving only the count of unread messages requires logic on your end... perhaps keeping count of the number of messages published for each channel in your backend database, and then clients can make a REST call to your backend to retrieve this count.

    2. PubNub has a PHP SDK you can use... what do you plan on having your backend server do?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀