Skip to content

Commit 3688a93

Browse files
pushpsenairekar2911pushpsenairekar2911
authored andcommitted
v3.0.5-a
1 parent 4a4b3f8 commit 3688a93

File tree

13 files changed

+44
-8
lines changed

13 files changed

+44
-8
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Please note we have a code of conduct, please follow it in all your interactions
77

88

99

10+
1011
## Pull Request Process
1112

1213
1. Ensure any install or build dependencies are removed before the end of the layer when doing a

CometChatObjc/CometChatObjc.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 50;
77
objects = {
88

99
/* Begin PBXBuildFile section */

CometChatObjc/CometChatObjc/Info.plist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
</array>
5252
</dict>
5353
</dict>
54+
<key>UIBackgroundModes</key>
55+
<array>
56+
<string>fetch</string>
57+
<string>processing</string>
58+
<string>voip</string>
59+
</array>
5460
<key>UILaunchStoryboardName</key>
5561
<string>LaunchScreen</string>
5662
<key>UIMainStoryboardFile</key>

CometChatObjc/CometChatObjc/Library/UI Components/Chats/Conversation List/CometChatConversationList.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,24 @@ public final class CometChatConversationList: UIViewController {
6161
self.refreshConversations()
6262
self.setupNavigationBar()
6363
self.setupSearchBar()
64+
self.addObservers()
6465
}
6566

66-
67+
68+
fileprivate func addObservers() {
69+
NotificationCenter.default.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
70+
}
71+
72+
fileprivate func removeObservers() {
73+
NotificationCenter.default.removeObserver(self, name: UIApplication.willEnterForegroundNotification, object: nil)
74+
75+
}
76+
77+
@objc func appMovedToForeground() {
78+
if !CometChat.backgroundTaskEnabled() {
79+
self.refreshConversations()
80+
}
81+
}
6782

6883
public override func viewWillAppear(_ animated: Bool) {
6984
self.setupDelegates()

CometChatObjc/CometChatObjc/Library/UI Components/Messages/Message Bubbles/Location Message/CometChatSenderLocationMessageBubble.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class CometChatSenderLocationMessageBubble: UITableViewCell {
6060
self.reactionView.isHidden = true
6161
}
6262
}
63-
if let data = locationMessage.customData , let latitude = data["latitude"] as? Double, let longitude = data["longitude"] as? Double{
63+
if let latitude = data["latitude"] as? Double, let longitude = data["longitude"] as? Double{
6464

6565
if let url = self.getMapFromLocatLon(from: latitude, and: longitude, googleApiKey: UIKitSettings.googleApiKey) {
6666
map.cf.setImage(with: url, placeholder: UIImage(named: "location-map.png", in: UIKitSettings.bundle, compatibleWith: nil))

CometChatObjc/CometChatObjc/Library/UI Components/Messages/Message List/CometChatMessageList.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,18 @@ public class CometChatMessageList: UIViewController, AVAudioRecorderDelegate, AV
756756
NotificationCenter.default.addObserver(self, selector:#selector(self.didUserUnblocked(_:)), name: NSNotification.Name(rawValue: "didUserUnblocked"), object: nil)
757757
NotificationCenter.default.addObserver(self, selector:#selector(self.didGroupDeleted(_:)), name: NSNotification.Name(rawValue: "didGroupDeleted"), object: nil)
758758
NotificationCenter.default.addObserver(self, selector:#selector(self.didThreadDeleted(_:)), name: NSNotification.Name(rawValue: "didThreadDeleted"), object: nil)
759+
NotificationCenter.default.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
760+
761+
}
762+
763+
@objc func appMovedToForeground() {
764+
if !CometChat.backgroundTaskEnabled() {
765+
if let user = currentUser?.uid {
766+
self.refreshMessageList(forID: user, type: .user, scrollToBottom: true)
767+
}else if let group = currentGroup?.guid {
768+
self.refreshMessageList(forID: group, type: .group, scrollToBottom: true)
769+
}
770+
}
759771
}
760772

761773
private func removeObservers() {
@@ -765,7 +777,7 @@ public class CometChatMessageList: UIViewController, AVAudioRecorderDelegate, AV
765777
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: "didUserUnblocked"), object: nil)
766778
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: "didGroupDeleted"), object: nil)
767779
NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: "didThreadDeleted"), object: nil)
768-
780+
NotificationCenter.default.removeObserver(self, name: UIApplication.willEnterForegroundNotification, object: nil)
769781
NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillChangeFrameNotification, object: nil)
770782
}
771783

CometChatObjc/Podfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ platform :ios, '11.0'
22
use_frameworks!
33

44
target 'CometChatObjc' do
5-
pod 'CometChatPro', '3.0.3'
6-
pod 'CometChatCalls', '2.1.1'
7-
5+
pod 'CometChatPro', '3.0.5'
6+
pod 'CometChatCalls', '2.1.1'
87
end

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<a href=""><img src="https://img.shields.io/badge/Repo%20Size-15.6%20MB-brightgreen" /></a>
1818
<a href=""> <img src="https://img.shields.io/badge/Contributors-5-yellowgreen" /></a>
19-
<a href=" "> <img src="https://img.shields.io/badge/Version-3.0.3--1-red" /></a>
19+
<a href=" "> <img src="https://img.shields.io/badge/Version-3.0.5--1-red" /></a>
2020
<a href=""> <img src="https://img.shields.io/github/stars/cometchat-pro/ios-objective-c-chat-app?style=social" /></a>
2121
<a href=""> <img src="https://img.shields.io/twitter/follow/cometchat?style=social" /></a>
2222

RealtimeCallEvents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Since, swift supports extension for AppDelegate, we have managed it for Swift. But if you're using Objective C then you've to add necessory events manually inside your project.
55
___
66

7+
78
## Step 1:
89

910
- Open `AppDelegate.h` file.

0 commit comments

Comments
 (0)