diff --git a/Ash_AWord.xcodeproj/project.pbxproj b/Ash_AWord.xcodeproj/project.pbxproj index 68e1541..7792d98 100644 --- a/Ash_AWord.xcodeproj/project.pbxproj +++ b/Ash_AWord.xcodeproj/project.pbxproj @@ -27,6 +27,10 @@ A90BA01F1AD606AE00728393 /* voice-record-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A90BA01E1AD606AE00728393 /* voice-record-icon@2x.png */; }; A90BA0211AD606B400728393 /* voice-record-level@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A90BA0201AD606B400728393 /* voice-record-level@2x.png */; }; A90BA0231AD619B500728393 /* voice-record-level-bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A90BA0221AD619B500728393 /* voice-record-level-bg@2x.png */; }; + A91F84BF1B3A7A6900DDFEA0 /* sr_refresh.png in Resources */ = {isa = PBXBuildFile; fileRef = A91F84B81B3A7A6900DDFEA0 /* sr_refresh.png */; }; + A91F84C01B3A7A6900DDFEA0 /* sr_refresh@2X.png in Resources */ = {isa = PBXBuildFile; fileRef = A91F84B91B3A7A6900DDFEA0 /* sr_refresh@2X.png */; }; + A91F84C11B3A7A6900DDFEA0 /* SRRefreshView.m in Sources */ = {isa = PBXBuildFile; fileRef = A91F84BC1B3A7A6900DDFEA0 /* SRRefreshView.m */; }; + A91F84C21B3A7A6900DDFEA0 /* SRSlimeView.m in Sources */ = {isa = PBXBuildFile; fileRef = A91F84BE1B3A7A6900DDFEA0 /* SRSlimeView.m */; }; A93441DE1ACA311700A6B233 /* Ash_UIUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A93441DD1ACA311700A6B233 /* Ash_UIUtil.m */; }; A93441E11ACA89AA00A6B233 /* Profile_filter_voiceIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441DF1ACA89AA00A6B233 /* Profile_filter_voiceIcon@2x.png */; }; A93441E21ACA89AA00A6B233 /* Profile_filter_voiceIconClick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A93441E01ACA89AA00A6B233 /* Profile_filter_voiceIconClick@2x.png */; }; @@ -295,6 +299,54 @@ A9B8FECC1B32ACA900619C7D /* DXChatBarMoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B8FECB1B32ACA900619C7D /* DXChatBarMoreView.m */; }; A9B8FECF1B32B0F200619C7D /* MessageTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B8FECE1B32B0F200619C7D /* MessageTableView.m */; }; A9BE23BF1ACD8CA20032171A /* libSocialSina.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9BE23BD1ACD8CA20032171A /* libSocialSina.a */; }; + A9C58DDF1B3AA8EC0007FCDC /* chatFire_audioPlaying0.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DAF1B3AA8EC0007FCDC /* chatFire_audioPlaying0.png */; }; + A9C58DE01B3AA8EC0007FCDC /* chatFire_audioPlaying0@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB01B3AA8EC0007FCDC /* chatFire_audioPlaying0@2x.png */; }; + A9C58DE11B3AA8EC0007FCDC /* chatFire_audioPlaying1.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB11B3AA8EC0007FCDC /* chatFire_audioPlaying1.png */; }; + A9C58DE21B3AA8EC0007FCDC /* chatFire_audioPlaying1@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB21B3AA8EC0007FCDC /* chatFire_audioPlaying1@2x.png */; }; + A9C58DE31B3AA8EC0007FCDC /* chatFire_audioPlaying2.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB31B3AA8EC0007FCDC /* chatFire_audioPlaying2.png */; }; + A9C58DE41B3AA8EC0007FCDC /* chatFire_audioPlaying2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB41B3AA8EC0007FCDC /* chatFire_audioPlaying2@2x.png */; }; + A9C58DE51B3AA8EC0007FCDC /* chatFire_audioPlaying3.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB51B3AA8EC0007FCDC /* chatFire_audioPlaying3.png */; }; + A9C58DE61B3AA8EC0007FCDC /* chatFire_audioPlaying3@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB61B3AA8EC0007FCDC /* chatFire_audioPlaying3@2x.png */; }; + A9C58DE71B3AA8EC0007FCDC /* VoiceSearchFeedback001.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB71B3AA8EC0007FCDC /* VoiceSearchFeedback001.png */; }; + A9C58DE81B3AA8EC0007FCDC /* VoiceSearchFeedback001@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB81B3AA8EC0007FCDC /* VoiceSearchFeedback001@2x.png */; }; + A9C58DE91B3AA8EC0007FCDC /* VoiceSearchFeedback002.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DB91B3AA8EC0007FCDC /* VoiceSearchFeedback002.png */; }; + A9C58DEA1B3AA8EC0007FCDC /* VoiceSearchFeedback002@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DBA1B3AA8EC0007FCDC /* VoiceSearchFeedback002@2x.png */; }; + A9C58DEB1B3AA8EC0007FCDC /* VoiceSearchFeedback003.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DBB1B3AA8EC0007FCDC /* VoiceSearchFeedback003.png */; }; + A9C58DEC1B3AA8EC0007FCDC /* VoiceSearchFeedback003@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DBC1B3AA8EC0007FCDC /* VoiceSearchFeedback003@2x.png */; }; + A9C58DED1B3AA8EC0007FCDC /* VoiceSearchFeedback004.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DBD1B3AA8EC0007FCDC /* VoiceSearchFeedback004.png */; }; + A9C58DEE1B3AA8EC0007FCDC /* VoiceSearchFeedback004@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DBE1B3AA8EC0007FCDC /* VoiceSearchFeedback004@2x.png */; }; + A9C58DEF1B3AA8EC0007FCDC /* VoiceSearchFeedback005.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DBF1B3AA8EC0007FCDC /* VoiceSearchFeedback005.png */; }; + A9C58DF01B3AA8EC0007FCDC /* VoiceSearchFeedback005@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC01B3AA8EC0007FCDC /* VoiceSearchFeedback005@2x.png */; }; + A9C58DF11B3AA8EC0007FCDC /* VoiceSearchFeedback006.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC11B3AA8EC0007FCDC /* VoiceSearchFeedback006.png */; }; + A9C58DF21B3AA8EC0007FCDC /* VoiceSearchFeedback006@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC21B3AA8EC0007FCDC /* VoiceSearchFeedback006@2x.png */; }; + A9C58DF31B3AA8EC0007FCDC /* VoiceSearchFeedback007.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC31B3AA8EC0007FCDC /* VoiceSearchFeedback007.png */; }; + A9C58DF41B3AA8EC0007FCDC /* VoiceSearchFeedback007@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC41B3AA8EC0007FCDC /* VoiceSearchFeedback007@2x.png */; }; + A9C58DF51B3AA8EC0007FCDC /* VoiceSearchFeedback008.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC51B3AA8EC0007FCDC /* VoiceSearchFeedback008.png */; }; + A9C58DF61B3AA8EC0007FCDC /* VoiceSearchFeedback008@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC61B3AA8EC0007FCDC /* VoiceSearchFeedback008@2x.png */; }; + A9C58DF71B3AA8EC0007FCDC /* VoiceSearchFeedback009.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC71B3AA8EC0007FCDC /* VoiceSearchFeedback009.png */; }; + A9C58DF81B3AA8EC0007FCDC /* VoiceSearchFeedback009@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC81B3AA8EC0007FCDC /* VoiceSearchFeedback009@2x.png */; }; + A9C58DF91B3AA8EC0007FCDC /* VoiceSearchFeedback010.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DC91B3AA8EC0007FCDC /* VoiceSearchFeedback010.png */; }; + A9C58DFA1B3AA8EC0007FCDC /* VoiceSearchFeedback010@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DCA1B3AA8EC0007FCDC /* VoiceSearchFeedback010@2x.png */; }; + A9C58DFB1B3AA8EC0007FCDC /* VoiceSearchFeedback011.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DCB1B3AA8EC0007FCDC /* VoiceSearchFeedback011.png */; }; + A9C58DFC1B3AA8EC0007FCDC /* VoiceSearchFeedback011@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DCC1B3AA8EC0007FCDC /* VoiceSearchFeedback011@2x.png */; }; + A9C58DFD1B3AA8EC0007FCDC /* VoiceSearchFeedback012.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DCD1B3AA8EC0007FCDC /* VoiceSearchFeedback012.png */; }; + A9C58DFE1B3AA8EC0007FCDC /* VoiceSearchFeedback012@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DCE1B3AA8EC0007FCDC /* VoiceSearchFeedback012@2x.png */; }; + A9C58DFF1B3AA8EC0007FCDC /* VoiceSearchFeedback013.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DCF1B3AA8EC0007FCDC /* VoiceSearchFeedback013.png */; }; + A9C58E001B3AA8EC0007FCDC /* VoiceSearchFeedback013@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD01B3AA8EC0007FCDC /* VoiceSearchFeedback013@2x.png */; }; + A9C58E011B3AA8EC0007FCDC /* VoiceSearchFeedback014.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD11B3AA8EC0007FCDC /* VoiceSearchFeedback014.png */; }; + A9C58E021B3AA8EC0007FCDC /* VoiceSearchFeedback014@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD21B3AA8EC0007FCDC /* VoiceSearchFeedback014@2x.png */; }; + A9C58E031B3AA8EC0007FCDC /* VoiceSearchFeedback015.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD31B3AA8EC0007FCDC /* VoiceSearchFeedback015.png */; }; + A9C58E041B3AA8EC0007FCDC /* VoiceSearchFeedback015@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD41B3AA8EC0007FCDC /* VoiceSearchFeedback015@2x.png */; }; + A9C58E051B3AA8EC0007FCDC /* VoiceSearchFeedback016.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD51B3AA8EC0007FCDC /* VoiceSearchFeedback016.png */; }; + A9C58E061B3AA8EC0007FCDC /* VoiceSearchFeedback016@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD61B3AA8EC0007FCDC /* VoiceSearchFeedback016@2x.png */; }; + A9C58E071B3AA8EC0007FCDC /* VoiceSearchFeedback017.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD71B3AA8EC0007FCDC /* VoiceSearchFeedback017.png */; }; + A9C58E081B3AA8EC0007FCDC /* VoiceSearchFeedback017@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD81B3AA8EC0007FCDC /* VoiceSearchFeedback017@2x.png */; }; + A9C58E091B3AA8EC0007FCDC /* VoiceSearchFeedback018.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DD91B3AA8EC0007FCDC /* VoiceSearchFeedback018.png */; }; + A9C58E0A1B3AA8EC0007FCDC /* VoiceSearchFeedback018@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DDA1B3AA8EC0007FCDC /* VoiceSearchFeedback018@2x.png */; }; + A9C58E0B1B3AA8EC0007FCDC /* VoiceSearchFeedback019.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DDB1B3AA8EC0007FCDC /* VoiceSearchFeedback019.png */; }; + A9C58E0C1B3AA8EC0007FCDC /* VoiceSearchFeedback019@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DDC1B3AA8EC0007FCDC /* VoiceSearchFeedback019@2x.png */; }; + A9C58E0D1B3AA8EC0007FCDC /* VoiceSearchFeedback020.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DDD1B3AA8EC0007FCDC /* VoiceSearchFeedback020.png */; }; + A9C58E0E1B3AA8EC0007FCDC /* VoiceSearchFeedback020@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C58DDE1B3AA8EC0007FCDC /* VoiceSearchFeedback020@2x.png */; }; A9CF211C1B1C36D0007490EF /* mainCellCommentClickN@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9CF211A1B1C36D0007490EF /* mainCellCommentClickN@2x.png */; }; A9CF211D1B1C36D0007490EF /* mainCellCommentN@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A9CF211B1B1C36D0007490EF /* mainCellCommentN@2x.png */; }; A9CF21211B1C4C70007490EF /* NoteCommentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9CF211F1B1C4C70007490EF /* NoteCommentViewController.m */; }; @@ -372,6 +424,13 @@ A90BA01E1AD606AE00728393 /* voice-record-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "voice-record-icon@2x.png"; sourceTree = ""; }; A90BA0201AD606B400728393 /* voice-record-level@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "voice-record-level@2x.png"; sourceTree = ""; }; A90BA0221AD619B500728393 /* voice-record-level-bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "voice-record-level-bg@2x.png"; sourceTree = ""; }; + A91F84B81B3A7A6900DDFEA0 /* sr_refresh.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sr_refresh.png; sourceTree = ""; }; + A91F84B91B3A7A6900DDFEA0 /* sr_refresh@2X.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "sr_refresh@2X.png"; sourceTree = ""; }; + A91F84BA1B3A7A6900DDFEA0 /* SRDefine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRDefine.h; sourceTree = ""; }; + A91F84BB1B3A7A6900DDFEA0 /* SRRefreshView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRRefreshView.h; sourceTree = ""; }; + A91F84BC1B3A7A6900DDFEA0 /* SRRefreshView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRRefreshView.m; sourceTree = ""; }; + A91F84BD1B3A7A6900DDFEA0 /* SRSlimeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRSlimeView.h; sourceTree = ""; }; + A91F84BE1B3A7A6900DDFEA0 /* SRSlimeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRSlimeView.m; sourceTree = ""; }; A93441DC1ACA311700A6B233 /* Ash_UIUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ash_UIUtil.h; sourceTree = ""; }; A93441DD1ACA311700A6B233 /* Ash_UIUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Ash_UIUtil.m; sourceTree = ""; }; A93441DF1ACA89AA00A6B233 /* Profile_filter_voiceIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Profile_filter_voiceIcon@2x.png"; sourceTree = ""; }; @@ -858,6 +917,54 @@ A9B8FECE1B32B0F200619C7D /* MessageTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageTableView.m; sourceTree = ""; }; A9BE23BD1ACD8CA20032171A /* libSocialSina.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSocialSina.a; sourceTree = ""; }; A9BE23BE1ACD8CA20032171A /* UMSocialSinaHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UMSocialSinaHandler.h; sourceTree = ""; }; + A9C58DAF1B3AA8EC0007FCDC /* chatFire_audioPlaying0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chatFire_audioPlaying0.png; sourceTree = ""; }; + A9C58DB01B3AA8EC0007FCDC /* chatFire_audioPlaying0@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chatFire_audioPlaying0@2x.png"; sourceTree = ""; }; + A9C58DB11B3AA8EC0007FCDC /* chatFire_audioPlaying1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chatFire_audioPlaying1.png; sourceTree = ""; }; + A9C58DB21B3AA8EC0007FCDC /* chatFire_audioPlaying1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chatFire_audioPlaying1@2x.png"; sourceTree = ""; }; + A9C58DB31B3AA8EC0007FCDC /* chatFire_audioPlaying2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chatFire_audioPlaying2.png; sourceTree = ""; }; + A9C58DB41B3AA8EC0007FCDC /* chatFire_audioPlaying2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chatFire_audioPlaying2@2x.png"; sourceTree = ""; }; + A9C58DB51B3AA8EC0007FCDC /* chatFire_audioPlaying3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chatFire_audioPlaying3.png; sourceTree = ""; }; + A9C58DB61B3AA8EC0007FCDC /* chatFire_audioPlaying3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chatFire_audioPlaying3@2x.png"; sourceTree = ""; }; + A9C58DB71B3AA8EC0007FCDC /* VoiceSearchFeedback001.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback001.png; sourceTree = ""; }; + A9C58DB81B3AA8EC0007FCDC /* VoiceSearchFeedback001@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback001@2x.png"; sourceTree = ""; }; + A9C58DB91B3AA8EC0007FCDC /* VoiceSearchFeedback002.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback002.png; sourceTree = ""; }; + A9C58DBA1B3AA8EC0007FCDC /* VoiceSearchFeedback002@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback002@2x.png"; sourceTree = ""; }; + A9C58DBB1B3AA8EC0007FCDC /* VoiceSearchFeedback003.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback003.png; sourceTree = ""; }; + A9C58DBC1B3AA8EC0007FCDC /* VoiceSearchFeedback003@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback003@2x.png"; sourceTree = ""; }; + A9C58DBD1B3AA8EC0007FCDC /* VoiceSearchFeedback004.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback004.png; sourceTree = ""; }; + A9C58DBE1B3AA8EC0007FCDC /* VoiceSearchFeedback004@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback004@2x.png"; sourceTree = ""; }; + A9C58DBF1B3AA8EC0007FCDC /* VoiceSearchFeedback005.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback005.png; sourceTree = ""; }; + A9C58DC01B3AA8EC0007FCDC /* VoiceSearchFeedback005@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback005@2x.png"; sourceTree = ""; }; + A9C58DC11B3AA8EC0007FCDC /* VoiceSearchFeedback006.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback006.png; sourceTree = ""; }; + A9C58DC21B3AA8EC0007FCDC /* VoiceSearchFeedback006@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback006@2x.png"; sourceTree = ""; }; + A9C58DC31B3AA8EC0007FCDC /* VoiceSearchFeedback007.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback007.png; sourceTree = ""; }; + A9C58DC41B3AA8EC0007FCDC /* VoiceSearchFeedback007@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback007@2x.png"; sourceTree = ""; }; + A9C58DC51B3AA8EC0007FCDC /* VoiceSearchFeedback008.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback008.png; sourceTree = ""; }; + A9C58DC61B3AA8EC0007FCDC /* VoiceSearchFeedback008@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback008@2x.png"; sourceTree = ""; }; + A9C58DC71B3AA8EC0007FCDC /* VoiceSearchFeedback009.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback009.png; sourceTree = ""; }; + A9C58DC81B3AA8EC0007FCDC /* VoiceSearchFeedback009@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback009@2x.png"; sourceTree = ""; }; + A9C58DC91B3AA8EC0007FCDC /* VoiceSearchFeedback010.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback010.png; sourceTree = ""; }; + A9C58DCA1B3AA8EC0007FCDC /* VoiceSearchFeedback010@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback010@2x.png"; sourceTree = ""; }; + A9C58DCB1B3AA8EC0007FCDC /* VoiceSearchFeedback011.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback011.png; sourceTree = ""; }; + A9C58DCC1B3AA8EC0007FCDC /* VoiceSearchFeedback011@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback011@2x.png"; sourceTree = ""; }; + A9C58DCD1B3AA8EC0007FCDC /* VoiceSearchFeedback012.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback012.png; sourceTree = ""; }; + A9C58DCE1B3AA8EC0007FCDC /* VoiceSearchFeedback012@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback012@2x.png"; sourceTree = ""; }; + A9C58DCF1B3AA8EC0007FCDC /* VoiceSearchFeedback013.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback013.png; sourceTree = ""; }; + A9C58DD01B3AA8EC0007FCDC /* VoiceSearchFeedback013@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback013@2x.png"; sourceTree = ""; }; + A9C58DD11B3AA8EC0007FCDC /* VoiceSearchFeedback014.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback014.png; sourceTree = ""; }; + A9C58DD21B3AA8EC0007FCDC /* VoiceSearchFeedback014@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback014@2x.png"; sourceTree = ""; }; + A9C58DD31B3AA8EC0007FCDC /* VoiceSearchFeedback015.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback015.png; sourceTree = ""; }; + A9C58DD41B3AA8EC0007FCDC /* VoiceSearchFeedback015@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback015@2x.png"; sourceTree = ""; }; + A9C58DD51B3AA8EC0007FCDC /* VoiceSearchFeedback016.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback016.png; sourceTree = ""; }; + A9C58DD61B3AA8EC0007FCDC /* VoiceSearchFeedback016@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback016@2x.png"; sourceTree = ""; }; + A9C58DD71B3AA8EC0007FCDC /* VoiceSearchFeedback017.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback017.png; sourceTree = ""; }; + A9C58DD81B3AA8EC0007FCDC /* VoiceSearchFeedback017@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback017@2x.png"; sourceTree = ""; }; + A9C58DD91B3AA8EC0007FCDC /* VoiceSearchFeedback018.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback018.png; sourceTree = ""; }; + A9C58DDA1B3AA8EC0007FCDC /* VoiceSearchFeedback018@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback018@2x.png"; sourceTree = ""; }; + A9C58DDB1B3AA8EC0007FCDC /* VoiceSearchFeedback019.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback019.png; sourceTree = ""; }; + A9C58DDC1B3AA8EC0007FCDC /* VoiceSearchFeedback019@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback019@2x.png"; sourceTree = ""; }; + A9C58DDD1B3AA8EC0007FCDC /* VoiceSearchFeedback020.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VoiceSearchFeedback020.png; sourceTree = ""; }; + A9C58DDE1B3AA8EC0007FCDC /* VoiceSearchFeedback020@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "VoiceSearchFeedback020@2x.png"; sourceTree = ""; }; A9CF211A1B1C36D0007490EF /* mainCellCommentClickN@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mainCellCommentClickN@2x.png"; sourceTree = ""; }; A9CF211B1B1C36D0007490EF /* mainCellCommentN@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mainCellCommentN@2x.png"; sourceTree = ""; }; A9CF211E1B1C4C70007490EF /* NoteCommentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoteCommentViewController.h; sourceTree = ""; }; @@ -979,6 +1086,20 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + A91F84B71B3A7A6900DDFEA0 /* SlimeRefresh */ = { + isa = PBXGroup; + children = ( + A91F84B81B3A7A6900DDFEA0 /* sr_refresh.png */, + A91F84B91B3A7A6900DDFEA0 /* sr_refresh@2X.png */, + A91F84BA1B3A7A6900DDFEA0 /* SRDefine.h */, + A91F84BB1B3A7A6900DDFEA0 /* SRRefreshView.h */, + A91F84BC1B3A7A6900DDFEA0 /* SRRefreshView.m */, + A91F84BD1B3A7A6900DDFEA0 /* SRSlimeView.h */, + A91F84BE1B3A7A6900DDFEA0 /* SRSlimeView.m */, + ); + path = SlimeRefresh; + sourceTree = ""; + }; A94D0EDA1AD5753A0002DEB1 /* My */ = { isa = PBXGroup; children = ( @@ -1778,6 +1899,7 @@ A97C54E21AC91FD70038818A /* Resource */ = { isa = PBXGroup; children = ( + A9C58DAE1B3AA8EC0007FCDC /* audio */, A9F7F4581B33B51F00317F3E /* back@2x.png */, A971EDF61B32B7C40023740E /* chatBar_colorMore_audioCall@2x.png */, A971EDF71B32B7C40023740E /* chatBar_colorMore_audioCallSelected@2x.png */, @@ -2086,6 +2208,7 @@ A9B8FEC11B32A35800619C7D /* Chat */ = { isa = PBXGroup; children = ( + A91F84B71B3A7A6900DDFEA0 /* SlimeRefresh */, A9F7F45A1B33BC4E00317F3E /* Call */, A971EDCD1B32B6CF0023740E /* Emoji */, A971EDB81B32B6A40023740E /* VoiceConvert */, @@ -2140,6 +2263,61 @@ path = Sina; sourceTree = ""; }; + A9C58DAE1B3AA8EC0007FCDC /* audio */ = { + isa = PBXGroup; + children = ( + A9C58DAF1B3AA8EC0007FCDC /* chatFire_audioPlaying0.png */, + A9C58DB01B3AA8EC0007FCDC /* chatFire_audioPlaying0@2x.png */, + A9C58DB11B3AA8EC0007FCDC /* chatFire_audioPlaying1.png */, + A9C58DB21B3AA8EC0007FCDC /* chatFire_audioPlaying1@2x.png */, + A9C58DB31B3AA8EC0007FCDC /* chatFire_audioPlaying2.png */, + A9C58DB41B3AA8EC0007FCDC /* chatFire_audioPlaying2@2x.png */, + A9C58DB51B3AA8EC0007FCDC /* chatFire_audioPlaying3.png */, + A9C58DB61B3AA8EC0007FCDC /* chatFire_audioPlaying3@2x.png */, + A9C58DB71B3AA8EC0007FCDC /* VoiceSearchFeedback001.png */, + A9C58DB81B3AA8EC0007FCDC /* VoiceSearchFeedback001@2x.png */, + A9C58DB91B3AA8EC0007FCDC /* VoiceSearchFeedback002.png */, + A9C58DBA1B3AA8EC0007FCDC /* VoiceSearchFeedback002@2x.png */, + A9C58DBB1B3AA8EC0007FCDC /* VoiceSearchFeedback003.png */, + A9C58DBC1B3AA8EC0007FCDC /* VoiceSearchFeedback003@2x.png */, + A9C58DBD1B3AA8EC0007FCDC /* VoiceSearchFeedback004.png */, + A9C58DBE1B3AA8EC0007FCDC /* VoiceSearchFeedback004@2x.png */, + A9C58DBF1B3AA8EC0007FCDC /* VoiceSearchFeedback005.png */, + A9C58DC01B3AA8EC0007FCDC /* VoiceSearchFeedback005@2x.png */, + A9C58DC11B3AA8EC0007FCDC /* VoiceSearchFeedback006.png */, + A9C58DC21B3AA8EC0007FCDC /* VoiceSearchFeedback006@2x.png */, + A9C58DC31B3AA8EC0007FCDC /* VoiceSearchFeedback007.png */, + A9C58DC41B3AA8EC0007FCDC /* VoiceSearchFeedback007@2x.png */, + A9C58DC51B3AA8EC0007FCDC /* VoiceSearchFeedback008.png */, + A9C58DC61B3AA8EC0007FCDC /* VoiceSearchFeedback008@2x.png */, + A9C58DC71B3AA8EC0007FCDC /* VoiceSearchFeedback009.png */, + A9C58DC81B3AA8EC0007FCDC /* VoiceSearchFeedback009@2x.png */, + A9C58DC91B3AA8EC0007FCDC /* VoiceSearchFeedback010.png */, + A9C58DCA1B3AA8EC0007FCDC /* VoiceSearchFeedback010@2x.png */, + A9C58DCB1B3AA8EC0007FCDC /* VoiceSearchFeedback011.png */, + A9C58DCC1B3AA8EC0007FCDC /* VoiceSearchFeedback011@2x.png */, + A9C58DCD1B3AA8EC0007FCDC /* VoiceSearchFeedback012.png */, + A9C58DCE1B3AA8EC0007FCDC /* VoiceSearchFeedback012@2x.png */, + A9C58DCF1B3AA8EC0007FCDC /* VoiceSearchFeedback013.png */, + A9C58DD01B3AA8EC0007FCDC /* VoiceSearchFeedback013@2x.png */, + A9C58DD11B3AA8EC0007FCDC /* VoiceSearchFeedback014.png */, + A9C58DD21B3AA8EC0007FCDC /* VoiceSearchFeedback014@2x.png */, + A9C58DD31B3AA8EC0007FCDC /* VoiceSearchFeedback015.png */, + A9C58DD41B3AA8EC0007FCDC /* VoiceSearchFeedback015@2x.png */, + A9C58DD51B3AA8EC0007FCDC /* VoiceSearchFeedback016.png */, + A9C58DD61B3AA8EC0007FCDC /* VoiceSearchFeedback016@2x.png */, + A9C58DD71B3AA8EC0007FCDC /* VoiceSearchFeedback017.png */, + A9C58DD81B3AA8EC0007FCDC /* VoiceSearchFeedback017@2x.png */, + A9C58DD91B3AA8EC0007FCDC /* VoiceSearchFeedback018.png */, + A9C58DDA1B3AA8EC0007FCDC /* VoiceSearchFeedback018@2x.png */, + A9C58DDB1B3AA8EC0007FCDC /* VoiceSearchFeedback019.png */, + A9C58DDC1B3AA8EC0007FCDC /* VoiceSearchFeedback019@2x.png */, + A9C58DDD1B3AA8EC0007FCDC /* VoiceSearchFeedback020.png */, + A9C58DDE1B3AA8EC0007FCDC /* VoiceSearchFeedback020@2x.png */, + ); + path = audio; + sourceTree = ""; + }; A9CF21231B1C4EA2007490EF /* Common */ = { isa = PBXGroup; children = ( @@ -2321,16 +2499,24 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A9C58DF71B3AA8EC0007FCDC /* VoiceSearchFeedback009.png in Resources */, A9F7F4671B33BF6700317F3E /* call_out_h@2x.png in Resources */, + A9C58DE11B3AA8EC0007FCDC /* chatFire_audioPlaying1.png in Resources */, + A91F84C01B3A7A6900DDFEA0 /* sr_refresh@2X.png in Resources */, A968624B1ACCF0B400DDAA6B /* MWPhotoBrowser.bundle in Resources */, + A9C58DEF1B3AA8EC0007FCDC /* VoiceSearchFeedback005.png in Resources */, A93442001ACA919F00A6B233 /* tabbarVoiceClick@2x.png in Resources */, A90BA0191AD6067F00728393 /* voice-continue-record-bgN@2x.png in Resources */, + A9C58DF81B3AA8EC0007FCDC /* VoiceSearchFeedback009@2x.png in Resources */, A978CB291B3A3D5A00028C4A /* chat_sender_audio_playing_000@2x.png in Resources */, A97C55001AC933AD0038818A /* UMSCommentDetailController.xib in Resources */, A93441F21ACA916D00A6B233 /* tabbarQuotationClick@2x.png in Resources */, A90BA0011AD6031E00728393 /* MessagePublishViewController.xib in Resources */, A93442031ACA981D00A6B233 /* Default-568h@2x.png in Resources */, + A9C58E011B3AA8EC0007FCDC /* VoiceSearchFeedback014.png in Resources */, A9FAD4321AC923FC007ADC10 /* MyViewController.xib in Resources */, + A9C58DF21B3AA8EC0007FCDC /* VoiceSearchFeedback006@2x.png in Resources */, + A9C58DFF1B3AA8EC0007FCDC /* VoiceSearchFeedback013.png in Resources */, A978CB2E1B3A3D5A00028C4A /* chat_sender_bg@2x.png in Resources */, A9F7F45E1B33BC4E00317F3E /* callRing.mp3 in Resources */, A978CB441B3A3D8800028C4A /* chatListCellHead@2x.png in Resources */, @@ -2340,6 +2526,7 @@ A968627E1ACCF46E00DDAA6B /* cellmorebtnclickN@2x.png in Resources */, A9EA14C31B02E88300357529 /* LaunchScreen.xib in Resources */, A9CF211D1B1C36D0007490EF /* mainCellCommentN@2x.png in Resources */, + A9C58DE91B3AA8EC0007FCDC /* VoiceSearchFeedback002.png in Resources */, A978CB351B3A3D6700028C4A /* chat_receiver_audio_playing_full@2x.png in Resources */, A93441FA1ACA919500A6B233 /* tabbarQuotation-dark@2x.png in Resources */, A9B6DFE21B202E7D0003C1BC /* comment_support_plus@2x.png in Resources */, @@ -2348,15 +2535,20 @@ A97559D01ACBF0BC004ADA42 /* btn_share_clicked@2x.png in Resources */, A90BA01F1AD606AE00728393 /* voice-record-icon@2x.png in Resources */, A9E2711B1ADB97ED000B1542 /* Default-568h.png in Resources */, + A9C58E0D1B3AA8EC0007FCDC /* VoiceSearchFeedback020.png in Resources */, A955109B1AC39E6A0006D16F /* Main.storyboard in Resources */, A966FB961AD62C5D00542068 /* icon_error@2x.png in Resources */, + A9C58DF41B3AA8EC0007FCDC /* VoiceSearchFeedback007@2x.png in Resources */, A971EE021B32B7C40023740E /* chatBar_colorMore_audioCall@2x.png in Resources */, + A9C58DE51B3AA8EC0007FCDC /* chatFire_audioPlaying3.png in Resources */, A97559A51ACB9748004ADA42 /* setup-head-default@2x.png in Resources */, A97DBE3F1ACAE29E00705682 /* Icon.png in Resources */, A98536871AEBDA1E000312BF /* OurLoginViewController.xib in Resources */, + A9C58DF51B3AA8EC0007FCDC /* VoiceSearchFeedback008.png in Resources */, A9A3A75A1B281392001AAB3A /* image.png in Resources */, A971EE061B32B7C40023740E /* chatBar_colorMore_location@2x.png in Resources */, A971EE081B32B7C40023740E /* chatBar_colorMore_photo@2x.png in Resources */, + A9C58DF91B3AA8EC0007FCDC /* VoiceSearchFeedback010.png in Resources */, A9754A271ADC199B0018BAAD /* MyMessageViewController.xib in Resources */, A94DF6361AD4D94E00DCDCB0 /* MyNoteViewController.xib in Resources */, A978CB391B3A3D6700028C4A /* chat_receiver_audio_playing003@2x.png in Resources */, @@ -2364,10 +2556,12 @@ A978CB381B3A3D6700028C4A /* chat_receiver_audio_playing002@2x.png in Resources */, A9F7F46D1B33BF6700317F3E /* messageSendFail@2x.png in Resources */, A93441ED1ACA8C8F00A6B233 /* defaultUserIcon.png in Resources */, + A9C58DE81B3AA8EC0007FCDC /* VoiceSearchFeedback001@2x.png in Resources */, A97559CF1ACBF0BC004ADA42 /* btn_good@2x.png in Resources */, A97559CC1ACBF0BC004ADA42 /* btn_bad_clicked@2x.png in Resources */, A9F7F46A1B33BF6700317F3E /* call_silence@2x.png in Resources */, A97DBE461ACAE7B500705682 /* iconWeixin@2x.png in Resources */, + A9C58E091B3AA8EC0007FCDC /* VoiceSearchFeedback018.png in Resources */, A971EE041B32B7C40023740E /* chatBar_colorMore_camera@2x.png in Resources */, A94691CD1B26EACE00B5D26B /* PersonalInfoViewController.xib in Resources */, A96862421ACCF0B400DDAA6B /* LICENCE.txt in Resources */, @@ -2379,6 +2573,7 @@ A971EE0A1B32B7C40023740E /* chatBar_colorMore_video@2x.png in Resources */, A99AA12F1ADD028400574B12 /* Icon120.png in Resources */, A98536821AEBC7BB000312BF /* SetUserInfoViewController.xib in Resources */, + A9C58DED1B3AA8EC0007FCDC /* VoiceSearchFeedback004.png in Resources */, A97C55071AC933AD0038818A /* UMSShareListController.xib in Resources */, A9B6DFD91B201E5B0003C1BC /* share_send_highlighted@2x.png in Resources */, A93441EE1ACA8C8F00A6B233 /* defaultUserIcon@2x.png in Resources */, @@ -2386,16 +2581,23 @@ A90BA0181AD6067F00728393 /* voice-continue-record-bg@2x.png in Resources */, A90BA0081AD6060600728393 /* playButton@2x.png in Resources */, A9B6DFD61B201E4E0003C1BC /* share_close@2x.png in Resources */, + A9C58DE41B3AA8EC0007FCDC /* chatFire_audioPlaying2@2x.png in Resources */, A97C54FE1AC933AD0038818A /* UMSocialLocalizable.strings in Resources */, A978CB3F1B3A3D7100028C4A /* chat_location_annotation_someone@2x.png in Resources */, A9B6DFD51B201E4E0003C1BC /* share_cancel_highlighted@2x.png in Resources */, + A9C58DE61B3AA8EC0007FCDC /* chatFire_audioPlaying3@2x.png in Resources */, + A9C58DE21B3AA8EC0007FCDC /* chatFire_audioPlaying1@2x.png in Resources */, A93441E91ACA8AD200A6B233 /* Profile_filter_ImageIcon@2x.png in Resources */, A97C55041AC933AD0038818A /* UMShareEditViewControlleriPad.xib in Resources */, A971EDDC1B32B7960023740E /* chatBar_face@2x.png in Resources */, + A9C58DFC1B3AA8EC0007FCDC /* VoiceSearchFeedback011@2x.png in Resources */, A978838A1AD36A0500D46477 /* mainCellDing@2x.png in Resources */, + A9C58E0E1B3AA8EC0007FCDC /* VoiceSearchFeedback020@2x.png in Resources */, A98F98541ACA29B5007C4594 /* TencentOpenApi_IOS_Bundle.bundle in Resources */, + A9C58DDF1B3AA8EC0007FCDC /* chatFire_audioPlaying0.png in Resources */, A9CF211C1B1C36D0007490EF /* mainCellCommentClickN@2x.png in Resources */, A9617A591ACC2EBC0024AE4A /* mine-setting-icon@2x.png in Resources */, + A9C58E0A1B3AA8EC0007FCDC /* VoiceSearchFeedback018@2x.png in Resources */, A9744F4F1B3155160082301D /* EaseMob.bundle in Resources */, A968627C1ACCF3D200DDAA6B /* cellmorebtnnormalN@2x.png in Resources */, A96F27FA1B21C5C800DA0A66 /* PraiseUserListViewController.xib in Resources */, @@ -2410,6 +2612,7 @@ A9A3A7541B281178001AAB3A /* PersonalTopBg@2x.jpg in Resources */, A9B6DFE41B202E950003C1BC /* night_user_comment_circle@2x.png in Resources */, A9B4A9551AEDC3620017C655 /* FeedbackViewController.xib in Resources */, + A9C58DE01B3AA8EC0007FCDC /* chatFire_audioPlaying0@2x.png in Resources */, A9F7F4591B33B51F00317F3E /* back@2x.png in Resources */, A971EDDE1B32B7960023740E /* chatBar_keyboard@2x.png in Resources */, A971EE071B32B7C40023740E /* chatBar_colorMore_locationSelected@2x.png in Resources */, @@ -2418,6 +2621,7 @@ A955109D1AC39E6A0006D16F /* Images.xcassets in Resources */, A97DBE4C1ACAEBE300705682 /* first-login-sina@2x.png in Resources */, A9FAD4281AC922BE007ADC10 /* NoteViewController.xib in Resources */, + A9C58DF11B3AA8EC0007FCDC /* VoiceSearchFeedback006.png in Resources */, A93441E61ACA8AC400A6B233 /* Profile_filter_contentIconClick@2x.png in Resources */, A971EDF51B32B7AF0023740E /* chatBar_more_photoSelected@2x.png in Resources */, A97559C51ACBEE99004ADA42 /* NoteTableViewCell.xib in Resources */, @@ -2425,6 +2629,8 @@ A971EDDD1B32B7960023740E /* chatBar_faceSelected@2x.png in Resources */, A9CF212A1B1C65A2007490EF /* praise-wall-white@2x.png in Resources */, A9617A551ACC27860024AE4A /* SetUpViewController.xib in Resources */, + A9C58DFD1B3AA8EC0007FCDC /* VoiceSearchFeedback012.png in Resources */, + A9C58E081B3AA8EC0007FCDC /* VoiceSearchFeedback017@2x.png in Resources */, A97559D11ACBF0BC004ADA42 /* btn_share@2x.png in Resources */, A98D659E1AD37F18008668EE /* MessageTableViewCell.xib in Resources */, A971EDE01B32B7960023740E /* chatBar_more@2x.png in Resources */, @@ -2437,10 +2643,14 @@ A971EDE91B32B7A00023740E /* chatBar_recordSelectedBg@2x.png in Resources */, A96F27F51B21C5AC00DA0A66 /* PraiseUserListTableViewCell.xib in Resources */, A97559A91ACB9DE4004ADA42 /* navigationButtonPublishClick@2x.png in Resources */, + A9C58DEC1B3AA8EC0007FCDC /* VoiceSearchFeedback003@2x.png in Resources */, A93441E21ACA89AA00A6B233 /* Profile_filter_voiceIconClick@2x.png in Resources */, + A9C58E071B3AA8EC0007FCDC /* VoiceSearchFeedback017.png in Resources */, A971EDE11B32B7960023740E /* chatBar_moreSelected@2x.png in Resources */, A97559A81ACB9DE4004ADA42 /* navigationButtonPublish@2x.png in Resources */, A971EDD51B32B7790023740E /* messageToolbarBg@2x.png in Resources */, + A9C58DEB1B3AA8EC0007FCDC /* VoiceSearchFeedback003.png in Resources */, + A9C58E051B3AA8EC0007FCDC /* VoiceSearchFeedback016.png in Resources */, A98536781AEB7400000312BF /* RegistAccountViewController.xib in Resources */, A971EDF01B32B7AF0023740E /* chatBar_more_camera@2x.png in Resources */, A97559CE1ACBF0BC004ADA42 /* btn_good_clicked@2x.png in Resources */, @@ -2453,25 +2663,34 @@ A97C55061AC933AD0038818A /* UMSnsAccountViewController.xib in Resources */, A966FB9A1AD62CAE00542068 /* errormark@2x.png in Resources */, A9CF21221B1C4C70007490EF /* NoteCommentViewController.xib in Resources */, + A9C58E041B3AA8EC0007FCDC /* VoiceSearchFeedback015@2x.png in Resources */, + A91F84BF1B3A7A6900DDFEA0 /* sr_refresh.png in Resources */, A9B8FEC61B32A4CF00619C7D /* ChatMainViewController.xib in Resources */, A97559CD1ACBF0BC004ADA42 /* btn_bad@2x.png in Resources */, A93441F71ACA918100A6B233 /* tabbarSetup@2x.png in Resources */, A9B6DFDE1B2028B80003C1BC /* share_cancel@2x.png in Resources */, A90BA0091AD6060600728393 /* playButtonClick@2x.png in Resources */, A9A3A7501B2805EA001AAB3A /* PersonalTopView.xib in Resources */, + A9C58DEA1B3AA8EC0007FCDC /* VoiceSearchFeedback002@2x.png in Resources */, A971EDF21B32B7AF0023740E /* chatBar_more_location@2x.png in Resources */, A9FD82BD1B1D544300AC4DC9 /* CommentTableViewCell.xib in Resources */, A971EE091B32B7C40023740E /* chatBar_colorMore_photoSelected@2x.png in Resources */, + A9C58DE31B3AA8EC0007FCDC /* chatFire_audioPlaying2.png in Resources */, A98536731AEB66F9000312BF /* ReportViewController.xib in Resources */, + A9C58DF61B3AA8EC0007FCDC /* VoiceSearchFeedback008@2x.png in Resources */, A97C55011AC933AD0038818A /* UMSCommentInputController.xib in Resources */, A971EE0D1B32B7C40023740E /* chatBar_colorMore_videoSelected@2x.png in Resources */, A97559AD1ACB9DF0004ADA42 /* navigationButtonRefreshClick@2x.png in Resources */, A90BA00B1AD6060600728393 /* playButtonPlay@2x.png in Resources */, + A9C58E0B1B3AA8EC0007FCDC /* VoiceSearchFeedback019.png in Resources */, A971EE0B1B32B7C40023740E /* chatBar_colorMore_videoCall@2x.png in Resources */, + A9C58E021B3AA8EC0007FCDC /* VoiceSearchFeedback014@2x.png in Resources */, A978CB371B3A3D6700028C4A /* chat_receiver_audio_playing001@2x.png in Resources */, A978CB411B3A3D7100028C4A /* chat_location_detail_disclosureHL@2x.png in Resources */, + A9C58DF01B3AA8EC0007FCDC /* VoiceSearchFeedback005@2x.png in Resources */, A978CB421B3A3D7100028C4A /* chat_location_preview@2x.png in Resources */, A9F7F4681B33BF6700317F3E /* call_out@2x.png in Resources */, + A9C58E031B3AA8EC0007FCDC /* VoiceSearchFeedback015.png in Resources */, A9F7F46B1B33BF6700317F3E /* callBg@2x.png in Resources */, A978CB2C1B3A3D5A00028C4A /* chat_sender_audio_playing_003@2x.png in Resources */, A90BA0131AD6066000728393 /* voice-bottom-close@2x.png in Resources */, @@ -2481,13 +2700,17 @@ A9B6DFDA1B201E5B0003C1BC /* share_send@2x.png in Resources */, A9B6DFD21B20054B0003C1BC /* CommentTextView.xib in Resources */, A9617A581ACC2EBC0024AE4A /* mine-setting-icon-click@2x.png in Resources */, + A9C58E061B3AA8EC0007FCDC /* VoiceSearchFeedback016@2x.png in Resources */, + A9C58DFB1B3AA8EC0007FCDC /* VoiceSearchFeedback011.png in Resources */, A985368C1AEBDDAB000312BF /* ModifyPassWordViewController.xib in Resources */, + A9C58DFE1B3AA8EC0007FCDC /* VoiceSearchFeedback012@2x.png in Resources */, A971EDDF1B32B7960023740E /* chatBar_keyboardSelected@2x.png in Resources */, A90BA0071AD6060600728393 /* play@2x.png in Resources */, A93441E51ACA8AC400A6B233 /* Profile_filter_contentIcon@2x.png in Resources */, A971EDF11B32B7AF0023740E /* chatBar_more_cameraSelected@2x.png in Resources */, A97559B31ACBC683004ADA42 /* NotePublishViewController.xib in Resources */, A966FB991AD62CAE00542068 /* checkmark@2x.png in Resources */, + A9C58E0C1B3AA8EC0007FCDC /* VoiceSearchFeedback019@2x.png in Resources */, A978CB401B3A3D7100028C4A /* chat_location_detail_disclosure@2x.png in Resources */, A9B6DFEC1B2068790003C1BC /* Localizable.strings in Resources */, A9FAD4231AC922A5007ADC10 /* MainViewController.xib in Resources */, @@ -2499,10 +2722,14 @@ A971EE051B32B7C40023740E /* chatBar_colorMore_cameraSelected@2x.png in Resources */, A9744EDE1B311DBA0082301D /* MessageCommentViewController.xib in Resources */, A97DBE421ACAE4E300705682 /* first-login-icon.png in Resources */, + A9C58DF31B3AA8EC0007FCDC /* VoiceSearchFeedback007.png in Resources */, A97C55051AC933AD0038818A /* UMSLoginViewController.xib in Resources */, A97C55081AC933AD0038818A /* UMSocialSDKResourcesNew.bundle in Resources */, A9FD82B71B1D433800AC4DC9 /* accessory@2x.png in Resources */, + A9C58E001B3AA8EC0007FCDC /* VoiceSearchFeedback013@2x.png in Resources */, + A9C58DFA1B3AA8EC0007FCDC /* VoiceSearchFeedback010@2x.png in Resources */, A90BA01B1AD6069A00728393 /* voice-play-start@2x.png in Resources */, + A9C58DE71B3AA8EC0007FCDC /* VoiceSearchFeedback001.png in Resources */, A978CB361B3A3D6700028C4A /* chat_receiver_audio_playing000@2x.png in Resources */, A97DBE341ACAE10800705682 /* LoginViewController.xib in Resources */, A93441EA1ACA8AD200A6B233 /* Profile_filter_ImageIconClick@2x.png in Resources */, @@ -2511,6 +2738,7 @@ A93441F11ACA916D00A6B233 /* tabbarQuotation@2x.png in Resources */, A90BA00D1AD6062300728393 /* repeatVideoStarticon@2x.png in Resources */, A9F7F4691B33BF6700317F3E /* call_silence_h@2x.png in Resources */, + A9C58DEE1B3AA8EC0007FCDC /* VoiceSearchFeedback004@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2580,6 +2808,7 @@ A97C54DD1AC901980038818A /* MBProgressHUD+Util.m in Sources */, A96D2F261B2FFDA300DC0284 /* DejalActivityView.m in Sources */, A9F917DA1B390A220007A3AC /* NSDateFormatter+Category.m in Sources */, + A91F84C11B3A7A6900DDFEA0 /* SRRefreshView.m in Sources */, A96862721ACCF13300DDAA6B /* PSTCollectionViewData.m in Sources */, A97DBE331ACAE10800705682 /* LoginViewController.m in Sources */, A9F917DE1B390AE70007A3AC /* THProgressView.m in Sources */, @@ -2651,6 +2880,7 @@ A9F917D41B3906150007A3AC /* MessageReadManager.m in Sources */, A9F917E11B390AFE0007A3AC /* UIResponder+Router.m in Sources */, A98536771AEB7400000312BF /* RegistAccountViewController.m in Sources */, + A91F84C21B3A7A6900DDFEA0 /* SRSlimeView.m in Sources */, A97559B71ACBD99E004ADA42 /* UIPlaceHolderTextView.m in Sources */, A9F917C81B39055A0007A3AC /* EMChatVideoBubbleView.m in Sources */, A97C54E11AC91DA10038818A /* CommonUtil.m in Sources */, diff --git a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 7744512..56b2360 100644 --- a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -10,11 +10,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/AppDelegate.m" - timestampString = "456376944.815543" + timestampString = "456899920.303763" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "106" - endingLineNumber = "106" + startingLineNumber = "167" + endingLineNumber = "167" landmarkName = "+visibleViewController" landmarkType = "5"> @@ -26,11 +26,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/AppDelegate.m" - timestampString = "456376944.815543" + timestampString = "456899920.303763" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "68" - endingLineNumber = "68" + startingLineNumber = "94" + endingLineNumber = "94" landmarkName = "-applicationDidBecomeActive:" landmarkType = "5"> @@ -42,11 +42,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/AppDelegate.m" - timestampString = "456376944.815543" + timestampString = "456899920.303763" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "77" - endingLineNumber = "77" + startingLineNumber = "138" + endingLineNumber = "138" landmarkName = "-application:handleOpenURL:" landmarkType = "5"> @@ -490,11 +490,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Login/LoginViewController.m" - timestampString = "456302036.416834" + timestampString = "456896495.730218" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "180" - endingLineNumber = "180" + startingLineNumber = "181" + endingLineNumber = "181" landmarkName = "-loginWithOpenId:withName:withGender:withFigureUrl:" landmarkType = "5"> @@ -1557,7 +1557,7 @@ @@ -2725,15 +2725,15 @@ @@ -2761,11 +2761,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/Call/CallViewController.m" - timestampString = "456376603.395259" + timestampString = "456846952.261692" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "593" - endingLineNumber = "593" + startingLineNumber = "596" + endingLineNumber = "596" landmarkName = "-hangupAction" landmarkType = "5"> @@ -2777,11 +2777,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456376787.384789" + timestampString = "456896495.730218" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "16" - endingLineNumber = "16" + startingLineNumber = "18" + endingLineNumber = "18" landmarkName = "+EaseMobLoginWithUserName:" landmarkType = "5"> @@ -2793,12 +2793,12 @@ moduleName = "Ash_AWord" usesParentBreakpointCondition = "Yes" urlString = "file:///Users/xmfish/Documents/Ash_Soft/Ash_AWord/Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456724000.129609" + timestampString = "456899059.781331" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "16" - endingLineNumber = "16" - offsetFromSymbolStart = "64"> + startingLineNumber = "18" + endingLineNumber = "18" + offsetFromSymbolStart = "60"> @@ -2825,63 +2825,15 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/Utility/Tool/Ash_UIUtil.m" - timestampString = "456376795.536427" + timestampString = "456896495.730218" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "17" - endingLineNumber = "17" + startingLineNumber = "19" + endingLineNumber = "19" landmarkName = "+EaseMobLoginWithUserName:" landmarkType = "5"> - - - - - - - - - - - - @@ -2905,12 +2857,12 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456811085.129071" + timestampString = "456898163.370652" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "572" - endingLineNumber = "572" - landmarkName = "-didReceiveMessage:" + startingLineNumber = "644" + endingLineNumber = "644" + landmarkName = "-reloadTableViewDataWithMessage:" landmarkType = "5"> @@ -2937,12 +2889,12 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456811085.129071" + timestampString = "456898163.370652" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "574" - endingLineNumber = "574" - landmarkName = "-didReceiveMessage:" + startingLineNumber = "646" + endingLineNumber = "646" + landmarkName = "-reloadTableViewDataWithMessage:" landmarkType = "5"> @@ -2953,28 +2905,12 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456811085.129071" + timestampString = "456898163.370652" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "573" - endingLineNumber = "573" - landmarkName = "-didReceiveMessage:" - landmarkType = "5"> - - - - @@ -2985,12 +2921,28 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/Chat/ChatMainViewController.m" - timestampString = "456811085.129071" + timestampString = "456898163.370652" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "624" - endingLineNumber = "624" - landmarkName = "-downloadMessageAttachments:" + startingLineNumber = "661" + endingLineNumber = "661" + landmarkName = "-didReceiveMessage:" + landmarkType = "5"> + + + + @@ -3093,47 +3045,15 @@ - - - - - - - - @@ -3141,15 +3061,15 @@ @@ -3157,15 +3077,15 @@ @@ -3173,7 +3093,7 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Ash_AWord/AppDelegate.m b/Ash_AWord/AppDelegate.m index 532f3f0..6203e67 100644 --- a/Ash_AWord/AppDelegate.m +++ b/Ash_AWord/AppDelegate.m @@ -24,16 +24,42 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. - _mainViewController = [[MainViewController alloc] init]; - self.window.rootViewController = _mainViewController; - _mainViewController.delegate = self; + + + + + application.applicationIconBadgeNumber = 0; + + if([application respondsToSelector:@selector(registerUserNotificationSettings:)]) + { + UIUserNotificationType notificationTypes = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; + UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil]; + [application registerUserNotificationSettings:settings]; + } + +#if !TARGET_IPHONE_SIMULATOR + //iOS8 注册APNS + if ([application respondsToSelector:@selector(registerForRemoteNotifications)]) { + [application registerForRemoteNotifications]; + }else{ + UIRemoteNotificationType notificationTypes = UIRemoteNotificationTypeBadge | + UIRemoteNotificationTypeSound | + UIRemoteNotificationTypeAlert; + [[UIApplication sharedApplication] registerForRemoteNotificationTypes:notificationTypes]; + } +#endif //注册 APNS文件的名字, 需要与后台上传证书时的名字一一对应 [[EaseMob sharedInstance] registerSDKWithAppKey:EaseMobAppKey apnsCertName:EaseMobApnsCertName]; // 需要在注册sdk后写上该方法 [[EaseMob sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; + + _mainViewController = [[MainViewController alloc] init]; + self.window.rootViewController = _mainViewController; + _mainViewController.delegate = self; + //登陆聊天的 if ([AWordUser sharedInstance].isLogin) { @@ -72,7 +98,42 @@ [[EaseMob sharedInstance] applicationWillTerminate:application]; } +// 将得到的deviceToken传给SDK +- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken{ + [[EaseMob sharedInstance] application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; +} +// 注册deviceToken失败 +- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{ + [[EaseMob sharedInstance] application:application didFailToRegisterForRemoteNotificationsWithError:error]; + DLog(@"error -- %@",error); +} +// 绑定deviceToken回调 +- (void)didBindDeviceWithError:(EMError *)error +{ + if (error) { +// TTAlertNoTitle(NSLocalizedString(@"apns.failToBindDeviceToken", @"Fail to bind device token")); + } +} + + + +// 打印收到的apns信息 +-(void)didReceiveRemoteNotification:(NSDictionary *)userInfo +{ + NSError *parseError = nil; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:userInfo + options:NSJSONWritingPrettyPrinted error:&parseError]; + NSString *str = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; + + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"推送内容" + message:str + delegate:nil + cancelButtonTitle:NSLocalizedString(@"ok", @"OK") + otherButtonTitles:nil]; + [alert show]; + +} - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { return [UMSocialSnsService handleOpenURL:url]; diff --git a/Ash_AWord/Config/Common.h b/Ash_AWord/Config/Common.h index 6eff77c..e0ce4b6 100644 --- a/Ash_AWord/Config/Common.h +++ b/Ash_AWord/Config/Common.h @@ -70,7 +70,7 @@ /** *环信信息 */ -#define EaseMobApnsCertName @"ashyujianni" +#define EaseMobApnsCertName @"yujianni" #define EaseMobAppKey @"ash#ashyujianni" #define EasePassword @"123456" /** diff --git a/Ash_AWord/Info.plist b/Ash_AWord/Info.plist index 2363b39..684e3ef 100644 --- a/Ash_AWord/Info.plist +++ b/Ash_AWord/Info.plist @@ -26,8 +26,6 @@ 2.0 CFBundleSignature ???? - NSLocationWhenInUseUsageDescription - 需要使用定位 CFBundleURLTypes @@ -67,6 +65,8 @@ 5 LSRequiresIPhoneOS + NSLocationWhenInUseUsageDescription + 需要使用定位 UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback001.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback001.png new file mode 100644 index 0000000..38bdbfe Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback001.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback001@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback001@2x.png new file mode 100644 index 0000000..2cdb24b Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback001@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback002.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback002.png new file mode 100644 index 0000000..2b13a1d Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback002.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback002@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback002@2x.png new file mode 100644 index 0000000..b2e0e7f Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback002@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback003.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback003.png new file mode 100644 index 0000000..4f1bb1c Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback003.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback003@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback003@2x.png new file mode 100644 index 0000000..e9bc8bc Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback003@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback004.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback004.png new file mode 100644 index 0000000..603c823 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback004.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback004@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback004@2x.png new file mode 100644 index 0000000..28aa7ac Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback004@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback005.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback005.png new file mode 100644 index 0000000..f67ff3f Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback005.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback005@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback005@2x.png new file mode 100644 index 0000000..74d488f Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback005@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback006.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback006.png new file mode 100644 index 0000000..4fa5300 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback006.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback006@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback006@2x.png new file mode 100644 index 0000000..8d28043 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback006@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback007.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback007.png new file mode 100644 index 0000000..3b0170b Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback007.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback007@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback007@2x.png new file mode 100644 index 0000000..0736ebe Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback007@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback008.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback008.png new file mode 100644 index 0000000..47b3cad Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback008.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback008@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback008@2x.png new file mode 100644 index 0000000..5cf5585 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback008@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback009.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback009.png new file mode 100644 index 0000000..6bfba2e Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback009.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback009@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback009@2x.png new file mode 100644 index 0000000..bf289e3 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback009@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback010.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback010.png new file mode 100644 index 0000000..b2a3c29 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback010.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback010@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback010@2x.png new file mode 100644 index 0000000..02ff260 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback010@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback011.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback011.png new file mode 100644 index 0000000..6dcf32c Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback011.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback011@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback011@2x.png new file mode 100644 index 0000000..3a0f0c2 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback011@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback012.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback012.png new file mode 100644 index 0000000..3614f7b Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback012.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback012@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback012@2x.png new file mode 100644 index 0000000..9717201 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback012@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback013.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback013.png new file mode 100644 index 0000000..312a74f Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback013.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback013@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback013@2x.png new file mode 100644 index 0000000..59833bf Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback013@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback014.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback014.png new file mode 100644 index 0000000..5c57d62 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback014.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback014@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback014@2x.png new file mode 100644 index 0000000..91d29b5 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback014@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback015.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback015.png new file mode 100644 index 0000000..85c01e4 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback015.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback015@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback015@2x.png new file mode 100644 index 0000000..a92501f Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback015@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback016.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback016.png new file mode 100644 index 0000000..4cd504d Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback016.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback016@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback016@2x.png new file mode 100644 index 0000000..2b4e71d Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback016@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback017.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback017.png new file mode 100644 index 0000000..b9a2164 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback017.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback017@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback017@2x.png new file mode 100644 index 0000000..bdfcb28 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback017@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback018.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback018.png new file mode 100644 index 0000000..ba5d721 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback018.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback018@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback018@2x.png new file mode 100644 index 0000000..2c28491 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback018@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback019.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback019.png new file mode 100644 index 0000000..8150744 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback019.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback019@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback019@2x.png new file mode 100644 index 0000000..a89f7e1 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback019@2x.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback020.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback020.png new file mode 100644 index 0000000..48c1819 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback020.png differ diff --git a/Ash_AWord/Resource/audio/VoiceSearchFeedback020@2x.png b/Ash_AWord/Resource/audio/VoiceSearchFeedback020@2x.png new file mode 100644 index 0000000..6b97573 Binary files /dev/null and b/Ash_AWord/Resource/audio/VoiceSearchFeedback020@2x.png differ diff --git a/Ash_AWord/Resource/audio/chatFire_audioPlaying0.png b/Ash_AWord/Resource/audio/chatFire_audioPlaying0.png new file mode 100755 index 0000000..9a44db8 Binary files /dev/null and b/Ash_AWord/Resource/audio/chatFire_audioPlaying0.png differ diff --git a/Ash_AWord/Resource/audio/chatFire_audioPlaying0@2x.png b/Ash_AWord/Resource/audio/chatFire_audioPlaying0@2x.png new file mode 100755 index 0000000..03dbbaf Binary files /dev/null and b/Ash_AWord/Resource/audio/chatFire_audioPlaying0@2x.png differ diff --git a/Ash_AWord/Resource/audio/chatFire_audioPlaying1.png b/Ash_AWord/Resource/audio/chatFire_audioPlaying1.png new file mode 100755 index 0000000..fda9b5b Binary files /dev/null and b/Ash_AWord/Resource/audio/chatFire_audioPlaying1.png differ diff --git a/Ash_AWord/Resource/audio/chatFire_audioPlaying1@2x.png b/Ash_AWord/Resource/audio/chatFire_audioPlaying1@2x.png new file mode 100755 index 0000000..ecbe2e9 Binary files /dev/null and b/Ash_AWord/Resource/audio/chatFire_audioPlaying1@2x.png differ diff --git a/Ash_AWord/Resource/audio/chatFire_audioPlaying2.png b/Ash_AWord/Resource/audio/chatFire_audioPlaying2.png new file mode 100755 index 0000000..35683db Binary files /dev/null and b/Ash_AWord/Resource/audio/chatFire_audioPlaying2.png differ diff --git a/Ash_AWord/Resource/audio/chatFire_audioPlaying2@2x.png b/Ash_AWord/Resource/audio/chatFire_audioPlaying2@2x.png new file mode 100755 index 0000000..219da98 Binary files /dev/null and b/Ash_AWord/Resource/audio/chatFire_audioPlaying2@2x.png differ diff --git a/Ash_AWord/Resource/audio/chatFire_audioPlaying3.png b/Ash_AWord/Resource/audio/chatFire_audioPlaying3.png new file mode 100755 index 0000000..d83efa3 Binary files /dev/null and b/Ash_AWord/Resource/audio/chatFire_audioPlaying3.png differ diff --git a/Ash_AWord/Resource/audio/chatFire_audioPlaying3@2x.png b/Ash_AWord/Resource/audio/chatFire_audioPlaying3@2x.png new file mode 100755 index 0000000..ffc63d5 Binary files /dev/null and b/Ash_AWord/Resource/audio/chatFire_audioPlaying3@2x.png differ diff --git a/Ash_AWord/Utility/Tool/Ash_UIUtil.m b/Ash_AWord/Utility/Tool/Ash_UIUtil.m index c971623..655813f 100644 --- a/Ash_AWord/Utility/Tool/Ash_UIUtil.m +++ b/Ash_AWord/Utility/Tool/Ash_UIUtil.m @@ -13,28 +13,31 @@ +(void)EaseMobLoginWithUserName:(NSString *)userName { + + [[EaseMob sharedInstance].chatManager asyncRegisterNewAccount:userName password:EasePassword withCompletion:^(NSString *username, NSString *password, EMError *error) { if (!error) { DLog(@"注册成功"); - [[EaseMob sharedInstance].chatManager asyncLoginWithUsername:userName password:EasePassword completion:^(NSDictionary *loginInfo, EMError *error) { - if (!error && loginInfo) { - // 设置自动登录 - [[EaseMob sharedInstance].chatManager setIsAutoLoginEnabled:YES]; - DLog(@"登陆成功"); - } - } onQueue:nil]; + [self loginWithUserName:username]; }else if (error.errorCode == EMErrorServerDuplicatedAccount) { - [[EaseMob sharedInstance].chatManager asyncLoginWithUsername:userName password:EasePassword completion:^(NSDictionary *loginInfo, EMError *error) { - if (!error && loginInfo) { - // 设置自动登录 - [[EaseMob sharedInstance].chatManager setIsAutoLoginEnabled:YES]; - DLog(@"登陆成功"); - } - } onQueue:nil]; + [self loginWithUserName:username]; } } onQueue:nil]; } ++(void)loginWithUserName:(NSString*)userName +{ + [[EaseMob sharedInstance].chatManager asyncLoginWithUsername:userName password:EasePassword completion:^(NSDictionary *loginInfo, EMError *error) { + if (!error && loginInfo) { + // 设置自动登录 + [[EaseMob sharedInstance].chatManager setIsAutoLoginEnabled:YES]; + DLog(@"登陆成功"); + } + EMPushNotificationOptions *options = [[EaseMob sharedInstance].chatManager pushNotificationOptions]; + options.nickname = [AWordUser sharedInstance].userName; + [[EaseMob sharedInstance].chatManager asyncUpdatePushOptions:options]; + } onQueue:nil]; +} +(CABasicAnimation*)getrotationAnimation { CABasicAnimation* rotationAnimation; diff --git a/Ash_AWord/ViewControllers/Chat/Call/CallViewController.h b/Ash_AWord/ViewControllers/Chat/Call/CallViewController.h index 1e47af5..3e57ad7 100644 --- a/Ash_AWord/ViewControllers/Chat/Call/CallViewController.h +++ b/Ash_AWord/ViewControllers/Chat/Call/CallViewController.h @@ -55,7 +55,7 @@ static CTCallCenter *g_callCenter; @property (strong, nonatomic) UITapGestureRecognizer *tapRecognizer; - (instancetype)initWithSession:(EMCallSession *)session - isIncoming:(BOOL)isIncoming; + isIncoming:(BOOL)isIncoming withName:(NSString*)name withAvatar:(NSString*)avatar; + (BOOL)canVideo; diff --git a/Ash_AWord/ViewControllers/Chat/Call/CallViewController.m b/Ash_AWord/ViewControllers/Chat/Call/CallViewController.m index fc8bb06..1970fc9 100644 --- a/Ash_AWord/ViewControllers/Chat/Call/CallViewController.m +++ b/Ash_AWord/ViewControllers/Chat/Call/CallViewController.m @@ -15,6 +15,7 @@ @interface CallViewController (){ NSString * _audioCategory; + NSString* _avatar; } @end @@ -22,17 +23,18 @@ @implementation CallViewController - (instancetype)initWithSession:(EMCallSession *)session - isIncoming:(BOOL)isIncoming + isIncoming:(BOOL)isIncoming withName:(NSString *)name withAvatar:(NSString *)avatar { self = [super initWithNibName:nil bundle:nil]; if (self) { _callSession = session; + _isIncoming = isIncoming; _timeLabel.text = @""; _timeLength = 0; - _chatter = session.sessionChatter; - -// [[EaseMob sharedInstance].callManager removeDelegate:self]; + _chatter = name; + _avatar = avatar; + [[EaseMob sharedInstance].callManager removeDelegate:self]; [[EaseMob sharedInstance].callManager addDelegate:self delegateQueue:nil]; g_callCenter = [[CTCallCenter alloc] init]; @@ -169,7 +171,8 @@ [_topView addSubview:_timeLabel]; _headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake((_topView.frame.size.width - 50) / 2, CGRectGetMaxY(_statusLabel.frame) + 20, 50, 50)]; - _headerImageView.image = DefaultUserIcon; +// _headerImageView.image = DefaultUserIcon; + [_headerImageView sd_setImageWithURL:[NSURL URLWithString:_avatar] placeholderImage:DefaultUserIcon]; [_topView addSubview:_headerImageView]; _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_headerImageView.frame) + 5, _topView.frame.size.width, 20)]; diff --git a/Ash_AWord/ViewControllers/Chat/ChatMainViewController.h b/Ash_AWord/ViewControllers/Chat/ChatMainViewController.h index e5d016c..8f09558 100644 --- a/Ash_AWord/ViewControllers/Chat/ChatMainViewController.h +++ b/Ash_AWord/ViewControllers/Chat/ChatMainViewController.h @@ -14,5 +14,5 @@ @property (strong, nonatomic)NSString* otherUserName; @property (strong, nonatomic)NSString* otherUserAvatar; - +@property (strong, nonatomic)NSString* otherUserId; @end diff --git a/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m b/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m index 269a9a5..758b99c 100644 --- a/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m +++ b/Ash_AWord/ViewControllers/Chat/ChatMainViewController.m @@ -26,9 +26,11 @@ #import "MessageModelManager.h" #import "NSDateFormatter+Category.h" #import "MessageReadManager.h" +#import "SRRefreshView.h" + #define KPageCount 20 -@interface ChatMainViewController () +@interface ChatMainViewController () { DXMessageToolBar *_chatToolBar; NSMutableArray* _dataSource; @@ -39,6 +41,9 @@ } @property (strong, nonatomic) EMConversation *conversation;//会话管理者 @property (strong, nonatomic) MessageReadManager *messageReadManager;//message阅读的管理者 +@property (strong, nonatomic) SRRefreshView *slimeView; + +@property (nonatomic) BOOL isPlayingAudio; @end @@ -51,19 +56,34 @@ return _messageReadManager; } +- (SRRefreshView *)slimeView +{ + if (_slimeView == nil) { + _slimeView = [[SRRefreshView alloc] init]; + _slimeView.delegate = self; + _slimeView.upInset = 0; + _slimeView.slimeMissWhenGoingBack = YES; + _slimeView.slime.bodyColor = [UIColor grayColor]; + _slimeView.slime.skinColor = [UIColor grayColor]; + _slimeView.slime.lineWith = 1; + _slimeView.slime.shadowBlur = 4; + _slimeView.slime.shadowColor = [UIColor grayColor]; + } + + return _slimeView; +} - (instancetype)initWithChatter:(NSString *)chatter conversationType:(EMConversationType)type { self = [super initWithNibName:nil bundle:nil]; if (self) { -// _isPlayingAudio = NO; + _isPlayingAudio = NO; // _chatter = chatter; // _conversationType = type; _messages = [NSMutableArray array]; //根据接收者的username获取当前会话的管理者 - _conversation = [[EaseMob sharedInstance].chatManager conversationForChatter:chatter - conversationType:type]; + _conversation = [[EaseMob sharedInstance].chatManager conversationForChatter:chatter conversationType:type]; [_conversation markAllMessagesAsRead:YES]; } @@ -72,19 +92,21 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. + [self customViewDidLoad]; _tableView.dataSource = self; _tableView.delegate = self; _dataSource = [NSMutableArray array]; _messages = [NSMutableArray array]; _messageQueue = dispatch_queue_create("easemob.com", NULL); + _isPlayingAudio = NO; self.navigationItem.title = _otherUserName; //根据接收者的username获取当前会话的管理者 - _conversation = [[EaseMob sharedInstance].chatManager conversationForChatter:@"admin" conversationType:eConversationTypeChat]; + _conversation = [[EaseMob sharedInstance].chatManager conversationForChatter:_otherUserId conversationType:eConversationTypeChat]; [_conversation markAllMessagesAsRead:YES]; - _chatToolBar = [[DXMessageToolBar alloc] initWithFrame:CGRectMake(0, kScreenHeight-[DXMessageToolBar defaultHeight], kScreenWidth, [DXMessageToolBar defaultHeight])]; + _chatToolBar = [[DXMessageToolBar alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height-[DXMessageToolBar defaultHeight], kScreenWidth, [DXMessageToolBar defaultHeight])]; _chatToolBar.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleRightMargin; _chatToolBar.delegate = self; @@ -111,6 +133,9 @@ UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(keyBoardHidden)]; [self.view addGestureRecognizer:tap]; + [self.tableView addSubview:self.slimeView]; + + //通过会话管理者获取已收发消息 [self loadMoreMessages]; } @@ -199,15 +224,15 @@ */ - (void)didFinishRecoingVoiceAction:(UIView *)recordView { - __weak typeof(self) weakSelf = self; [[EMCDDeviceManager sharedInstance] asyncStopRecordingWithCompletion:^(NSString *recordPath, NSInteger aDuration, NSError *error) { if (!error) { EMChatVoice *voice = [[EMChatVoice alloc] initWithFile:recordPath displayName:@"audio"]; voice.duration = aDuration; -// [weakSelf sendAudioMessage:voice]; + [self sendAudioMessage:voice]; }else { // [weakSelf showHudInView:self.view hint:@"录音时间太短了"]; + [MBProgressHUD errorHudWithView:self.view label:@"录音时间太短了" hidesAfter:1.0]; _chatToolBar.recordButton.enabled = NO; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // [weakSelf hideHud]; @@ -248,7 +273,7 @@ [picker dismissViewControllerAnimated:YES completion:^{ [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:NO] forKey:@"isShowPicker"]; }]; -// [self sendImageMessage:orgImage]; + [self sendImageMessage:orgImage]; } // self.isInvisible = NO; } @@ -277,6 +302,16 @@ [self presentViewController:picker animated:YES completion:nil]; } + +#pragma mark - slimeRefresh delegate +//加载更多 +- (void)slimeRefreshStartRefresh:(SRRefreshView *)refreshView +{ + _chatTagDate = nil; + [self loadMoreMessages]; + [_slimeView endRefresh]; +} + // 点击背景隐藏 -(void)keyBoardHidden { @@ -313,17 +348,17 @@ { // 隐藏键盘 [self keyBoardHidden]; -// [[NSNotificationCenter defaultCenter] postNotificationName:@"callOutWithChatter" object:@{@"chatter":self.chatter, @"type":[NSNumber numberWithInt:eCallSessionTypeAudio]}]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"callOutWithChatter" object:@{@"chatter":_otherUserId, @"type":[NSNumber numberWithInt:eCallSessionTypeAudio],@"username":_otherUserName,@"useravatar":_otherUserAvatar}]; - EMCallSession *callSession = nil; - EMError *error = nil; +// EMCallSession *callSession = nil; +// EMError *error = nil; - callSession = [[EaseMob sharedInstance].callManager asyncMakeVoiceCall:_conversation.chatter timeout:50 error:&error]; - - - CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:NO]; - callController.modalPresentationStyle = UIModalPresentationOverFullScreen; - [self presentViewController:callController animated:NO completion:nil]; +// callSession = [[EaseMob sharedInstance].callManager asyncMakeVoiceCall:_conversation.chatter timeout:50 error:&error]; +// +// +// CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:NO withName:_otherUserName withAvatar:_otherUserAvatar]; +// callController.modalPresentationStyle = UIModalPresentationOverFullScreen; +// [self presentViewController:callController animated:NO completion:nil]; } - (void)moreViewVideoCallAction:(DXChatBarMoreView *)moreView @@ -339,7 +374,7 @@ callSession = [[EaseMob sharedInstance].callManager asyncMakeVideoCall:_conversation.chatter timeout:50 error:&error]; - CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:NO]; + CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:NO withName:_otherUserName withAvatar:_otherUserAvatar]; callController.modalPresentationStyle = UIModalPresentationOverFullScreen; [self presentViewController:callController animated:NO completion:nil]; } @@ -449,10 +484,20 @@ } } --(void)scrollViewDidScroll:(UIScrollView *)scrollView{ -// if (scrollView == _tableView) { -// [self.view endEditing:YES]; -// } +#pragma mark - scrollView delegate + +- (void)scrollViewDidScroll:(UIScrollView *)scrollView +{ + if (_slimeView) { + [_slimeView scrollViewDidScroll]; + } +} + +- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate +{ + if (_slimeView) { + [_slimeView scrollViewDidEndDraging]; + } } #pragma mark - send message @@ -463,9 +508,38 @@ toUsername:_conversation.chatter messageType:eMessageTypeChat requireEncryption:NO - ext:nil]; + ext:[NSDictionary dictionaryWithObject:[AWordUser sharedInstance].userName forKey:@"username"]]; + [self addMessage:tempMessage]; } +-(void)sendImageMessage:(UIImage *)image +{ + EMMessage *tempMessage = [ChatSendHelper sendImageMessageWithImage:image + toUsername:_conversation.chatter + messageType:eMessageTypeChat + requireEncryption:NO + ext:[NSDictionary dictionaryWithObject:[AWordUser sharedInstance].userName forKey:@"username"]]; + [self addMessage:tempMessage]; +} + +-(void)sendAudioMessage:(EMChatVoice *)voice +{ + EMMessage *tempMessage = [ChatSendHelper sendVoice:voice + toUsername:_conversation.chatter + messageType:eMessageTypeChat + requireEncryption:NO ext:[NSDictionary dictionaryWithObject:[AWordUser sharedInstance].userName forKey:@"username"]]; + [self addMessage:tempMessage]; +} + +-(void)sendVideoMessage:(EMChatVideo *)video +{ + EMMessage *tempMessage = [ChatSendHelper sendVideo:video + toUsername:_conversation.chatter + messageType:eMessageTypeChat + requireEncryption:NO ext:[NSDictionary dictionaryWithObject:[AWordUser sharedInstance].userName forKey:@"username"]]; + [self addMessage:tempMessage]; +} + -(void)addMessage:(EMMessage *)message { [_messages addObject:message]; @@ -491,17 +565,7 @@ } MessageModel *model = [MessageModelManager modelWithMessage:message]; - model.nickName = @"haha"; -// if ([_delelgate respondsToSelector:@selector(nickNameWithChatter:)]) { -// NSString *showName = [_delelgate nickNameWithChatter:model.username]; -// model.nickName = showName?showName:model.username; -// }else { -// model.nickName = model.username; -// } - -// if ([_delelgate respondsToSelector:@selector(avatarWithChatter:)]) { -// model.headImageURL = [NSURL URLWithString:[_delelgate avatarWithChatter:model.username]]; -// } + model.nickName = model.username; if (model.isSender){ model.headImageURL = [NSURL URLWithString:[AWordUser sharedInstance].userAvatar]; }else{ @@ -515,8 +579,22 @@ return ret; } +#pragma mark - LocationViewDelegate -#pragma mark - IChatManagerDelegate +-(void)sendLocationLatitude:(double)latitude longitude:(double)longitude andAddress:(NSString *)address +{ + EMMessage *locationMessage = [ChatSendHelper sendLocationLatitude:latitude longitude:longitude address:address toUsername:_conversation.chatter messageType:eMessageTypeChat requireEncryption:NO ext:nil]; + [self addMessage:locationMessage]; +} +#pragma mark - ICallManagerDelegate + +- (void)callSessionStatusChanged:(EMCallSession *)callSession changeReason:(EMCallStatusChangedReason)reason error:(EMError *)error{ + if (reason == eCallReason_Null) { + if ([[EMCDDeviceManager sharedInstance] isPlaying]) { + [self stopAudioPlayingWithChangeCategory:NO]; + } + } +} -(void)didSendMessage:(EMMessage *)message error:(EMError *)error { @@ -586,7 +664,31 @@ chatter:(NSString *)conversationChatter error:(EMError *)error { - + if (error && [_conversation.chatter isEqualToString:conversationChatter]) { + + __weak ChatMainViewController *weakSelf = self; + for (int i = 0; i <_dataSource.count; i ++) { + id object = [_dataSource objectAtIndex:i]; + if ([object isKindOfClass:[MessageModel class]]) { + MessageModel *currentModel = [_dataSource objectAtIndex:i]; + EMMessage *currMsg = [currentModel message]; + if ([messageId isEqualToString:currMsg.messageId]) { + currMsg.deliveryState = eMessageDeliveryState_Failure; + MessageModel *cellModel = [MessageModelManager modelWithMessage:currMsg]; + dispatch_async(dispatch_get_main_queue(), ^{ + [weakSelf.tableView beginUpdates]; + [_dataSource replaceObjectAtIndex:i withObject:cellModel]; + [weakSelf.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:i inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + [weakSelf.tableView endUpdates]; + + }); + + break; + } + } + } + } + } - (NSArray *)formatMessages:(NSArray *)messagesArray @@ -773,6 +875,40 @@ } }); } +- (void)stopAudioPlayingWithChangeCategory:(BOOL)isChange +{ + //停止音频播放及播放动画 + [[EMCDDeviceManager sharedInstance] stopPlaying]; + [[EMCDDeviceManager sharedInstance] disableProximitySensor]; + [EMCDDeviceManager sharedInstance].delegate = nil; + MessageModel *playingModel = [self.messageReadManager stopMessageAudioModel]; + NSIndexPath *indexPath = nil; + if (playingModel) { + indexPath = [NSIndexPath indexPathForRow:[_dataSource indexOfObject:playingModel] inSection:0]; + } + + if (indexPath) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self.tableView beginUpdates]; + [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView endUpdates]; + }); + } +} +#pragma mark - EMCDDeviceManagerDelegate +- (void)proximitySensorChanged:(BOOL)isCloseToUser{ + AVAudioSession *audioSession = [AVAudioSession sharedInstance]; + if (isCloseToUser) + { + [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil]; + } else { + [audioSession setCategory:AVAudioSessionCategoryPlayback error:nil]; + if (!_isPlayingAudio) { + [[EMCDDeviceManager sharedInstance] disableProximitySensor]; + } + } + [audioSession setActive:YES error:nil]; +} - (void)markMessagesAsRead:(NSArray*)messages { EMConversation *conversation = _conversation; @@ -862,20 +998,20 @@ }]; if (isPrepare) { -// _isPlayingAudio = YES; + _isPlayingAudio = YES; __weak ChatMainViewController *weakSelf = self; [[EMCDDeviceManager sharedInstance] enableProximitySensor]; [[EMCDDeviceManager sharedInstance] asyncPlayingWithPath:model.chatVoice.localPath completion:^(NSError *error) { [weakSelf.messageReadManager stopMessageAudioModel]; dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf.tableView reloadData]; -// weakSelf.isPlayingAudio = NO; + weakSelf.isPlayingAudio = NO; [[EMCDDeviceManager sharedInstance] disableProximitySensor]; }); }]; } else{ -// _isPlayingAudio = NO; + _isPlayingAudio = NO; } } } @@ -1027,7 +1163,11 @@ [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - +-(void)dealloc +{ + _slimeView.delegate = nil; + _slimeView = nil; +} /* #pragma mark - Navigation diff --git a/Ash_AWord/ViewControllers/Chat/MessageReadManager.m b/Ash_AWord/ViewControllers/Chat/MessageReadManager.m index 47e5d9f..24eb617 100644 --- a/Ash_AWord/ViewControllers/Chat/MessageReadManager.m +++ b/Ash_AWord/ViewControllers/Chat/MessageReadManager.m @@ -13,7 +13,7 @@ #import "MessageReadManager.h" //#import "UIImageView+EMWebCache.h" #import "EMCDDeviceManager.h" - +#import "AppDelegate.h" static MessageReadManager *detailInstance = nil; @interface MessageReadManager() @@ -64,18 +64,28 @@ static MessageReadManager *detailInstance = nil; - (MWPhotoBrowser *)photoBrowser { - if (_photoBrowser == nil) { + _photoBrowser = [[MWPhotoBrowser alloc] initWithDelegate:self]; + //是否显示分享按钮 _photoBrowser.displayActionButton = YES; + //左右分页切换 _photoBrowser.displayNavArrows = YES; + //是否显示选择按钮 _photoBrowser.displaySelectionButtons = NO; - _photoBrowser.alwaysShowControls = NO; - _photoBrowser.wantsFullScreenLayout = YES; + //是否显示条件控制控件 + _photoBrowser.alwaysShowControls = YES; + //是否全屏 _photoBrowser.zoomPhotosToFill = YES; - _photoBrowser.enableGrid = NO; - _photoBrowser.startOnGrid = NO; + + //允许使用网络查看所有图片 + _photoBrowser.enableGrid = YES; + //是否第一张 + _photoBrowser.startOnGrid = YES; + _photoBrowser.enableSwipeToDismiss = YES; + [_photoBrowser showNextPhotoAnimated:YES]; + [_photoBrowser showPreviousPhotoAnimated:YES]; [_photoBrowser setCurrentPhotoIndex:0]; - } + return _photoBrowser; } @@ -84,7 +94,7 @@ static MessageReadManager *detailInstance = nil; { if (_photoNavigationController == nil) { _photoNavigationController = [[UINavigationController alloc] initWithRootViewController:self.photoBrowser]; - _photoNavigationController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; + _photoNavigationController.modalTransitionStyle = UIModalTransitionStylePartialCurl; } [self.photoBrowser reloadData]; @@ -137,8 +147,8 @@ static MessageReadManager *detailInstance = nil; self.photos = photoArray; } - UIViewController *rootController = [self.keyWindow rootViewController]; - [rootController presentViewController:self.photoNavigationController animated:YES completion:nil]; + + [[AppDelegate visibleViewController].navigationController pushViewController:self.photoBrowser animated:YES]; } - (BOOL)prepareMessageAudioModel:(MessageModel *)messageModel diff --git a/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRDefine.h b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRDefine.h new file mode 100755 index 0000000..964e5b7 --- /dev/null +++ b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRDefine.h @@ -0,0 +1,18 @@ +// +// SRDefine.h +// SlimeRefresh +// +// Created by zrz on 12-6-15. +// Copyright (c) 2012年 zrz. All rights reserved. +// + +#ifndef SlimeRefresh_SRDefine_h +#define SlimeRefresh_SRDefine_h + +#define kStartTo 0.7f +#define kEndTo 0.15f + +#define kRefreshImageWidth 17.0f +#define kAnimationInterval (1.0f/50.0f) + +#endif diff --git a/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRRefreshView.h b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRRefreshView.h new file mode 100755 index 0000000..f404b44 --- /dev/null +++ b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRRefreshView.h @@ -0,0 +1,63 @@ +// +// SRRefreshView.h +// SlimeRefresh +// +// A refresh view looks like UIRefreshControl +// +// Created by zrz on 12-6-15. +// Copyright (c) 2012年 zrz. All rights reserved. +// + +#import +#import "SRSlimeView.h" + +@class SRRefreshView; + +typedef void (^SRRefreshBlock)(SRRefreshView* sender); + +@protocol SRRefreshDelegate; + +@interface SRRefreshView : UIView{ + UIImageView *_refleshView; + SRSlimeView *_slime; +} + +//set the state loading or not. +@property (nonatomic, assign) BOOL loading; +- (void)setLoadingWithExpansion; + +//set the slime's style by this property. +@property (nonatomic, strong, readonly) SRSlimeView *slime; +//set your refresh icon. +@property (nonatomic, strong, readonly) UIImageView *refleshView; +//select one to receive the refreshing message. +@property (nonatomic, copy) SRRefreshBlock block; +@property (nonatomic, assign) id delegate; +@property (nonatomic, readonly) UIActivityIndicatorView *activityIndicationView; + +//default is false, if true when slime go back it will have a alpha effect +//to go to miss. +@property (nonatomic, assign) BOOL slimeMissWhenGoingBack; + +// +@property (nonatomic, assign) CGFloat upInset; + +// +- (void)scrollViewDidScroll; +- (void)scrollViewDidEndDraging; + +//as the name, called when loading over. +- (void)endRefresh; + +// init default is 32 +- (id)initWithHeight:(CGFloat)height; + +@end + +@protocol SRRefreshDelegate + +@optional +//start refresh. +- (void)slimeRefreshStartRefresh:(SRRefreshView*)refreshView; + +@end \ No newline at end of file diff --git a/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRRefreshView.m b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRRefreshView.m new file mode 100755 index 0000000..b9181f5 --- /dev/null +++ b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRRefreshView.m @@ -0,0 +1,328 @@ +// +// SRRefreshView.m +// SlimeRefresh +// +// Created by zrz on 12-6-15. +// Copyright (c) 2012年 zrz. All rights reserved. +// + +#import "SRRefreshView.h" +#import "SRSlimeView.h" +#import "SRDefine.h" +#import + +@interface SRRefreshView() + +@property (nonatomic, assign) BOOL broken; +@property (nonatomic, weak) UIScrollView *scrollView; + +@end + +@implementation SRRefreshView { + UIActivityIndicatorView *_activityIndicatorView; + CGFloat _oldLength; + BOOL _unmissSlime; + CGFloat _dragingHeight; +} + +@synthesize delegate = _delegate, broken = _broken; +@synthesize loading = _loading, scrollView = _scrollView; +@synthesize slime = _slime, refleshView = _refleshView; +@synthesize block = _block, upInset = _upInset; +@synthesize slimeMissWhenGoingBack = _slimeMissWhenGoingBack; +@synthesize activityIndicationView = _activityIndicatorView; + +- (void)dealloc +{ +} + +- (id)initWithFrame:(CGRect)frame +{ + self = [self initWithHeight:32]; + return self; +} + +- (id)initWithHeight:(CGFloat)height +{ + CGRect frame = CGRectMake(0, 0, kScreenWidth, height); + self = [super initWithFrame:frame]; + if (self) { + _slime = [[SRSlimeView alloc] initWithFrame: + CGRectMake(0.0f, 0.0f, frame.size.width, frame.size.height)]; + _slime.startPoint = CGPointMake(frame.size.width / 2, height / 2); + + [self addSubview:_slime]; + + _refleshView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sr_refresh"]]; + _refleshView.center = _slime.startPoint; + _refleshView.bounds = CGRectMake(0.0f, 0.0f, kRefreshImageWidth, kRefreshImageWidth); + [self addSubview:_refleshView]; + + _activityIndicatorView = [[UIActivityIndicatorView alloc] + initWithActivityIndicatorStyle: + UIActivityIndicatorViewStyleGray]; + [_activityIndicatorView stopAnimating]; + _activityIndicatorView.center = _slime.startPoint; + [self addSubview:_activityIndicatorView]; + + [_slime setPullApartTarget:self + action:@selector(pullApart:)]; + _dragingHeight = height; + } + return self; +} + +#pragma mark - setters + +- (void)setFrame:(CGRect)frame +{ + [super setFrame:frame]; + if (_slime.state == SRSlimeStateNormal) { + _slime.frame = CGRectMake(0.0f, 0.0f, frame.size.width, frame.size.height); + _slime.startPoint = CGPointMake(frame.size.width / 2, _dragingHeight / 2); + } + _refleshView.center = _slime.startPoint; + _activityIndicatorView.center = _slime.startPoint; +} + +- (void)setUpInset:(CGFloat)upInset +{ + _upInset = upInset; + UIEdgeInsets inset = _scrollView.contentInset; + inset.top = _upInset; + _scrollView.contentInset = inset; + +} + +- (void)setSlimeMissWhenGoingBack:(BOOL)slimeMissWhenGoingBack +{ + _slimeMissWhenGoingBack = slimeMissWhenGoingBack; + if (!slimeMissWhenGoingBack) { + _slime.alpha = 1; + }else { + CGPoint p = _scrollView.contentOffset; + self.alpha = -(p.y + _upInset) / _dragingHeight; + } +} + +- (void)setLoading:(BOOL)loading +{ + if (_loading == loading) { + return; + } + _loading = loading; + if (_loading) { + [_activityIndicatorView startAnimating]; + CAKeyframeAnimation *aniamtion = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; + + aniamtion.values = [NSArray arrayWithObjects: + [NSValue valueWithCATransform3D: + CATransform3DRotate(CATransform3DMakeScale(0.01, 0.01, 0.1), + -M_PI, 0, 0, 1)], + [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.6, 1.6, 1)], + [NSValue valueWithCATransform3D:CATransform3DIdentity],nil]; + aniamtion.keyTimes = [NSArray arrayWithObjects: + [NSNumber numberWithFloat:0], + [NSNumber numberWithFloat:0.6], + [NSNumber numberWithFloat:1], nil]; + aniamtion.timingFunctions = [NSArray arrayWithObjects: + [CAMediaTimingFunction functionWithName: + kCAMediaTimingFunctionEaseInEaseOut], + [CAMediaTimingFunction functionWithName: + kCAMediaTimingFunctionEaseInEaseOut], + nil]; + aniamtion.duration = 0.7; + _activityIndicatorView.layer.transform = CATransform3DIdentity; + [_activityIndicatorView.layer addAnimation:aniamtion + forKey:@""]; + //_slime.hidden = YES; + _refleshView.hidden = YES; + if (!_scrollView.isDragging) { + UIEdgeInsets inset = _scrollView.contentInset; + inset.top = _upInset + _dragingHeight; + _scrollView.contentInset = inset; + } + if (!_unmissSlime){ + _slime.state = SRSlimeStateMiss; + }else { + _unmissSlime = NO; + } + }else { + + [_activityIndicatorView stopAnimating]; + _slime.hidden = NO; + _refleshView.hidden = NO; + _refleshView.layer.transform = CATransform3DIdentity; + __weak typeof(self) weakSelf = self; + [UIView transitionWithView:_scrollView + duration:0.3f + options:UIViewAnimationOptionBeginFromCurrentState + animations:^{ + UIEdgeInsets inset = weakSelf.scrollView.contentInset; + inset.top = weakSelf.upInset; + weakSelf.scrollView.contentInset = inset; + if (weakSelf.scrollView.contentOffset.y == -weakSelf.upInset && + weakSelf.slimeMissWhenGoingBack) { + self.alpha = 0.0f; + } + } completion:^(BOOL finished) { + //_notSetFrame = NO; + }]; + + } +} + +- (void)setLoadingWithExpansion +{ +// self.loading = YES; +// [_scrollView setContentOffset:CGPointMake(_scrollView.contentOffset.x, +// -_scrollView.contentInset.top) +// animated:YES]; + + self.loading = YES; + [_scrollView setContentOffset:CGPointMake(_scrollView.contentOffset.x, -_dragingHeight) animated:YES]; + [self scrollViewDidScroll]; + [self scrollViewDidEndDraging]; + [self pullApart:self]; +} + +- (void)didMoveToSuperview +{ + [super didMoveToSuperview]; + if ([self.superview isKindOfClass:[UIScrollView class]]) { + self.scrollView = (id)[self superview]; + CGRect rect = self.frame; + rect.origin.y = rect.size.height?-rect.size.height:-_dragingHeight; + rect.size.width = _scrollView.frame.size.width; + self.frame = rect; + self.slime.toPoint = self.slime.startPoint; + + UIEdgeInsets inset = self.scrollView.contentInset; + inset.top = _upInset; + self.scrollView.contentInset = inset; + }else if (!self.superview) { + self.scrollView = nil; + } +} + +#pragma mark - action + +- (void)pullApart:(SRRefreshView*)refreshView +{ + //拉断了 + self.broken = YES; + _unmissSlime = YES; + self.loading = YES; + if ([_delegate respondsToSelector:@selector(slimeRefreshStartRefresh:)]) { + [(id)_delegate performSelector:@selector(slimeRefreshStartRefresh:) + withObject:self + afterDelay:0.0]; + } + if (_block) { + _block(self); + } +} + +- (void)scrollViewDidScroll +{ + CGPoint p = _scrollView.contentOffset; + CGRect rect = self.frame; + if (p.y <= - _dragingHeight - _upInset) { + rect.origin.y = p.y + _upInset; + rect.size.height = -p.y; + rect.size.height = ceilf(rect.size.height); + self.frame = rect; + if (!self.loading) { + [_slime setNeedsDisplay]; + } + if (!_broken) { + float l = -(p.y + _dragingHeight + _upInset); + if (l <= _oldLength) { + l = MIN(distansBetween(_slime.startPoint, _slime.toPoint), l); + CGPoint ssp = _slime.startPoint; + _slime.toPoint = CGPointMake(ssp.x, ssp.y + l); + CGFloat pf = (1.0f-l/_slime.viscous) * (1.0f-kStartTo) + kStartTo; + _refleshView.layer.transform = CATransform3DMakeScale(pf, pf, 1); + }else if (self.scrollView.isDragging) { + CGPoint ssp = _slime.startPoint; + _slime.toPoint = CGPointMake(ssp.x, ssp.y + l); + CGFloat pf = (1.0f-l/_slime.viscous) * (1.0f-kStartTo) + kStartTo; + _refleshView.layer.transform = CATransform3DMakeScale(pf, pf, 1); + } + _oldLength = l; + } + if (self.alpha != 1.0f) self.alpha = 1.0f; + }else if (p.y < -_upInset) { + rect.origin.y = -_dragingHeight; + rect.size.height = _dragingHeight; + self.frame = rect; + [_slime setNeedsDisplay]; + _slime.toPoint = _slime.startPoint; + if (_slimeMissWhenGoingBack) self.alpha = -(p.y + _upInset) / _dragingHeight; + } +} + +- (void)scrollViewDidEndDraging +{ + if (_broken) { + if (self.loading) { + [UIView transitionWithView:_scrollView + duration:0.2 + options:UIViewAnimationOptionBeginFromCurrentState + animations:^{ + UIEdgeInsets inset = self->_scrollView.contentInset; + inset.top = self->_upInset + self->_dragingHeight; + self->_scrollView.contentInset = inset; + } completion:^(BOOL finished) { + self.broken = NO; + }]; + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationDuration:0.2f]; + [UIView commitAnimations]; + }else { + [self performSelector:@selector(setBroken:) + withObject:nil afterDelay:0.2]; + self.loading = NO; + } + } +} + +- (void)endRefresh +{ + if (self.loading) { + //_notSetFrame = YES; + [self performSelector:@selector(restore) + withObject:nil + afterDelay:0]; + } + _oldLength = 0; +} + +- (void)restore +{ + _slime.toPoint = _slime.startPoint; + [UIView transitionWithView:_activityIndicatorView + duration:0.3f + options:UIViewAnimationOptionAllowUserInteraction + animations:^ + { + self->_activityIndicatorView.layer.transform = CATransform3DRotate( + CATransform3DMakeScale(0.01f, 0.01f, 0.1f), -M_PI, 0, 0, 1); + } completion:^(BOOL finished) + { + self.loading = NO; + self->_slime.state = SRSlimeStateNormal; + //some bug here. + // CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath: + // @"transform"]; + // animation.fromValue = [NSValue valueWithCATransform3D: + // CATransform3DMakeScale(0.1, 0.1, 1)]; + // animation.toValue = [NSValue valueWithCATransform3D: + // CATransform3DIdentity]; + // animation.duration = 0.2f; + // [_slime.layer addAnimation:animation + // forKey:@""]; + }]; +} + +@end diff --git a/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRSlimeView.h b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRSlimeView.h new file mode 100755 index 0000000..07cc983 --- /dev/null +++ b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRSlimeView.h @@ -0,0 +1,46 @@ +// +// SRAnimationView.h +// SlimeRefresh +// +// Created by zrz on 12-6-15. +// Copyright (c) 2012年 zrz. All rights reserved. +// + +#import + +NS_INLINE CGFloat distansBetween(CGPoint p1 , CGPoint p2) { + return sqrtf((p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y)); +} + +typedef enum { + SRSlimeStateNormal, + SRSlimeStateShortening, + SRSlimeStateMiss +} SRSlimeState; + +typedef enum { + SRSlimeBlurShadow, + SRSlimeFillShadow +} SRSlimeShadowType; + +@class SRSlimeView; + +@interface SRSlimeView : UIView + +@property (nonatomic, assign) CGPoint startPoint, toPoint; +@property (nonatomic, assign) CGFloat viscous; //default 55 +@property (nonatomic, assign) CGFloat radius; //default 13 +@property (nonatomic, retain) UIColor *bodyColor, + *skinColor; + +@property (nonatomic, assign) SRSlimeShadowType shadowType; +@property (nonatomic, assign) CGFloat lineWith; +@property (nonatomic, assign) CGFloat shadowBlur; +@property (nonatomic, strong) UIColor *shadowColor; + +@property (nonatomic, assign) BOOL missWhenApart; +@property (nonatomic, assign) SRSlimeState state; + +- (void)setPullApartTarget:(id)target action:(SEL)action; + +@end diff --git a/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRSlimeView.m b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRSlimeView.m new file mode 100755 index 0000000..44e4eb2 --- /dev/null +++ b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/SRSlimeView.m @@ -0,0 +1,277 @@ +// +// SRAnimationView.m +// SlimeRefresh +// +// Created by zrz on 12-6-15. +// Copyright (c) 2012年 zrz. All rights reserved. +// + +#import "SRSlimeView.h" +#import "SRDefine.h" +#import + + + +NS_INLINE CGPoint pointLineToArc(CGPoint center, CGPoint p2, float angle, CGFloat radius) { + float angleS = atan2f(p2.y - center.y, p2.x - center.x); + float angleT = angleS + angle; + float x = radius * cosf(angleT); + float y = radius * sinf(angleT); + return CGPointMake(x + center.x, y + center.y); +} + +@implementation SRSlimeView { + __unsafe_unretained id _target; + SEL _action; +} + +@synthesize viscous = _viscous, toPoint = _toPoint; +@synthesize startPoint = _startPoint, skinColor = _skinColor; +@synthesize bodyColor = _bodyColor, radius = _radius; +@synthesize missWhenApart = _missWhenApart, state = _state; + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + + self.backgroundColor = [UIColor clearColor]; + + _toPoint = _startPoint = CGPointMake(frame.size.width / 2, + frame.size.height / 2); + _viscous = 55.0f; + _radius = 13.0f; + _bodyColor = [UIColor blackColor]; + _skinColor = [UIColor colorWithWhite:0.8f alpha:0.9f]; + + _missWhenApart = YES; + _lineWith = 2; + + } + return self; +} + +// ==== not need +//- (void)setFrame:(CGRect)frame +//{ +// [super setFrame:frame]; +// _toPoint = _startPoint = CGPointMake(frame.size.width / 2, +// frame.size.height / 2); +// [self setNeedsDisplay]; +//} + +- (void)setLineWith:(CGFloat)lineWith +{ + _lineWith = lineWith; + [self setNeedsDisplay]; +} + +- (void)setStartPoint:(CGPoint)startPoint +{ + if (CGPointEqualToPoint(_startPoint, startPoint))return; + if (_state == SRSlimeStateNormal) { + _startPoint = startPoint; + [self setNeedsDisplay]; + } +} + +- (void)setToPoint:(CGPoint)toPoint +{ + if (CGPointEqualToPoint(_toPoint, toPoint))return; + if (_state == SRSlimeStateNormal) { + _toPoint = toPoint; + [self setNeedsDisplay]; + } +} + +- (UIBezierPath*)bodyPath:(CGFloat)startRadius end:(CGFloat)endRadius percent:(float)percent +{ + UIBezierPath *path = [[UIBezierPath alloc] init]; + + float angle1 = M_PI/3 + (M_PI / 6 /*M_PI/2 - M_PI/3*/) * percent; + + CGPoint sp1 = pointLineToArc(_startPoint, _toPoint, + angle1, startRadius), + sp2 = pointLineToArc(_startPoint, _toPoint, + -angle1, startRadius), + ep1 = pointLineToArc(_toPoint, _startPoint, + M_PI/2, endRadius), + ep2 = pointLineToArc(_toPoint, _startPoint, + -M_PI/2, endRadius); + +#define kMiddleP 0.6 + CGPoint mp1 = CGPointMake(sp2.x*kMiddleP + ep1.x*(1-kMiddleP), sp2.y*kMiddleP + ep1.y*(1-kMiddleP)), + mp2 = CGPointMake(sp1.x*kMiddleP + ep2.x*(1-kMiddleP), sp1.y*kMiddleP + ep2.y*(1-kMiddleP)), + mm = CGPointMake((mp1.x + mp2.x)/2, (mp1.y + mp2.y)/2); + float p = distansBetween(mp1, mp2) / 2 / endRadius * (0.9 + percent/10); + mp1 = CGPointMake((mp1.x - mm.x)/p + mm.x, (mp1.y - mm.y)/p + mm.y); + mp2 = CGPointMake((mp2.x - mm.x)/p + mm.x, (mp2.y - mm.y)/p + mm.y); + + [path moveToPoint:sp1]; + float angleS = atan2f(_toPoint.y - _startPoint.y, + _toPoint.x - _startPoint.x); + [path addArcWithCenter:_startPoint + radius:startRadius + startAngle:angleS + angle1 + endAngle:angleS + M_PI*2 - angle1 + clockwise:YES]; + [path addQuadCurveToPoint:ep1 + controlPoint:mp1]; + angleS = atan2f(_startPoint.y - _toPoint.y, + _startPoint.x - _toPoint.x); + [path addArcWithCenter:_toPoint + radius:endRadius + startAngle:angleS + M_PI/2 + endAngle:angleS + M_PI*3/2 + clockwise:YES]; + [path addQuadCurveToPoint:sp1 + controlPoint:mp2]; + + return path; +} + +- (void)drawRect:(CGRect)rect +{ + switch (_state) { + case SRSlimeStateNormal: + { + float percent = 1 - distansBetween(_startPoint , _toPoint) / _viscous; + if (percent == 1) { + CGContextRef context = UIGraphicsGetCurrentContext(); + UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(_startPoint.x - _radius, _startPoint.y - _radius, 2*_radius, 2*_radius) + cornerRadius:_radius]; + + + [self setContext:context path:path]; + CGContextDrawPath(context, kCGPathFillStroke); + }else { + CGFloat startRadius = _radius * (kStartTo + (1-kStartTo)*percent); + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGFloat endRadius = _radius * (kEndTo + (1-kEndTo)*percent); + UIBezierPath *path = [self bodyPath:startRadius + end:endRadius + percent:percent]; + [self setContext:context path:path]; + CGContextDrawPath(context, kCGPathFillStroke); + if (percent <= 0) { + _state = SRSlimeStateShortening; + + // pragma mark to suppress the warning + // "performSelector may cause a leak because its selector is unknown" + // applies only to the enclosed line +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [_target performSelector:_action + withObject:self]; +#pragma clang diagnostic pop + + [self performSelector:@selector(scaling) + withObject:nil + afterDelay:kAnimationInterval + inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]]; + } + } + } + break; + case SRSlimeStateShortening: + { + _toPoint = CGPointMake((_toPoint.x - _startPoint.x)*0.8 + _startPoint.x, + (_toPoint.y - _startPoint.y)*0.8 + _startPoint.y); + float p = distansBetween(_startPoint, _toPoint) / _viscous; + float percent =1 -p; + float r = _radius * p; + + if (p > 0.01) { + CGFloat startRadius = r * (kStartTo + (1-kStartTo)*percent); + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGFloat endRadius = r * (kEndTo + (1-kEndTo)*percent) * (1+percent / 2); + UIBezierPath *path = [self bodyPath:startRadius + end:endRadius + percent:percent]; + [self setContext:context path:path]; + CGContextDrawPath(context, kCGPathFillStroke); + }else { + self.hidden = YES; + _state = SRSlimeStateMiss; + } + } + break; + default: + break; + } +} + +- (void)setContext:(CGContextRef)context path:(UIBezierPath *)path { + if (self.shadowColor) { + switch (self.shadowType) { + case SRSlimeBlurShadow: + CGContextSetShadowWithColor(context, CGSizeZero, self.shadowBlur, self.shadowColor.CGColor); + break; + case SRSlimeFillShadow: + CGContextAddPath(context, path.CGPath); + CGContextSetLineWidth(context, self.shadowBlur); + CGContextSetStrokeColorWithColor(context, self.shadowColor.CGColor); + CGContextDrawPath(context, kCGPathStroke); + break; + + default: + break; + } + } + CGContextSetFillColorWithColor(context, self.bodyColor.CGColor); + CGContextSetLineWidth(context, self.lineWith); + CGContextSetStrokeColorWithColor(context, self.skinColor.CGColor); + CGContextAddPath(context, path.CGPath); +} + +- (void)scaling +{ + if (_state == SRSlimeStateShortening) { +// self.toPoint = CGPointMake((_toPoint.x - _startPoint.x)*0.9 + _startPoint.x, +// (_toPoint.y - _startPoint.y)*0.9 + _startPoint.y); +// float p = distansBetween(_startPoint, _toPoint) / _viscous; +// self.layer.transform = CATransform3DMakeScale(p, p, 1); +// +// if (p > 0.01) { +// [self performSelector:@selector(scaling) +// withObject:nil +// afterDelay:kAnimationInterval +// inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]]; +// }else { +// self.hidden = YES; +// _state = SRSlimeStateMiss; +// } + [self setNeedsDisplay]; + [self performSelector:@selector(scaling) + withObject:nil + afterDelay:kAnimationInterval + inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]]; + } +} + +- (void)setPullApartTarget:(id)target action:(SEL)action +{ + _target = target; + _action = action; +} + +- (void)setHidden:(BOOL)hidden +{ + [super setHidden:hidden]; + if (!hidden) { + self.layer.transform = CATransform3DIdentity; + [self setNeedsDisplay]; + } +} + +- (void)setState:(SRSlimeState)state +{ + _state = state; + [NSObject cancelPreviousPerformRequestsWithTarget:self + selector:@selector(scaling) + object:nil]; +} + +@end diff --git a/Ash_AWord/ViewControllers/Chat/SlimeRefresh/sr_refresh.png b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/sr_refresh.png new file mode 100755 index 0000000..84ebca9 Binary files /dev/null and b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/sr_refresh.png differ diff --git a/Ash_AWord/ViewControllers/Chat/SlimeRefresh/sr_refresh@2X.png b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/sr_refresh@2X.png new file mode 100755 index 0000000..0bcb5e3 Binary files /dev/null and b/Ash_AWord/ViewControllers/Chat/SlimeRefresh/sr_refresh@2X.png differ diff --git a/Ash_AWord/ViewControllers/Login/LoginViewController.m b/Ash_AWord/ViewControllers/Login/LoginViewController.m index f76cfe3..9d88fe0 100644 --- a/Ash_AWord/ViewControllers/Login/LoginViewController.m +++ b/Ash_AWord/ViewControllers/Login/LoginViewController.m @@ -160,6 +160,7 @@ if ([loginViewModel success]) { [Ash_UIUtil EaseMobLoginWithUserName:loginViewModel.uId]; + [AWordUser sharedInstance].isLogin = YES; [AWordUser sharedInstance].loginType = 0; [AWordUser sharedInstance].uid = loginViewModel.uId; diff --git a/Ash_AWord/ViewControllers/Login/OurLoginViewController.m b/Ash_AWord/ViewControllers/Login/OurLoginViewController.m index 3b7be95..a866ea3 100644 --- a/Ash_AWord/ViewControllers/Login/OurLoginViewController.m +++ b/Ash_AWord/ViewControllers/Login/OurLoginViewController.m @@ -100,6 +100,7 @@ if ([loginViewModel success]) { [Ash_UIUtil EaseMobLoginWithUserName:loginViewModel.uId]; + [AWordUser sharedInstance].isLogin = YES; [AWordUser sharedInstance].loginType = 1; [AWordUser sharedInstance].uid = loginViewModel.uId; diff --git a/Ash_AWord/ViewControllers/Main/MainViewController.m b/Ash_AWord/ViewControllers/Main/MainViewController.m index 4d678fc..8117d23 100644 --- a/Ash_AWord/ViewControllers/Main/MainViewController.m +++ b/Ash_AWord/ViewControllers/Main/MainViewController.m @@ -10,11 +10,27 @@ #import "NoteViewController.h" #import "MessageViewController.h" #import "MyViewController.h" +#import +#import "ChatMainViewController.h" +#import "CallViewController.h" +#import "EMCDDeviceManager.h" +#import "AppDelegate.h" +@interface MainViewController () +{ + UINavigationController* _noteNav; + UINavigationController* _messageNav; + UINavigationController* _myNav; + EMConnectionState _connectionState; -@interface MainViewController () +} +@property (strong, nonatomic) NSDate *lastPlaySoundDate; @end +static const CGFloat kDefaultPlaySoundInterval = 10.0; +static NSString *kConversationChatter = @"ConversationChatter"; +static NSString *kMessageType = @"MessageType"; + @implementation MainViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil @@ -22,9 +38,9 @@ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization - UINavigationController* _noteNav = [[UINavigationController alloc] initWithRootViewController:[[NoteViewController alloc] init]]; - UINavigationController* _messageNav = [[UINavigationController alloc] initWithRootViewController:[[MessageViewController alloc] init]]; - UINavigationController* _myNav = [[UINavigationController alloc] initWithRootViewController:[[MyViewController alloc] init]]; + _noteNav = [[UINavigationController alloc] initWithRootViewController:[[NoteViewController alloc] init]]; + _messageNav = [[UINavigationController alloc] initWithRootViewController:[[MessageViewController alloc] init]]; + _myNav = [[UINavigationController alloc] initWithRootViewController:[[MyViewController alloc] init]]; if (iOS7AndLater) { [_noteNav setTabBarItem:[[UITabBarItem alloc] initWithTitle:@"遇见你" image:[UIImage imageNamed:@"tabbarQuotation-dark"] selectedImage:[UIImage imageNamed:@"tabbarQuotationClick"]]]; @@ -66,10 +82,542 @@ [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; + [[EaseMob sharedInstance].chatManager loadAllConversationsFromDatabaseWithAppend2Chat:YES]; + + //聊天用的 + //获取未读消息数,此时并没有把self注册为SDK的delegate,读取出的未读数是上次退出程序时的 +#warning 把self注册为SDK的delegate + [self registerNotifications]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callOutWithChatter:) name:@"callOutWithChatter" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callControllerClose:) name:@"callControllerClose" object:nil]; + + self.selectedIndex = 0; + +} +-(void)viewWillAppear:(BOOL)animated +{ + [super viewWillAppear:animated]; + //获取未读消息数,此时并没有把self注册为SDK的delegate,读取出的未读数是上次退出程序时的 + + [self didUnreadMessagesCountChanged]; + +} +#pragma mark - UIAlertViewDelegate + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (alertView.tag == 99) { + if (buttonIndex != [alertView cancelButtonIndex]) { + [[EaseMob sharedInstance].chatManager asyncLogoffWithUnbindDeviceToken:YES completion:^(NSDictionary *info, EMError *error) { +// [[ApplyViewController shareController] clear]; +// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_LOGINCHANGE object:@NO]; + } onQueue:nil]; + } + } + else if (alertView.tag == 100) { +// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_LOGINCHANGE object:@NO]; + } else if (alertView.tag == 101) { +// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_LOGINCHANGE object:@NO]; + } +} + +#pragma mark - private + +-(void)registerNotifications +{ + [self unregisterNotifications]; + + [[EaseMob sharedInstance].chatManager addDelegate:self delegateQueue:nil]; + [[EaseMob sharedInstance].callManager addDelegate:self delegateQueue:nil]; +} + +-(void)unregisterNotifications +{ + [[EaseMob sharedInstance].chatManager removeDelegate:self]; + [[EaseMob sharedInstance].callManager removeDelegate:self]; +} + + + + +// 统计未读消息数 +-(void)setupUnreadMessageCount +{ + NSArray *conversations = [[[EaseMob sharedInstance] chatManager] conversations]; + + NSInteger unreadCount = 0; + for (EMConversation *conversation in conversations) { + unreadCount += conversation.unreadMessagesCount; + } + if (_myNav) { + if (unreadCount > 0) { + _myNav.tabBarItem.badgeValue = [NSString stringWithFormat:@"%i",(int)unreadCount]; + }else{ + _myNav.tabBarItem.badgeValue = nil; + } + } + + UIApplication *application = [UIApplication sharedApplication]; + [application setApplicationIconBadgeNumber:unreadCount]; +} + + +- (void)networkChanged:(EMConnectionState)connectionState +{ + _connectionState = connectionState; +} + +#pragma mark - call + +- (BOOL)canRecord +{ + __block BOOL bCanRecord = YES; + AVAudioSession *audioSession = [AVAudioSession sharedInstance]; + if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending) + { + if ([audioSession respondsToSelector:@selector(requestRecordPermission:)]) { + [audioSession performSelector:@selector(requestRecordPermission:) withObject:^(BOOL granted) { + bCanRecord = granted; + }]; + } + } + + if (!bCanRecord) { + UIAlertView * alt = [[UIAlertView alloc] initWithTitle:@"未获得授权使用麦克风" message:@"请在iOS\"设置中\"-\"隐私\"-\"麦克风\"中打开" delegate:self cancelButtonTitle:nil otherButtonTitles:@"知道了", nil]; + [alt show]; + } + + return bCanRecord; +} + + +#pragma mark - IChatManagerDelegate 消息变化 + +- (void)didUpdateConversationList:(NSArray *)conversationList +{ + [self setupUnreadMessageCount]; +} + +// 未读消息数量变化回调 +-(void)didUnreadMessagesCountChanged +{ + [self setupUnreadMessageCount]; +} + +- (void)didFinishedReceiveOfflineMessages:(NSArray *)offlineMessages +{ + [self setupUnreadMessageCount]; +} + +- (void)didFinishedReceiveOfflineCmdMessages:(NSArray *)offlineCmdMessages +{ } +- (BOOL)needShowNotification:(NSString *)fromChatter +{ + BOOL ret = YES; + NSArray *igGroupIds = [[EaseMob sharedInstance].chatManager ignoredGroupIds]; + for (NSString *str in igGroupIds) { + if ([str isEqualToString:fromChatter]) { + ret = NO; + break; + } + } + + return ret; +} + +// 收到消息回调 +-(void)didReceiveMessage:(EMMessage *)message +{ + BOOL needShowNotification = (message.messageType != eMessageTypeChat) ? [self needShowNotification:message.conversationChatter] : YES; + if (needShowNotification) { +#if !TARGET_IPHONE_SIMULATOR + + BOOL isAppActivity = [[UIApplication sharedApplication] applicationState] == UIApplicationStateActive; + if (!isAppActivity) { + [self showNotificationWithMessage:message]; + }else { + [self playSoundAndVibration]; + } +#endif + } +} + +-(void)didReceiveCmdMessage:(EMMessage *)message +{ +// [self showHint:NSLocalizedString(@"receiveCmd", @"receive cmd message")]; +} + +- (void)playSoundAndVibration{ + NSTimeInterval timeInterval = [[NSDate date] + timeIntervalSinceDate:self.lastPlaySoundDate]; + self.lastPlaySoundDate = [NSDate date]; + + if (timeInterval < kDefaultPlaySoundInterval) { + //如果距离上次响铃和震动时间太短, 则跳过响铃 + NSLog(@"skip ringing & vibration %@, %@", [NSDate date], self.lastPlaySoundDate); + return; + } + + //保存最后一次响铃时间 + + UIViewController* viewController = [AppDelegate visibleViewController]; + if (![viewController isKindOfClass:[ChatMainViewController class]]) { + // 收到消息时,播放音频 + [[EMCDDeviceManager sharedInstance] playNewMessageSound]; + // 收到消息时,震动 + [[EMCDDeviceManager sharedInstance] playVibration]; + } + +} + +- (void)showNotificationWithMessage:(EMMessage *)message +{ + EMPushNotificationOptions *options = [[EaseMob sharedInstance].chatManager pushNotificationOptions]; + //发送本地推送 + UILocalNotification *notification = [[UILocalNotification alloc] init]; + notification.fireDate = [NSDate date]; //触发通知的时间 + + if (options.displayStyle == ePushNotificationDisplayStyle_messageSummary) { + id messageBody = [message.messageBodies firstObject]; + NSString *messageStr = nil; + switch (messageBody.messageBodyType) { + case eMessageBodyType_Text: + { + messageStr = ((EMTextMessageBody *)messageBody).text; + } + break; + case eMessageBodyType_Image: + { + messageStr = NSLocalizedString(@"message.image", @"Image"); + } + break; + case eMessageBodyType_Location: + { + messageStr = NSLocalizedString(@"message.location", @"Location"); + } + break; + case eMessageBodyType_Voice: + { + messageStr = NSLocalizedString(@"message.voice", @"Voice"); + } + break; + case eMessageBodyType_Video:{ + messageStr = NSLocalizedString(@"message.vidio", @"Vidio"); + } + break; + default: + break; + } + + NSString *title = @""; + if (message.ext) + { + title = [message.ext objectForKey:@"username"]; + } + if (message.messageType == eMessageTypeGroupChat) { + NSArray *groupArray = [[EaseMob sharedInstance].chatManager groupList]; + for (EMGroup *group in groupArray) { + if ([group.groupId isEqualToString:message.conversationChatter]) { + title = [NSString stringWithFormat:@"%@(%@)", message.groupSenderName, group.groupSubject]; + break; + } + } + } + else if (message.messageType == eMessageTypeChatRoom) + { + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + NSString *key = [NSString stringWithFormat:@"OnceJoinedChatrooms_%@", [[[EaseMob sharedInstance].chatManager loginInfo] objectForKey:@"username" ]]; + NSMutableDictionary *chatrooms = [NSMutableDictionary dictionaryWithDictionary:[ud objectForKey:key]]; + NSString *chatroomName = [chatrooms objectForKey:message.conversationChatter]; + if (chatroomName) + { + title = [NSString stringWithFormat:@"%@(%@)", message.groupSenderName, chatroomName]; + } + } + + notification.alertBody = [NSString stringWithFormat:@"%@:%@", title, messageStr]; + } + else{ + notification.alertBody = NSLocalizedString(@"receiveMessage", @"you have a new message"); + } + +#warning 去掉注释会显示[本地]开头, 方便在开发中区分是否为本地推送 + //notification.alertBody = [[NSString alloc] initWithFormat:@"[本地]%@", notification.alertBody]; + + notification.alertAction = NSLocalizedString(@"open", @"Open"); + notification.timeZone = [NSTimeZone defaultTimeZone]; + notification.soundName = UILocalNotificationDefaultSoundName; + + NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; + [userInfo setObject:[NSNumber numberWithInt:message.messageType] forKey:kMessageType]; + [userInfo setObject:[message.ext objectForKey:@"username"] forKey:kConversationChatter]; + + notification.userInfo = userInfo; + + //发送通知 + [[UIApplication sharedApplication] scheduleLocalNotification:notification]; + UIApplication *application = [UIApplication sharedApplication]; + DLog(@"%ld",application.applicationIconBadgeNumber); + application.applicationIconBadgeNumber += 1; +} + + + + + +#pragma mark - IChatManagerDelegate 登录状态变化 +- (void)didLoginWithInfo:(NSDictionary *)loginInfo error:(EMError *)error +{ + [self setupUnreadMessageCount]; +} +- (void)didLoginFromOtherDevice +{ + [[EaseMob sharedInstance].chatManager asyncLogoffWithUnbindDeviceToken:NO completion:^(NSDictionary *info, EMError *error) { + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt", @"Prompt") message:NSLocalizedString(@"loginAtOtherDevice", @"your login account has been in other places") delegate:self cancelButtonTitle:NSLocalizedString(@"ok", @"OK") otherButtonTitles:nil, nil]; + alertView.tag = 100; + [alertView show]; + + } onQueue:nil]; +} + +- (void)didRemovedFromServer +{ + [[EaseMob sharedInstance].chatManager asyncLogoffWithUnbindDeviceToken:NO completion:^(NSDictionary *info, EMError *error) { + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt", @"Prompt") message:NSLocalizedString(@"loginUserRemoveFromServer", @"your account has been removed from the server side") delegate:self cancelButtonTitle:NSLocalizedString(@"ok", @"OK") otherButtonTitles:nil, nil]; + alertView.tag = 101; + [alertView show]; + } onQueue:nil]; +} + +#pragma mark - 自动登录回调 + +- (void)willAutoReconnect{ + [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; + [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.ongoing", @"reconnecting...") hidesAfter:1.0]; +// [self hideHud]; +// [self showHint:NSLocalizedString(@"reconnection.ongoing", @"reconnecting...")]; +} + +- (void)didAutoReconnectFinishedWithError:(NSError *)error{ +// [self hideHud]; + [MBProgressHUD hideAllHUDsForView:self.view animated:YES]; + + if (error) { + [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.fail", @"reconnection failure, later will continue to reconnection") hidesAfter:1.0]; + }else{ + [MBProgressHUD checkHudWithView:self.view label:NSLocalizedString(@"reconnection.success", @"reconnection successful!") hidesAfter:1.0]; + } +} + +#pragma mark - ICallManagerDelegate + +- (void)callSessionStatusChanged:(EMCallSession *)callSession changeReason:(EMCallStatusChangedReason)reason error:(EMError *)error +{ + if (callSession.status == eCallSessionStatusConnected) + { + EMError *error = nil; + do { + BOOL isShowPicker = [[[NSUserDefaults standardUserDefaults] objectForKey:@"isShowPicker"] boolValue]; + if (isShowPicker) { + error = [EMError errorWithCode:EMErrorInitFailure andDescription:@"不能进行通话"]; + break; + } + + if (![self canRecord]) { + error = [EMError errorWithCode:EMErrorInitFailure andDescription:@"不能进行通话"]; + break; + } + +#warning 在后台不能进行视频通话 + if(callSession.type == eCallSessionTypeVideo && ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground || ![CallViewController canVideo])){ + error = [EMError errorWithCode:EMErrorInitFailure andDescription:@"不能进行视频通话"]; + break; + } + + if (!isShowPicker){ + [[EaseMob sharedInstance].callManager removeDelegate:self]; + CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:YES withName:@"" withAvatar:@""]; + callController.modalPresentationStyle = UIModalPresentationOverFullScreen; + [self presentViewController:callController animated:NO completion:nil]; + } + } while (0); + + if (error) { + [[EaseMob sharedInstance].callManager asyncEndCall:callSession.sessionId reason:eCallReason_Hangup]; + return; + } + } +} +- (void)callOutWithChatter:(NSNotification *)notification +{ + id object = notification.object; + if ([object isKindOfClass:[NSDictionary class]]) { + if (![self canRecord]) { + return; + } + + EMError *error = nil; + NSString *chatter = [object objectForKey:@"chatter"]; + EMCallSessionType type = [[object objectForKey:@"type"] intValue]; + NSString* username = [object objectForKey:@"username"]; + NSString* useravatar = [object objectForKey:@"useravatar"]; + EMCallSession *callSession = nil; + if (type == eCallSessionTypeAudio) { + callSession = [[EaseMob sharedInstance].callManager asyncMakeVoiceCall:chatter timeout:50 error:&error]; + } + else if (type == eCallSessionTypeVideo){ + if (![CallViewController canVideo]) { + return; + } + callSession = [[EaseMob sharedInstance].callManager asyncMakeVideoCall:chatter timeout:50 error:&error]; + } + + if (callSession && !error) { + [[EaseMob sharedInstance].callManager removeDelegate:self]; + + CallViewController *callController = [[CallViewController alloc] initWithSession:callSession isIncoming:NO withName:username withAvatar:useravatar]; + callController.modalPresentationStyle = UIModalPresentationOverFullScreen; + [self presentViewController:callController animated:NO completion:nil]; + } + + if (error) { + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"error", @"error") message:error.description delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", @"OK") otherButtonTitles:nil, nil]; + [alertView show]; + } + } +} + +- (void)callControllerClose:(NSNotification *)notification +{ + // AVAudioSession *audioSession = [AVAudioSession sharedInstance]; + // [audioSession setCategory:AVAudioSessionCategoryPlayback error:nil]; + // [audioSession setActive:YES error:nil]; + + [[EaseMob sharedInstance].callManager addDelegate:self delegateQueue:nil]; +} +#pragma mark - public + +- (void)jumpToChatList +{ + if ([self.navigationController.topViewController isKindOfClass:[ChatMainViewController class]]) { + ChatMainViewController *chatController = (ChatMainViewController *)self.navigationController.topViewController; +// [chatController hideImagePicker]; + } + else if(_myNav) + { + [self.navigationController popToViewController:self animated:NO]; + [self setSelectedViewController:_myNav]; + } +} + +- (EMConversationType)conversationTypeFromMessageType:(EMMessageType)type +{ + EMConversationType conversatinType = eConversationTypeChat; + switch (type) { + case eMessageTypeChat: + conversatinType = eConversationTypeChat; + break; + case eMessageTypeGroupChat: + conversatinType = eConversationTypeGroupChat; + break; + case eMessageTypeChatRoom: + conversatinType = eConversationTypeChatRoom; + break; + default: + break; + } + return conversatinType; +} + +- (void)didReceiveLocalNotification:(UILocalNotification *)notification +{ + NSDictionary *userInfo = notification.userInfo; + if (userInfo) + { + if ([self.navigationController.topViewController isKindOfClass:[ChatMainViewController class]]) { + ChatMainViewController *chatController = (ChatMainViewController *)self.navigationController.topViewController; +// [chatController hideImagePicker]; + } + + NSArray *viewControllers = self.navigationController.viewControllers; + [viewControllers enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(id obj, NSUInteger idx, BOOL *stop){ + if (obj != self) + { + if (![obj isKindOfClass:[ChatMainViewController class]]) + { + [self.navigationController popViewControllerAnimated:NO]; + } + else + { +// NSString *conversationChatter = userInfo[kConversationChatter]; +// ChatMainViewController *chatViewController = (ChatMainViewController *)obj; +// if (![chatViewController.chatter isEqualToString:conversationChatter]) +// { +// [self.navigationController popViewControllerAnimated:NO]; +// EMMessageType messageType = [userInfo[kMessageType] intValue]; +// chatViewController = [[ChatViewController alloc] initWithChatter:conversationChatter conversationType:[self conversationTypeFromMessageType:messageType]]; +// switch (messageType) { +// case eMessageTypeGroupChat: +// { +// NSArray *groupArray = [[EaseMob sharedInstance].chatManager groupList]; +// for (EMGroup *group in groupArray) { +// if ([group.groupId isEqualToString:conversationChatter]) { +// chatViewController.title = group.groupSubject; +// break; +// } +// } +// } +// break; +// default: +// chatViewController.title = conversationChatter; +// break; +// } +// [self.navigationController pushViewController:chatViewController animated:NO]; +// } +// *stop= YES; + } + } + else + { +// ChatViewController *chatViewController = (ChatViewController *)obj; +// NSString *conversationChatter = userInfo[kConversationChatter]; +// EMMessageType messageType = [userInfo[kMessageType] intValue]; +// chatViewController = [[ChatViewController alloc] initWithChatter:conversationChatter conversationType:[self conversationTypeFromMessageType:messageType]]; +// switch (messageType) { +// case eMessageTypeGroupChat: +// { +// NSArray *groupArray = [[EaseMob sharedInstance].chatManager groupList]; +// for (EMGroup *group in groupArray) { +// if ([group.groupId isEqualToString:conversationChatter]) { +// chatViewController.title = group.groupSubject; +// break; +// } +// } +// } +// break; +// default: +// chatViewController.title = conversationChatter; +// break; +// } +// [self.navigationController pushViewController:chatViewController animated:NO]; + } + }]; + } + else if (_myNav) + { + [self.navigationController popToViewController:self animated:NO]; + [self setSelectedViewController:_myNav]; + } +} + +- (void)dealloc +{ + [self unregisterNotifications]; +} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/Ash_AWord/ViewControllers/My/PersonalInfoViewController.m b/Ash_AWord/ViewControllers/My/PersonalInfoViewController.m index cb3cb91..34edd42 100644 --- a/Ash_AWord/ViewControllers/My/PersonalInfoViewController.m +++ b/Ash_AWord/ViewControllers/My/PersonalInfoViewController.m @@ -328,6 +328,7 @@ ChatMainViewController* chatMainViewController = [[ChatMainViewController alloc] init]; chatMainViewController.otherUserAvatar = _userViewModel.userInfo.figureurl; chatMainViewController.otherUserName = _userViewModel.userInfo.name; + chatMainViewController.otherUserId = _otherUserId; [self.navigationController pushViewController:chatMainViewController animated:YES]; } @end diff --git a/Ash_AWord/ViewControllers/My/SetUpViewController.m b/Ash_AWord/ViewControllers/My/SetUpViewController.m index 6e855c7..e35f37a 100644 --- a/Ash_AWord/ViewControllers/My/SetUpViewController.m +++ b/Ash_AWord/ViewControllers/My/SetUpViewController.m @@ -197,10 +197,17 @@ if (buttonIndex == 1 &&alertView.tag == 101) { [MobClick event:kUmen_logout]; - [AWordUser sharedInstance].isLogin = NO; - [AWordUser sharedInstance].uid = @""; - [[NSNotificationCenter defaultCenter] postNotificationName:kLogoutSuccessNotificationName object:nil]; - [self.navigationController popViewControllerAnimated:YES]; + [[EaseMob sharedInstance].chatManager asyncLogoffWithUnbindDeviceToken:NO completion:^(NSDictionary *info, EMError *error) { + if (!error && info) { + + } + [AWordUser sharedInstance].isLogin = NO; + [AWordUser sharedInstance].uid = @""; + [[NSNotificationCenter defaultCenter] postNotificationName:kLogoutSuccessNotificationName object:nil]; + [self.navigationController popViewControllerAnimated:YES]; + DLog(@"退出成功"); + } onQueue:nil]; + } if(buttonIndex == 1 && alertView.tag == 102){ [MBProgressHUD hudWithView:nil label:@"清除缓存中"];