Commit c37dd5eb by ludi

解决了离线推送的问题

parent 94536913
......@@ -83,14 +83,15 @@ import SwiftyJSON
set { FUSSwiftCacheDataShare.share.isNewRegister.accept(newValue) }
}
// - test part
/// 测试数据
@objc public var oc_testDataList: [String] = .init()
/// 添加测试数据
@objc public static func fus_addTestLog(msg: String) {
FUSSwiftCacheDataShare.share.oc_testDataList.append(msg)
// FUSSwiftCacheDataShare.share.oc_testDataList.append(msg)
}
@objc public static func fus_addTestLog(title: String, object: [AnyHashable: Any]){
FUSSwiftCacheDataShare.share.oc_testDataList.append(title + (JSON(object).rawString() ?? ""))
// FUSSwiftCacheDataShare.share.oc_testDataList.append(title + (JSON(object).rawString() ?? ""))
}
// - swift PART
......
......@@ -56,8 +56,8 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
// 第一次启动执行
[self firstLaunchHandle];
[self fus_appStartPermissionCheckWithOptions:launchOptions];
[UNUserNotificationCenter currentNotificationCenter].delegate = self;
[self fus_appStartPermissionCheckWithOptions:launchOptions];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[FIRApp configure];
......@@ -307,7 +307,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
// iOS 10: 点击通知进入App时触发,在该方法内统计有效用户点击数
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"111111111"];
[self handleNotificationEventWithContent:response.notification.request.content.userInfo notificontent:response.notification.request.content];
[self fus_handleChatLocalAPNsNotification:response];
// [ GTSdk ]:将收到的APNs信息传给个推统计
......@@ -336,7 +336,6 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
- (void)handleNotificationEventWithContent:(NSDictionary *)content notificontent:(UNNotificationContent *)notificontent{
[FUSSwiftCacheDataShare fus_addTestLogWithTitle:@"22222content:" object:content];
// 个推
__block NSDictionary *transmissionContent = [content[@"transmissionContent"] converToDictionary];
......@@ -369,14 +368,13 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
}
if ([NSDictionary isNull:transmissionContent] == NO) {
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"333333333"];
MJWeakSelf
[FUSRouter.userRouter fus_loginSucceedListener:^{
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"444444444444"];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (FUSCacheDataShare.shareStore.userDetailInfo.uid) {
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"555555555555"];
// 准备上报的材料
NSMutableDictionary *reqDataJSON = [[NSMutableDictionary alloc] initWithDictionary:[transmissionContent copy]];
reqDataJSON[@"data"][@"title"] = notificontent.title ?: @"";
......@@ -414,12 +412,11 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
}
- (void)startJumpIntoPage:(NSDictionary *)content logExtraJson:(NSString *)logExtraJson{
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:[NSString stringWithFormat:@"6666666666logExtraJson:%@",logExtraJson]];
// 如果还没登录的话,不需要做跳转操作
if (FUSCacheDataShare.shareStore.userDetailInfo.uid == nil) {
return;
}
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"77777777777"];
NSInteger type = [content[@"type"] integerValue];
NSDictionary *info = content[@"data"];
if ([NSDictionary isNull:info] == NO) {
......@@ -432,7 +429,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
} else if (info[@"userId"]) {
userId = info[@"userId"];
}
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"888888888888"];
[FUSAlertView fus_dismissAllAlertViewWithAnimate:YES];
......@@ -463,7 +460,6 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
NSString *cacheUDKey = [FUSLiveUDKeys fus_LiveRoomPasswordCacheUDKEY:userId];
[[NSUserDefaults standardUserDefaults] setValue:password forKey:cacheUDKey];
}
[FUSSwiftCacheDataShare fus_addTestLogWithMsg:@"9999999999999"];
[FUSRouter.liveRouter fus_enterLiveRoom:userId];
[FUSDataStatisticsManager fus_behaviorJoinRoomLogWithReqType:5 reqEventType:1 extraInfo:@"" extraJson:logExtraJson roomId:userId];
break;
......@@ -549,7 +545,7 @@ typedef NS_ENUM(NSInteger, FFOutsideJumpAPPType) {
- (void)GeTuiSdkDidReceiveNotification:(NSDictionary *)userInfo notificationCenter:(UNUserNotificationCenter *)center response:(UNNotificationResponse *)response fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// [self handleNotificationEventWithContent:response.notification.request.content.userInfo notificontent:response.notification.request.content];
[self handleNotificationEventWithContent:response.notification.request.content.userInfo notificontent:response.notification.request.content];
if (completionHandler) completionHandler(UIBackgroundFetchResultNoData);
}
......
......@@ -205,13 +205,11 @@ public class FUSInviteRewardController: FUSBaseViewController {
let scanBtn = UIButton(type: .custom)
scanBtn.setImage(FUSUserCenterBunble.imageNamed("inviteReward_navi_scan_icon"), for: .normal)
scanBtn.rx.tap.subscribe(onNext: {
// FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false) {
// FUSRouter.userRouter().fus_showBindAgentSuccessPopView {
//
// }
// }
let vc = FUSNotificationTestController()
self.navigationController?.pushViewController(vc, animated: true)
FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false) {
FUSRouter.userRouter().fus_showBindAgentSuccessPopView {
}
}
})
.disposed(by: disposeBag)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment