//
//  FlutterConstants.swift
//  Runner
//
//  Created by ZiKambrani on 22/12/2020.
//

import UIKit

class FlutterConstants{
    static var LOG_GEOFENCE_URL:String?
    static var WIFI_CREDENTIALS_URL:String?
    static var DEFAULT_HTTP_PARAMS:[String:Any?]?
    
    class func set(){
        
        // (FiX) Take a start with FlutterMethodChannel (kikstart)
        /* First call to flutter method is not returning the correct value (Always returning 'NSObject') then after it wroking fine and returning correct value*/
        FlutterText.with(key: "test") { (test) in
            
            flutterMethodChannel?.invokeMethod("getDefaultHttpParameters", arguments: nil){ (response) in
                if let defaultHTTPParams = response as? [String:Any?]{
                    DEFAULT_HTTP_PARAMS = defaultHTTPParams
                }
                
            }
            
            flutterMethodChannel?.invokeMethod("getLogGeofenceFullUrl", arguments:nil){ (response) in
                if let url = response as? String{
                    LOG_GEOFENCE_URL = url
                }
            }
            
        }
    }
}
