как следует уведомить клиента о том, что мастер отключен. И как интегрировать пользовательский интерфейс видеозвонка, аналогичный Whatsapp. Кто-нибудь может предложить лучшее решение?
неудобства с видеозвонком. Agora.io. лучшее решение?
Ответы (1)
это будет частью логики вашего приложения. есть несколько способов реализовать это, но один из способов сделать это - посмотреть, запускает ли конкретный пользователь приложение на переднем плане, и зарегистрировать это как флаг в вашей базе данных.
Например, здесь используется Firebase:
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
// user is offline
let ref = Database.database().reference.child("isOnline").child(user)
ref.setValue(false) // NO
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
let ref = Database.database().reference.child("isOnline").child(user)
ref.setValue(true) // YES
}
Пользовательский интерфейс видеозвонка можно легко настроить с помощью одного из интерфейсов, включенных в демонстрационных приложений Agora.io. >
person
Sidharth Sharma
schedule
07.08.2018