AppsFlyerSDK / XamariniOSBinding

AppsFlyer Xamarin iOS Binding project + example app
8 stars 7 forks source link

ValidateAndLogInAppPurchase error unrecognized selector sent to instance #44

Closed fomin-i closed 1 year ago

fomin-i commented 2 years ago

Hi

Call ValidateAndLogInAppPurchase throw exception Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[AppsFlyerLib validateAndLogInAppPurchase:eventNameIfFailed:withValue:withProduct:price:currency:success:failure:]: unrecognized selector sent to instance 0x119f1b130

Code example:

AppsFlyerLib.Shared.ValidateAndLogInAppPurchase(
    eventNameIfSuucceed: "af_purchase",
    failedEventName: "af_purchasefailed",
    value: productIdentifier,
    productIdentifier: productIdentifier,
    price: new NSDecimalNumber(revenue),
    currency: currency,
    successBlock: (dict) => {
        Console.WriteLine($"Validate and log in-app purchase to AppsFlyer: ***SUCCESS***");
    },
    failedBlock: (error, data) => {
        Console.WriteLine($"Validate and log in-app purchase to AppsFlyer: ***FAILED***\n{error}\n{data}");
    }
);

It seems that the problem is in the native library method signature mismatch iOS native library method signature:

- (void) validateAndLogInAppPurchase:(NSString *) productIdentifier,
                  price:(NSString *) price
                  currency:(NSString *) currency
                  transactionId:(NSString *) tranactionId
                  additionalParameters:(NSDictionary *) params
                  success:(void (^)(NSDictionary *response)) successBlock
                  failure:(void (^)(NSError *error, id reponse)) failedBlock;
andr-ggn commented 1 year ago

AppsFlyerXamarinBinding 6.9.3-beta1