datatheorem / TrustKit

Easy SSL pinning validation and reporting for iOS, macOS, tvOS and watchOS.
MIT License
2.03k stars 364 forks source link

No known class method for selector 'initSharedInstanceWithConfiguration:' #182

Closed CaffeinatedFunctionality closed 6 years ago

CaffeinatedFunctionality commented 6 years ago

I'm not sure why, but I followed the readme and setup trustkit under the AppDelegate.m. I have the following imports in the file... `#import "AppDelegate.h"

import <React/RCTBundleURLProvider.h>

import <React/RCTRootView.h>

import <TrustKit/TrustKit.h>`

I am using this with an existing React Native project. For some reason it is telling me it has no clue what 'initSharedInstanceWithConfiguration' is. I even looked at the demo project to see if there was anything I felt I was missing. I didn't notice anything. Is there a new way of doing it and maybe this is an old readme or is there something I am missing?

Here is the TrustKit implementation in the AppDelegate.m

`NSDictionary *trustKitConfig = @{ kTSKPinnedDomains: @{

    @"google.com" : @{
        kTSKEnforcePinning:@NO,
        kTSKIncludeSubdomains:@YES,
        kTSKPublicKeyAlgorithms : @[kTSKAlgorithmRsa2048],
        kTSKPublicKeyHashes : @[
            @"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
            ],
        },
    }
};

[TrustKit initSharedInstanceWithConfiguration:trustKitConfig];`

Thanks for your help

CaffeinatedFunctionality commented 6 years ago

Apparently I am dumb and followed a tutorial that used 4.2. I removed it. Hopefully no one else will be this dumb, but just in case, check your pod file!