我正在使用Firebase消息传递通知,以使用Node.js和npm包firebase-admin@6.0.0向我的react native android应用发送通知。通知会正常到达,并且自定义声音在旧版本的Android中可以使用,但是自定义通知声音在Android Oreo中无法播放。
https://firebase.google.com/docs/reference/admin/node/admin.messaging.AndroidNotification上的文档将声音属性提到为“设备收到通知时要播放的声音的文件名”。它没有提及此功能已被弃用,因此假设它必须仍可在Android O上正常工作吗?
Alamofire.upload(multipartFormData: { (multipartFormData) in
multipartFormData.append(imageData, withName: "profileImage", fileName: "image.png", mimeType: "image/jpg")
}, usingThreshold: UInt64.init(), to: requestURL, method: .post, headers: headers) { (result) in
switch result {
case .success(let upload, _, _):
upload.responseJSON { response in
if let error = response.error {
completionBlock(.failure(error as NSError))
return
}
completionBlock(.success(response))
}
case .failure(let error):
completionBlock(.failure(error as NSError))
}
}