当 Firebase 回调时是否有可能触发本地通知?我猜我的线程有问题,
[Firebase setDispatchQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)];
您可以按如下方式实现上述功能。
1 ) observeEventType
当发生任何变化时调用方法firebase database
2)实施observeEventType
方法如下。
// Below statement is point to your database.
let ref = FIRDatabase.database().reference()
ref.observeEventType(.Value,withBlock:{ (snapshot) -> Void in
print(snapshot.value)
// Put your local notification code here...
})
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)