Hi, I need to implement AppsFlyerTrackerDelegate inside extension for take conversion data from AppsFlyerSDK when app will finish launching.
My code:
#include "Utils.h"
#import <UIKit/UIKit.h>
#import <AppsFlyerLib/AppsFlyerTracker.h>
extern "C" void returnConversionSuccess (const char* data);
extern "C" void returnConversionError (const char* data);
@interface NMEAppDelegate : NSObject <UIApplicationDelegate, AppsFlyerTrackerDelegate>
@end
@implementation NMEAppDelegate(UIApplicationDelegate)
-(BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *) launchOptions
{
[AppsFlyerTracker sharedTracker].delegate = self;
return YES;
}
-(void)onConversionDataReceived:(NSDictionary*) installData
{
....
returnConversionSuccess([resultString UTF8String]);
}
-(void)onConversionDataRequestFailure:(NSError *) error {
NSLog(@"%@", error);
NSString *resultString = [NSString stringWithFormat:@"%@", error];
returnConversionError([resultString UTF8String]);
}
@end
And when calling method returnConversionSuccess I got an BAD_ACCESS Error.
Debugger shows a string is not Null. Looks like my code has some troubles with delegate.
Also I tried to call returnConversionSuccess using performSelectorOnMainThread.
I’ll provide stack trace if you need. Thanks for your help.