<commit_before>//
//  MPKitProtocol.h
//
//  Copyright 2016 mParticle, Inc.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

#ifndef mParticle_OBJC_SDK_MPKitProtocol_h
#define mParticle_OBJC_SDK_MPKitProtocol_h

#import <Foundation/Foundation.h>
#import "MPKitExecStatus.h"
#import "MPEnums.h"

#if TARGET_OS_IOS == 1
    #import <CoreLocation/CoreLocation.h>
#endif

@class MPCommerceEvent;
@class MPEvent;
@class MPMediaTrack;
@class MPUserSegments;

@protocol MPKitProtocol <NSObject>
#pragma mark - Required methods
- (nonnull instancetype)initWithConfiguration:(nonnull NSDictionary *)configuration startImmediately:(BOOL)startImmediately;
- (nonnull NSNumber *)kitCode;
- (void)setKitCode:(nonnull NSNumber *)kitCode;
- (BOOL)started;

#pragma mark - Optional methods
@optional
#pragma mark Kit lifecycle
- (void)start;
- (void)deinit;
- (nullable id const)providerKitInstance;
- (nonnull NSDictionary *)configuration;
- (void)setConfiguration:(nonnull NSDictionary *)configuration;
- (nullable NSDictionary *)launchOptions;
- (void)setLaunchOptions:(nullable NSDictionary *)launchOptions;

#pragma mark Application
- (nonnull MPKitExecStatus *)openURL:(nonnull NSURL *)url sourceApplication:(nonnull NSString *)sourceApplication annotation:(nullable id)annotation;
- (nonnull MPKitExecStatus *)failedToRegisterForUserNotifications:(nullable NSError *)error;
- (nonnull MPKitExecStatus *)handleActionWithIdentifier:(nonnull NSString *)identifier forRemoteNotification:(nonnull NSDictionary *)userInfo;
- (nonnull MPKitExecStatus *)receivedUserNotification:(nonnull NSDictionary *)userInfo;
- (nonnull MPKitExecStatus *)setDeviceToken:(nonnull NSData *)deviceToken;
- (nonnull MPKitExecStatus *)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(void(^ _Nonnull)(NSArray * _Nullable restorableObjects))restorationHandler;
- (nonnull MPKitExecStatus *)didUpdateUserActivity:(nonnull NSUserActivity *)userActivity;
- (nonnull MPKitExecStatus *)didBecomeActive;

#pragma mark Location tracking
#if TARGET_OS_IOS == 1
- (nonnull MPKitExecStatus *)beginLocationTracking:(CLLocationAccuracy)accuracy minDistance:(CLLocationDistance)distanceFilter;
- (nonnull MPKitExecStatus *)endLocationTracking;
- (nonnull MPKitExecStatus *)setLocation:(nonnull CLLocation *)location;
#endif

#pragma mark Session management
- (nonnull MPKitExecStatus *)beginSession;
- (nonnull MPKitExecStatus *)endSession;

#pragma mark User attributes and identities
- (nullable NSDictionary<NSString *, id> *)userAttributes;<commit_msg>Changed the nullability notation for the legacy  method<commit_after>//
//  MPKitProtocol.h
//
//  Copyright 2016 mParticle, Inc.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

#ifndef mParticle_OBJC_SDK_MPKitProtocol_h
#define mParticle_OBJC_SDK_MPKitProtocol_h

#import <Foundation/Foundation.h>
#import "MPKitExecStatus.h"
#import "MPEnums.h"

#if TARGET_OS_IOS == 1
    #import <CoreLocation/CoreLocation.h>
#endif

@class MPCommerceEvent;
@class MPEvent;
@class MPMediaTrack;
@class MPUserSegments;

@protocol MPKitProtocol <NSObject>
#pragma mark - Required methods
- (nonnull instancetype)initWithConfiguration:(nonnull NSDictionary *)configuration startImmediately:(BOOL)startImmediately;
- (nonnull NSNumber *)kitCode;
- (void)setKitCode:(nonnull NSNumber *)kitCode;
- (BOOL)started;

#pragma mark - Optional methods
@optional
#pragma mark Kit lifecycle
- (void)start;
- (void)deinit;
- (nullable id const)providerKitInstance;
- (nonnull NSDictionary *)configuration;
- (void)setConfiguration:(nonnull NSDictionary *)configuration;
- (nullable NSDictionary *)launchOptions;
- (void)setLaunchOptions:(nullable NSDictionary *)launchOptions;

#pragma mark Application
- (nonnull MPKitExecStatus *)openURL:(nonnull NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(nullable id)annotation;
- (nonnull MPKitExecStatus *)failedToRegisterForUserNotifications:(nullable NSError *)error;
- (nonnull MPKitExecStatus *)handleActionWithIdentifier:(nonnull NSString *)identifier forRemoteNotification:(nonnull NSDictionary *)userInfo;
- (nonnull MPKitExecStatus *)receivedUserNotification:(nonnull NSDictionary *)userInfo;
- (nonnull MPKitExecStatus *)setDeviceToken:(nonnull NSData *)deviceToken;
- (nonnull MPKitExecStatus *)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(void(^ _Nonnull)(NSArray * _Nullable restorableObjects))restorationHandler;
- (nonnull MPKitExecStatus *)didUpdateUserActivity:(nonnull NSUserActivity *)userActivity;
- (nonnull MPKitExecStatus *)didBecomeActive;

#pragma mark Location tracking
#if TARGET_OS_IOS == 1
- (nonnull MPKitExecStatus *)beginLocationTracking:(CLLocationAccuracy)accuracy minDistance:(CLLocationDistance)distanceFilter;
- (nonnull MPKitExecStatus *)endLocationTracking;
- (nonnull MPKitExecStatus *)setLocation:(nonnull CLLocation *)location;
#endif

#pragma mark Session management
- (nonnull MPKitExecStatus *)beginSession;
- (nonnull MPKitExecStatus *)endSession;

#pragma mark User attributes and identities
- (nullable NSDictionary<NSString *, id> *)userAttributes;
{'fraction_non_alphanumeric': 0.10092487424955379, 'fraction_numerical': 0.0032451728054518902, 'mean_word_length': 6.58179581795818, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5923733', 'n_tokens_mistral': 1811, 'n_tokens_neox': 1748, 'n_words': 498}