Untitled

 avatar
unknown
plain_text
5 months ago
15 kB
3
Indexable
-(void)performNotificationActionForCMSNotificationByTag:(NSInteger)tag andSubId:(NSString *)strSubId exiPageId:(NSString *)exhi_page_id andMessageType:(NSString *)strMessageType andModel:(PushNotificationModel *)model
{
    NSMutableDictionary *dicUserData = UserDataFromUD;
    NSMutableDictionary *dicTemp = EventDataFromUD;
    NSMutableArray *arrEventData = [[NSMutableArray alloc] init];
    arrEventData = [dicTemp valueForKey:@"events"];
    
    UIViewController *currentCtrl = [Utility getCurrectViewController];
    if([strMessageType isEqualToString:kNotificationCustomPage]){
        CMSPagesVC *ctrl = [[CMSPagesVC alloc] init];
        ctrl.cms_id = tag;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }else {
    if(tag == [AGENDA_ID integerValue])
    {
//        if (strSubId.length > 0){
//            UIStoryboard *storyBoardCommon = [UIStoryboard storyboardWithName:@"AgendaStoryboard" bundle:nil];
//            AgendaDetailVC *ctrl = [storyBoardCommon instantiateViewControllerWithIdentifier:@"AgendaDetailVC"];
//            ctrl.stragenda_id = strSubId;
//            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
//        }else{
//            NSMutableArray *AgendaGroupList = [[NSMutableArray alloc] init];
//            NSMutableArray *AgendaCategoryist = [[NSMutableArray alloc] init];
//            AgendaGroupList = [AppOfflineStorage getOfflineDataForAgendaGroupList];
//            AgendaCategoryist = [AppOfflineStorage getOfflineDataForAgendaCategoryListWithGroupId:@""];
//            
//            if(AgendaGroupList.count == 0)
//            {
//                if(AgendaCategoryist.count == 0)
//                {
//                    AgendaVC *ctrl = [[AgendaVC alloc] init];
//                    ctrl.strMenuId = AGENDA_ID;
//                    ctrl.isForceLogin = NO;
//                    ctrl.strCategoryId = @"";
//                    pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
//                }
//                else
//                {
//                    AgendaCategoryListVC *ctrl = [[AgendaCategoryListVC alloc]init];
//                    ctrl.strGroupId = @"";
//                    pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
//                }
//            }
//            else
//            {
//                AgendaGroupListVC *ctrl = [[AgendaGroupListVC alloc] init];
//                ctrl.isForceLogin = NO;
//                pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
//            }
//        }
        if ([CHECK_NULL_STRING(model.is_agenda_session) isEqualToString: @"0"])
        {
            AgendaVC *ctrl = [[AgendaVC alloc] init];
            ctrl.strMenuId = AGENDA_ID;
            ctrl.isForceLogin = NO;
            ctrl.strCategoryId = @"";
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }else if ([CHECK_NULL_STRING(model.is_agenda_session) isEqualToString: @"1"])
        {
            AgendaVC *ctrl = [[AgendaVC alloc] init];
            ctrl.strMenuId = AGENDA_ID;
            ctrl.isForceLogin = NO;
            ctrl.strCategoryId = CHECK_NULL_STRING(model.agenda_category_id);
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }else {
            UIStoryboard *storyBoardCommon = [UIStoryboard storyboardWithName:@"AgendaStoryboard" bundle:nil];
            AgendaDetailVC *ctrl = [storyBoardCommon instantiateViewControllerWithIdentifier:@"AgendaDetailVC"];
            ctrl.stragenda_id = model.agenda_session_id;
            ctrl.strevent_id = [[arrEventData firstObject] objectForKey:@"Id"];
            ctrl.strevent_type = [[arrEventData firstObject] objectForKey:@"Event_type"];
            ctrl.struser_id = [dicUserData objectForKey:@"User_id"];
            ctrl.strtoken = [dicUserData objectForKey:@"token"];
            ctrl.isUserAgenda = YES;
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }
    }
    else if (tag == [ATTENDEE_ID integerValue])
    {
        if (strSubId.length > 0){
            AttendeeDetailVC *ctrl = [[AttendeeDetailVC alloc] init];
            ctrl.strAttendeeId = strSubId;
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }else{
            if([CHECK_NULL_STRING([[arrEventData firstObject] objectForKey:@"show_attendee_category"]) isEqualToString:@"1"])
            {
                AttendeeParentCategoryListVC *ctrl = [[AttendeeParentCategoryListVC alloc]init];
                pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
            }
            else
            {
                AttendeeListVC *ctrl = [[AttendeeListVC alloc]init];
                pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
            }
        }
    }
    else if (tag == [EXIBITOR_ID integerValue])
    {
        if (strSubId.length > 0){
            ExibitorDetailVC *ctrl = [[ExibitorDetailVC alloc]init];
            ctrl.strExibitorId = strSubId;
            ctrl.strExibitorPageId = exhi_page_id;
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }else{
            ExibitorCategoryListVC *ctrl = [[ExibitorCategoryListVC alloc]init];
            ctrl.isForceLogin = NO;
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }
    }
    else if (tag == [SPEAKER_ID integerValue])
    {
        if (strSubId.length > 0){
            SpeakerDetailVC *ctrl = [[SpeakerDetailVC alloc]init];
            ctrl.strSpeakerId = strSubId;
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }else{
            GeneralListingsVC *ctrl = [[GeneralListingsVC alloc]init];
            ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
            ctrl.isSpeakerList = YES;
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }
    }
    else if (tag == [SPONSOR_ID integerValue])
    {
        if (strSubId.length > 0){
            SponsorDetailVC *ctrl = [[SponsorDetailVC alloc]init];
            ctrl.strSponsorId = strSubId;
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }else{
            NSMutableArray *arrSpondorGroupList = [[NSMutableArray alloc] init];
            arrSpondorGroupList = [AppOfflineStorage getOfflineDataForSponsorGroupList];
            
            if(arrSpondorGroupList.count == 0)
            {
                GeneralListingsVC *ctrl = [[GeneralListingsVC alloc]init];
                ctrl.strMenuId=SPONSOR_ID;
                ctrl.isSponsorList = YES;
                ctrl.isForceLogin = NO;
                ctrl.strSponsorGroupId = @"";
                pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
            }
            else
            {
                SponsorGroupListVC *ctrl = [[SponsorGroupListVC alloc]init];
                ctrl.isForceLogin = NO;
                pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
            }
        }
    }
    else if (tag == [SOCIAL_ID integerValue])
    {
        SocialVC *ctrl = [[SocialVC alloc]init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if(tag == [MAP_ID integerValue])
    {
        NSMutableArray *arrMapGroupList = [[NSMutableArray alloc] init];
        arrMapGroupList = [AppOfflineStorage getOfflineDataForMapGroupList];
        
        if(arrMapGroupList.count == 0)
        {
            MapVC *ctrl = [[MapVC alloc] init];
            ctrl.strGroupId = @"";
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }
        else
        {
            MapGroupListVC *ctrl = [[MapGroupListVC alloc]init];
            ctrl.isForceLogin = NO;
            pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        }
    }
    else if (tag == [VIEW_NOTES_ID integerValue])
    {
        ViewNotesVC *ctrl = [[ViewNotesVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [TWITTER_ID integerValue])
    {
        TweeterFeedVC *ctrl = [[TweeterFeedVC alloc]init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [PRESENTATION_ID integerValue])
    {
        PresentationVC *ctrl = [[PresentationVC alloc]init];
        ctrl.strEventId = [[arrEventData firstObject] valueForKey:@"Id"];
        ctrl.strEventType = [[arrEventData firstObject] valueForKey:@"Event_type"];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        
        if(GetBoolForKey(IS_LOGIN))
        {
            ctrl.strToken = [dicUserData valueForKey:@"token"];
        }
        else
        {
            ctrl.strToken = @"";
        }
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [PRIVATE_MSG_ID integerValue])
    {
        PrivateMessageListVC *ctrl = [[PrivateMessageListVC alloc] init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [PUBLIC_MSG_ID integerValue])
    {
        PublicMessageVC *ctrl = [[PublicMessageVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [SURVEY_ID integerValue])
    {
        SurveyListVC *ctrl = [[SurveyListVC alloc]init];
        ctrl.isForceLogin = NO;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [PHOTOS_ID integerValue])
    {
        PhotosVC *ctrl = [[PhotosVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [DOCUMENT_ID integerValue])
    {
        DocumentsViewController *ctrl = [[DocumentsViewController alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [FUNDRAISING_HOME_ID integerValue])
    {
        FundraisingHomeVC *ctrl = [[FundraisingHomeVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [SILENT_AUCTION_ID integerValue])
    {
        ProductsListVC *ctrl = [[ProductsListVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        ctrl.isSilentAuction = YES;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [LIVE_AUCTION_ID integerValue])
    {
        ProductsListVC *ctrl = [[ProductsListVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        ctrl.isLiveAuction = YES;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [BUY_NOW_ID integerValue])
    {
        ProductsListVC *ctrl = [[ProductsListVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        ctrl.isBuyNow = YES;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [PLEDGE_ID integerValue])
    {
        ProductsListVC *ctrl = [[ProductsListVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        ctrl.isPledge = YES;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [ACTIVITY_ID integerValue])
    {
        ActivityFeedVC *ctrl = [[ActivityFeedVC alloc]init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [INSTAGRAM_ID integerValue])
    {
        InstagramFeedVC *ctrl = [[InstagramFeedVC alloc]init];
        ctrl.strMenuId = [NSString stringWithFormat:@"%ld",(long)tag];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
        //        UIStoryboard *storyBoardCommon = [UIStoryboard storyboardWithName:@"CommonStoryboard" bundle:nil];
        //        InstagramPostVC *ctrl = [storyBoardCommon instantiateViewControllerWithIdentifier:@"InstagramPostVC"];
        //        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [FACEBOOK_ID integerValue])
    {
        FacebookFeedVC *ctrl = [[FacebookFeedVC alloc] init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [FAVOURITES_ID integerValue])
    {
        FavouritesListVC *ctrl = [[FavouritesListVC alloc]init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [QA_SESSION_ID integerValue])
    {
        QAGroupListVC *ctrl = [[QAGroupListVC alloc]init];
        ctrl.isForceLogin = NO;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [NOTIFICATION_CENTER_ID integerValue])
    {
        NotificationCenterVC *ctrl = [[NotificationCenterVC alloc]init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if(tag == [GAMIFICATION_ID integerValue])
    {
        GamificationVC *ctrl = [[GamificationVC alloc] init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if(tag == [PHOTO_FILTER_ID integerValue])
    {
        PhotoFilterVC *ctrl = [[PhotoFilterVC alloc] init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if(tag == [LEAD_RETRIVAL_ID integerValue])
    {
        LeadRetrievalVC *ctrl = [[LeadRetrievalVC alloc] init];
        ctrl.isForceLogin = NO;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [CMS_ID integerValue])
    {
        CMSMainGroupList *ctrl = [[CMSMainGroupList alloc] init];
        ctrl.isForceLogin = NO;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [BADGE_SCANNER_ID integerValue])
    {
        QRCodeBarCodeScannerVC *ctrl = [[QRCodeBarCodeScannerVC alloc] init];
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [MATCH_MAKING_ID integerValue])
    {
        MatchMakingListVC *ctrl = [[MatchMakingListVC alloc] init];
        ctrl.isForceLogin = NO;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [SUPPORT_CHAT_ID integerValue])
    {
        PrivateMessageDetailVC *ctrl = [[PrivateMessageDetailVC alloc]init];
        ctrl.strSenderId = [dicTemp objectForKey:@"support_user"];
        ctrl.isOpenFromSupportChat = YES;
        pushFromViewCtrlToViewCtrlWithAnimation(currentCtrl, ctrl, YES);
    }
    else if (tag == [HOME_ID integerValue])
    {
        if(![[Utility getCurrectViewController] isEqual:[HomeVC class]] && ![[Utility getCurrectViewController] isEqual:[FundraisingHomeVC class]]){
            [Utility redirectToHomeOrFundraisingHomeVC];
        }
    }
}
}
Editor is loading...
Leave a Comment