XBPushChat 0.5.3.13

XBPushChat 0.5.3.13

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后一次发布2015年10月

Eugene Nguyen 维护。



 
依赖
JSQMessagesViewController>= 0
XBMobile>= 0
UIImage+ImageCompress>= 0
IDMPhotoBrowser>= 0
XBLanguage>= 0
XBGallery>= 0
 

XBPushChat 0.5.3.13

  • eugenenguyen

用法

要运行示例项目,首先克隆仓库,然后从示例目录运行 pod install

需求

安装

如何使用

  1. 安装XBPushChat & PushChat(PlusIgniter 中的一个模块)
  2. 应用启动时配置XBPushChat
[[XBPushChat sharedInstance] registerPush]; // register push notification, support all iOS
[[XBPushChat sharedInstance] setHost:@"http://ciplustest.libre.com.vn"]; // setup host of PushChat+

以及一些引导程序

- (void)applicationWillResignActive:(UIApplication *)application
{
    [[XBPushChat sharedInstance] setPresence:0];
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    [[XBPushChat sharedInstance] setPresence:0];
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    [[XBPushChat sharedInstance] setPresence:1];
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    [[XBPushChat sharedInstance] setPresence:1];
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    [[XBPushChat sharedInstance] setPresence:0 synchronous:YES];
}

#pragma mark - Push Delegate

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
    [[XBPushChat sharedInstance] didReceiveToken:deviceToken];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    [[XBPushChat sharedInstance] didReceiveRemoteNotification:userInfo];
}

- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
    [[XBPushChat sharedInstance] didFailToRegisterForRemoteNotification:error];
}
  1. 在获取到您的用户id(登录/注册之后)后,您就可以开始聊天了
[[XBPushChat sharedInstance] setSender_id:99]; // 99 is your userid
```objc

4. Fetch your history
```objc
[[XBPushChat sharedInstance] fetchAllRequest]; //get all history
//or 
[[XBPushChat sharedInstance] fetchRequestWith:100]; //get all message between you and user 100
  1. 设置您的存在
[[XBPushChat sharedInstance] setPresence:1]; //1 is online. 0 is offline
  1. 并在需要时显示聊天视图

作者

eugenenguyen, [email protected]

联系方式

有任何问题、请求或建议,请随时联系我们。您总是受欢迎的。

LIBRETeamStudio

许可证

XBMobile 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。

捐赠

这是一个开源项目。如果您想支持我们继续开发这个项目,或者只是想请我喝杯啤酒,不要害羞 :) 我会永远感激的。

许可证

XBPushChat 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。