I have been struggling with this for a while. But I am messing around with remote notifications and I honestly can't seem to figure out a way to bold the first line in the notification. This is my code
let boldUser = backendless!.userService.currentUser.name!
let string: NSString = "\(boldUser) \nMessage: \(message)" as NSString
let attributedString = NSMutableAttributedString(string: string as String, attributes: [NSFontAttributeName:UIFont.systemFont(ofSize: 15.0)])
let boldFontAttribute = [NSFontAttributeName: UIFont.boldSystemFont(ofSize: 15.0)]
// Part of string to be bold
attributedString.addAttributes(boldFontAttribute, range: string.range(of: "\(boldUser)" as String))
publishOptions.assignHeaders(["ios-alert" : "\(string)", "ios-badge" : "\(counter)", "ios-sound" : "message_tone_3.mp3"])
I don't get why this is not working. From my knowledge, I am doing everything right, but when Im testing, none of the notification is bold at all. I am trying to get the first line bolded.