<commit_before>//
//  Pushy.swift
//  Pushy
//
//  Created by Pushy on 10/7/16.
//  Copyright © 2016 Pushy. All rights reserved.
//

import UIKit
import UserNotifications

public class Pushy : NSObject {
    static var shared: Pushy?
    
    private var appDelegate: UIApplicationDelegate
    private var application: UIApplication
    private var registrationHandler: ((Error?, String) -> Void)?
    private var notificationHandler: (([AnyHashable : Any], @escaping ((UIBackgroundFetchResult) -> Void)) -> Void)?
    
    public init(_ application: UIApplication) {
        // Store application and app delegate for later
        self.application = application
        self.appDelegate = application.delegate!
        
        // Initialize Pushy instance before accessing the self object
        super.init()
        
        // Store Pushy instance for later, but don't overwrite an existing instance if already initialized
        if Pushy.shared == nil {
            Pushy.shared = self
        }
    }
    
    // Define a notification handler to invoke when device receives a notification
    public func setNotificationHandler(_ notificationHandler: @escaping ([AnyHashable : Any], @escaping ((UIBackgroundFetchResult) -> Void)) -> Void) {
        // Save the handler for later
        self.notificationHandler = notificationHandler
<commit_msg>Capacitor: Nullify UNUserNotificationCenterDelegate for didReceiveRemoteNotification to be invoked<commit_after>//
//  Pushy.swift
//  Pushy
//
//  Created by Pushy on 10/7/16.
//  Copyright © 2016 Pushy. All rights reserved.
//

import UIKit
import UserNotifications

public class Pushy : NSObject {
    static var shared: Pushy?
    
    private var appDelegate: UIApplicationDelegate
    private var application: UIApplication
    private var registrationHandler: ((Error?, String) -> Void)?
    private var notificationHandler: (([AnyHashable : Any], @escaping ((UIBackgroundFetchResult) -> Void)) -> Void)?
    
    public init(_ application: UIApplication) {
        // Store application and app delegate for later
        self.application = application
        self.appDelegate = application.delegate!
        
        // Initialize Pushy instance before accessing the self object
        super.init()
        
        // Store Pushy instance for later, but don't overwrite an existing instance if already initialized
        if Pushy.shared == nil {
            Pushy.shared = self
        }
    }
    
    // Define a notification handler to invoke when device receives a notification
    public func setNotificationHandler(_ notificationHandler: @escaping ([AnyHashable : Any], @escaping ((UIBackgroundFetchResult) -> Void)) -> Void) {
        // Save the handler for later
        self.notificationHandler = notificationHandler

        // Disable Capacitor/Cordova UNUserNotificationCenterDelegate
        UNUserNotificationCenter.current().delegate = nil
        
{'fraction_non_alphanumeric': 0.08088737201365187, 'fraction_numerical': 0.0061433447098976105, 'mean_word_length': 2.821382007822686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4359744', 'n_tokens_mistral': 759, 'n_tokens_neox': 724, 'n_words': 256}