저는 상점이 열렸을 때 사용자에게 알려주는 앱을 프로그래밍하고 작업하는 것이 매우 쉽습니다. firebase를 사용하여 데이터를 저장하고 있으며 푸시하기보다는 로컬 알림을 사용하려고합니다.Firebase를 사용하는 로컬 알림
알림을 보내기 위해 일부 온라인 소스에 따라 앱 위임을 설정했지만 기능을 호출하는 방법을 잘 모르겠습니다. Xcode에서 신속한 4를 사용하고 있습니다.
import Firebase
var refNotificationValue = DatabaseReference!
@IBAction func openButtonClicked(_ sender: UIButton) {
// Alert Controller confirming actions
self.shouldSendNotification()
}
// DidLoad()
refNotificationValue = database.database().reference().child("Notifications").child("enabled") // set to yes
// EndLoad()
func shouldSendNotification() {
refNotificationValue?.observeSingleEvent(of: .value, with: { (snapshot) in
let dict = snapshot.value as! [String: Any]
let status = dict["enabled"] as! String
if status == "yes" {
setToOpen()
sendNotification()
} else {
setToOpen()
}
})
}
func sendNotification() {
????????
}
미리 감사드립니다.
감사합니다. 두 번째 방법으로 나열한대로 배경 가져 오기 작업했습니다. –
Wonderful! 해피 내가 도와 줄 수 =) –
더스틴, 여기서 개인적으로 메시지를 보내는 방법이 있습니까? 나는 정말로 도움이 될 수 있고 한 달 동안 붙어있다. 고마워요. –