<commit_before>//
//  UIAppDelegate+Notification.swift
//  HKKit
//
//  Created by <NAME> on 01/08/17.
//  Copyright © 2017 Hardik. All rights reserved.
//

import Foundation
import UserNotifications


public class HKNotificaitonManager: UIResponder, UNUserNotificationCenterDelegate {
    
    
    typealias clouserforRegister = (String?,Error?)->Swift.Void
    public typealias clouserforReceive = (Any)->Swift.Void
    public typealias clouserforPresent = (Any)->Swift.Void

    var didRegister:clouserforRegister?
    
    public var didRecieve:clouserforReceive?
    public var willPresent:clouserforPresent?

    public var deviceToken:String = ""
    static var `default`:HKMain {
    
        return HKMain()
    }
    
    
    func registerForRemoteNotificaiton(handler: @escaping(clouserforRegister)){
        
        self.didRegister = handler
        if #available(iOS 10.0, *) {
            UNUserNotificationCenter.current().delegate = self
            UNUserNotificationCenter.current().requestAuthorization(options: [.sound, .alert, .badge]) {
                (granted, error) in
                if (granted) {
                    UIApplication.shared.registerForRemoteNotifications()
                }
            }
            
        } else {
            UIApplication.shared.registerUserNotificationSettings(UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: nil))
            UIApplication.shared.registerForRemoteNotifications()
        }
    }
    <commit_msg>Changes<commit_after>//
//  UIAppDelegate+Notification.swift
//  HKKit
//
//  Created by <NAME> on 01/08/17.
//  Copyright © 2017 Hardik. All rights reserved.
//

import Foundation
import UserNotifications


public class HKNotificaitonManager: UIResponder, UNUserNotificationCenterDelegate {
    
    
    typealias clouserforRegister = (String?,Error?)->Swift.Void
    public typealias clouserforReceive = (Any)->Swift.Void
    public typealias clouserforPresent = (Any)->Swift.Void

    var didRegister:clouserforRegister?
    
    public var didRecieve:clouserforReceive?
    public var willPresent:clouserforPresent?

    public var deviceToken:String = ""
    static var `default`:HKNotificaitonManager {
    
        return HKNotificaitonManager()
    }
    
    
    func registerForRemoteNotificaiton(handler: @escaping(clouserforRegister)){
        
        self.didRegister = handler
        if #available(iOS 10.0, *) {
            UNUserNotificationCenter.current().delegate = self
            UNUserNotificationCenter.current().requestAuthorization(options: [.sound, .alert, .badge]) {
                (granted, error) in
                if (granted) {
                    UIApplication.shared.registerForRemoteNotifications()
                }
            }
            
        } else {
            UIApplication.shared.registerUserNotificationSettings(UIUserNotificationSettings(types: [.badge, .sound, .alert], categories: nil))
            UIApplication.shared.registerForRemoteNotifications()
        }
    }
    
{'fraction_non_alphanumeric': 0.09210526315789473, 'fraction_numerical': 0.008552631578947369, 'mean_word_length': 2.5650644783118404, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6642771', 'n_tokens_mistral': 873, 'n_tokens_neox': 820, 'n_words': 158}