Latest 0.5.3.9
Homepage https://github.com/EugeneNguyen/XBPushChat
License MIT
Platforms ios 7.0, requires ARC
Dependencies JSQMessagesViewController, XBMobile, UIImage+ImageCompress, IDMPhotoBrowser, XBLanguage, XBGallery
Authors

CI Status
Version
License
Platform
PayPayl donate button

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

XBPushChat is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "XBPushChat"

How to use

  1. Install XBPushChat & PushChat + (a module of PlusIgniter)
  2. Config XBPushChat when app start:
[[XBPushChat sharedInstance] registerPush]; // register push notification, support all iOS
[[XBPushChat sharedInstance] setHost:@"http://ciplustest.libre.com.vn"]; // setup host of PushChat+

and some bootstrap

- (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. After get your userid (after login / register), you can start to chat:
[[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. Setup your presence

    [[XBPushChat sharedInstance] setPresence:1]; //1 is online. 0 is offline
  2. And show the chat view anytime you need


## Author

eugenenguyen, [email protected]

## Contact

Any question, request, suggest, please feel free to send to us. You're always welcome.

[LIBRETeamStudio](https://twitter.com/LIBRETeamStudio)

## License

XBMobile is available under the MIT license. See the LICENSE file for more info.

## Donation

This is open-source project. If you want to support us to keep develop this, or just give me a beer, don't be shy :) i will always appreciate that.

[![PayPayl donate button](http://img.shields.io/paypal/donate.png?color=yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y22J3LQZCAN2A "Donate once-off to this project using Paypal")

## License

XBPushChat is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "XBPushChat",
    "version": "0.5.3.9",
    "summary": "XBPushChat is a part of XBMobile family, which support you build up a chat application with minimum config & requirement of server",
    "description": "XBPushChat is a part of XBMobile family, which support you build up a chat application with minimum config & requirement of servernRequirement:niOS 7.0nPushChat server code (which will be publish soon :D sorry about this)n                       * Markdown format.n                       * Don't worry about the indent, we strip it!",
    "homepage": "https://github.com/EugeneNguyen/XBPushChat",
    "license": "MIT",
    "authors": {
        "eugenenguyen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/EugeneNguyen/XBPushChat.git",
        "tag": "0.5.3.9"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**",
    "resource_bundles": {
        "XBPushChat": [
            "Pod/Assets/*"
        ]
    },
    "dependencies": {
        "JSQMessagesViewController": [],
        "XBMobile": [],
        "UIImage+ImageCompress": [],
        "IDMPhotoBrowser": [],
        "XBLanguage": [],
        "XBGallery": []
    }
}

Pin It on Pinterest

Share This