  */
 
 
+
 public struct PushyConf{
     fileprivate let host:String
     fileprivate let port:UInt16
+    fileprivate let regUrl:String
     fileprivate let deviceId:String
     fileprivate let clientId:String
+    fileprivate let langType:UInt8
     fileprivate let user:String?
     fileprivate let pass:String?
     fileprivate let isSSL:Bool
     fileprivate let certName:String?
     fileprivate let certPass:String?
-    
-    public init(host:String,port:UInt16,deviceId:String,clientId client:String,
+
+    
+    public init(host:String,port:UInt16,registrationUrl regUrl:String,deviceId:String,
+                clientId client:String, langType:UInt8 = 1,
          user:String? = nil,password pass:String? = nil,
          isSSL:Bool=false,certificateName certName:String? = nil,
          certificatePassword certPass:String? = nil){
         
         self.host       = host;
         self.port       = port;
+        self.regUrl     = regUrl;
         self.deviceId   = deviceId;
         self.clientId   = client;
+        self.langType   = langType;
         self.user       = user;
         self.pass       = pass;
         self.isSSL      = isSSL;
         self.certName   = certName;
         self.certPass   = certPass;
+
         
     }
 }

        }
    
    func updateDeviceId(deviceId:String,clientId:String,host:String, callback:@escaping (PushyClient.Status)->Void) throws{
        let scheme = conf.isSSL ? "https":"http"
        guard let connUrl =  URL(string: "\(scheme)://\(host)/\(self.urlSuffix)") else{
            
            throw PushyError.malformedUrl(reason: "\(host) is invalid")
        }

            callback(.down)
        }else{
            var request = URLRequest(url: connUrl, cachePolicy: URLRequest.CachePolicy.reloadIgnoringCacheData, timeoutInterval:TimeInterval(120))
            let payload:[String: Any] = ["clientId": clientId, "deviceId": deviceId, "appId":self.conf.user ?? "x","osType":2, "langType":1]
            let payloadJson = try! JSONSerialization.data(withJSONObject: payload)
    
            request.httpMethod = "POST"
            request.httpBody = payloadJson
            request.addValue("application/json", forHTTPHeaderField: "Content-Type")
            request.addValue("\(self.conf.user ?? ""):\(self.conf.pass ?? "")".toBase64(), forHTTPHeaderField: "PSY-CLIENT-TOKEN")
            
            let task = URLSession.shared.dataTask(with: request){
                data,response,error in
