测试已测试 | ✓ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布最后一次发布 | 2015年10月 |
由 Eugene Nguyen 维护。
依赖 | |
JSQMessagesViewController | >= 0 |
XBMobile | >= 0 |
UIImage+ImageCompress | >= 0 |
IDMPhotoBrowser | >= 0 |
XBLanguage | >= 0 |
XBGallery | >= 0 |
要运行示例项目,首先克隆仓库,然后从示例目录运行 pod install
[[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];
}
[[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]
有任何问题、请求或建议,请随时联系我们。您总是受欢迎的。
XBMobile 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。
这是一个开源项目。如果您想支持我们继续开发这个项目,或者只是想请我喝杯啤酒,不要害羞 :) 我会永远感激的。
XBPushChat 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。