//package com.base.pdfviewerscannerwhite.ads
//
//import com.base.pdfviewerscannerwhite.utils.AppPreferences
//import com.base.pdfviewerscannerwhite.utils.LogEx
//import com.google.firebase.database.DataSnapshot
//import com.google.firebase.database.DatabaseError
//import com.google.firebase.database.ValueEventListener
//import com.google.firebase.database.ktx.database
//import com.google.firebase.ktx.Firebase
//
////Realtime Database
//object FirebaseDatabase {
//
//    private val TAG = "FirebaseDatabase"
//
//    // Write a message to the database
//    val database = Firebase.database
//    var rootRef = database.reference
//
//
//
//    fun saveDatabase2Sp() {
////        add(open_limit_request, "15")
////        add(open_limit_show, "10")
////        add(open_limit_click, "1")
////
////
////        add(inter_limit_request, "15")
////        add(inter_limit_show, "10")
////        add(inter_limit_click, "1")
////
////        add(native_limit_request, "15")
////        add(native_limit_show, "10")
////        add(native_limit_click, "1")
////
////        add(popup_count, "0")
////        add(popup_status, "1")
////
////        add(popup_style1_start, "7")
////        add(popup_style1_end, "11")
////        add(popup_style1_count, "0")
////        add(popup_style1_status, "1")
////        add(popup_style1_interval, "120")
////
////        add(popup_style2_start, "12")
////        add(popup_style2_end, "17")
////        add(popup_style2_count, "0")
////        add(popup_style2_status, "1")
////        add(popup_style2_interval, "120")
////
////        add(popup_style3_start, "18")
////        add(popup_style3_end, "24")
////        add(popup_style3_count, "0")
////        add(popup_style3_status, "1")
////        add(popup_style3_interval, "120")
////
////        add(showLanPage, "1")
////
////        add(open_ad_loading, "8000")
////        add(create_pdf_loading, "8000")
////        add(delete_loading, "8000")
////        add(open_file_loading, "8000")
////        add(merge_loading, "8000")
////        add(split_loading, "8000")
////
////        add(ad_request_period, "1")
////        add(ad_period_max_request, "10")
////        add(ad_request_period_interval, "60")
//
//
//        rootRef.addListenerForSingleValueEvent(object : ValueEventListener {
//            override fun onDataChange(dataSnapshot: DataSnapshot) {
//                var i = 0
//                for (snapshot in dataSnapshot.getChildren()) {
//                    val key1 = snapshot.key
//                    val value1 = snapshot.value
//                    i++
//                    LogEx.logDebug("Database", "Key: $key1, Value: $value1 $i")
//                    AppPreferences.getInstance().put(key1, value1)
//                }
//            }
//
//            override fun onCancelled(databaseError: DatabaseError) {
//                LogEx.logDebug("Database", "onCancelled")
//            }
//        })
//
//    }
//
//    fun add(ref: String, value: String) {
//        database.getReference(ref).setValue(value)
//    }
//
//
//}