Showing: 71 - 80 of 137 Articles

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, …

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` — …

Parse Your BLE Peripheral Device Characteristic in HEX String

#pragma mark – Peripheral Delegates – (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error { if (error) NSLog(@”Error reading BLE data: %@”,[error localizedDescription]); else [self parseBLEMessage:characteristic.value]; } – (void)parseBLEMessage:(NSData*)pobjData { NSData *objData = pobjData; NSString *strValue = [getHexString:objdata]; } -(NSString*)getHexString:(NSData*)pdata { NSMutableString *sbuf; NSUInteger capacity = self.length …