Sparkweb is web-based XMPP client used to connect to your XMPP server like Openfire. To install and configure sparkweb first of all you must have your openfire server installed and running successfully to achieve the goal. It can be used to test chat functionality, in Web browser. Sparkweb …
Get typing status of EditText in Android
You can determine whether the user is typing or not you have to create one CustomEditText class which extends to EditText. This type of functionality is widely used in Chat application. Here is a snippet of CustomEditText public class CustomTypingEditText extends CustomEditTextNormal implements TextWatcher { …
Firebase customise notification when app is in background or killed
Firebase will not call your onMessageReceived when your app is in background or killed, and you can’t customise your notification. System generated notification will show. to make firebase library to call your onMessageReived in every cases a) Foreground b) Background c) Killed you must not …
Defining item click listener for RecyclerView in Android
Android RecyclerView doesn’t come with the Item Click Listener that you have with ListView. You will have to implement the item clicke listener yourself. Below link have an example of how to implement the view holder item clicker listener in RecyclerView. In a nutshell, The Activity …
Read facebook and phone contacts with permission
Contact typealias CheckContactPermission = (Bool,ABAddressBook?) -> () func checkcontactpermission(pCompletionBlock:CheckContactPermission){ // make sure user hadn’t previously denied access let status = ABAddressBookGetAuthorizationStatus() if status == .Denied || status == .Restricted { // Helper.showAlert(ALERTCONTACTPERMISIONDNIED, pobjView: self.view) // user previously denied, so tell them to fix that in …
Get color of CGPoint from image in UIImageView
Method for fetching color of CGPoint from image in UIImageView :- extension UIImageView { func getColorOfPoint(_ point:CGPoint)->UIColor { var pixel:[CUnsignedChar] = [0,0,0,0] let colorSpace = CGColorSpaceCreateDeviceRGB() let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.premultipliedLast.rawValue) let context = CGContext(data: &pixel, width: 1, height: 1, bitsPerComponent: 8, bytesPerRow: 4, space: colorSpace, …
Extension for Dictionary
Get Dictionary after removing all null values :- extension Dictionary where Value: Any { func nullsRemoved() -> Dictionary { var dicOriginal = self let keysToRemove = Array(dicOriginal.keys).filter { dicOriginal[$0] is NSNull } for key in keysToRemove { dicOriginal.removeValue(forKey: key) } return dicOriginal } } …
Openfire : Sending Push Notifications while recipient is offline
Problem : Sometimes push notifications are not sent while the recipient is offline. Chat Server : Openfire v4.0.4 Plugin : callbackonoffline Direct Download Link : https://www.igniterealtime.org/projects/openfire/plugins/callbackOnOffline.jar Readme.html : https://www.igniterealtime.org/projects/openfire/plugins-beta/callbackonoffline/readme.html Solution * To store messages, while the recipient is offline : Trigger — — Triggers `ofOffline` — …
Get Date Difference between two dates
Method to get difference between two dates :- ex :- static func getDateDifferenceforDate(_ pobjFirstDate: Date, andDate pobjLastDate: Date) -> String { var strTime: String let distanceBetweenDates: TimeInterval = pobjLastDate.timeIntervalSince(pobjFirstDate) let secondsInAnHour: Double = 3600 …
Animate app logo as as like instagram on home screen
To overcome I have made custom code to implement this follow below code: private var lastContentOffset: CGFloat = CGFloat(kInt0) var intScrollLogo: CGFloat = CGFloat(kInt0) @IBOutlet weak var viewNavigationHeightConstraint: NSLayoutConstraint! let kInt0 = 0 let kInt1 = 1 let kInt64 = 64 let kInt22 = 22 …