TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2015 |
Maintained by Eugene Nguyen.
Depends on: | |
JSQMessagesViewController | >= 0 |
XBMobile | >= 0 |
UIImage+ImageCompress | >= 0 |
IDMPhotoBrowser | >= 0 |
XBLanguage | >= 0 |
XBGallery | >= 0 |
To run the example project, clone the repo, and run pod install
from the Example directory first.
[[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];
}
[[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
[[XBPushChat sharedInstance] setPresence:1]; //1 is online. 0 is offline
eugenenguyen, [email protected]
Any question, request, suggest, please feel free to send to us. You're always welcome.
XBMobile is available under the MIT license. See the LICENSE file for more info.
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.
XBPushChat is available under the MIT license. See the LICENSE file for more info.