#if __has_include(<React/RCTConvert.h>)
#import <React/RCTConvert.h>
#import <React/RCTBridge.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTUtils.h>
#import <React/RCTAnimationType.h>
#else
#import "RCTConvert.h"
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#import "RCTUtils.h"
#import "RCTAnimationType.h"
#endif

#import <UIKit/UIKit.h>
#import "RNInvitereferrals.h"
#import <objc/runtime.h>


@implementation RNInvitereferrals

- (dispatch_queue_t)methodQueue
{
    return dispatch_get_main_queue();
}

//RCT_EXPORT_MODULE();

/* app delegate methods implementation */

+(void)setupWithBrandId:(int)irBrandId encryptedKey:(NSString *_Nullable)irEncryptedKey {
    NSLog(@"PLUGIN VERSION : 4.1.8 !!");
    NSLog(@"SET UP WITH BRAND ID !!");
    [InviteReferrals setupWithBrandId:irBrandId  encryptedKey:irEncryptedKey];
}

+(void)OpenUrlWithApplication:(UIApplication *_Nullable)application Url:(NSURL *_Nullable)url {
    NSLog(@"OPEN URL WITH APPLICATION");
    [InviteReferrals OpenUrlWithApplication: application Url: url];
}

+(void)continueUserActivityWith:(NSUserActivity *)userActivity{
    NSLog(@"COUNTINUE USER ACTIVITY !!");
    [InviteReferrals continueUserActivityWith:userActivity];
}



+(void)setDefaultNavigationController:(UINavigationController *_Nullable)navController BarStyle:(UIBarStyle)navBarStyle PreferedStatusBarStyleLightContent:(BOOL)navCustomStatusBarStyleLightContent BarSetTranslucent:(BOOL)navSetBarTranslucent BarLoginScreenTitle:(NSString *_Nullable)navBarLoginScreenTitle BarShareScreenTitle:(NSString *_Nullable)navBarShareScreenTitle BarInActiveCampaignScreenTitle:(NSString *_Nullable)navInActiveCampaignScreenTitle BarTitleTextAttributes:(NSDictionary<NSAttributedStringKey,id> * _Nullable)navBarTitleTextAttributes BarTitleColor:(NSString *_Nullable)navBarTitleColor BarBackground:(NSString *_Nullable)navBarBackground BarButtonPosition:(NSString *_Nullable)navBarButtonPosition BarButtonTitle:(NSString *_Nullable)navBarButtonTitle BarTextFontName:(NSString *_Nullable)navBarTextFontName BarTitleFontSize:(float)navBarTitleFontSize BarButtonTextAttributes:(NSDictionary<NSAttributedStringKey,id> * _Nullable)navBarButtonTextAttributes BarButtonFontSize:(float)navBarButtonFontSize BarButtonIconWidth:(float)navBarButtonIconWidth BarButtonIconHeight:(float)navBarButtonIconHeight BarButtonTintColor:(NSString *_Nullable)navBarButtonTintColor{
    
    NSLog(@"SET DEFAULT NAVIGATION CONTROLLER !!");
    
    [InviteReferrals setDefaultNavigationController:navController BarStyle:navBarStyle PreferedStatusBarStyleLightContent:navCustomStatusBarStyleLightContent BarSetTranslucent:navSetBarTranslucent BarLoginScreenTitle:navBarLoginScreenTitle BarShareScreenTitle:navBarShareScreenTitle BarInActiveCampaignScreenTitle:navInActiveCampaignScreenTitle BarTitleTextAttributes:navBarTitleTextAttributes BarTitleColor:navBarTitleColor BarBackground:navBarBackground BarButtonPosition:navBarButtonPosition BarButtonTitle:navBarButtonTitle BarTextFontName:navBarTextFontName BarTitleFontSize:navBarTitleFontSize BarButtonTextAttributes:navBarButtonTextAttributes BarButtonFontSize:navBarButtonFontSize BarButtonIconWidth:navBarButtonIconWidth BarButtonIconHeight:navBarButtonIconHeight BarButtonTintColor:navBarButtonTintColor];
}





@end


// unawailabe
//RCT_EXPORT_METHOD(showPopup){
//    @try{
//        NSLog(@"ShowWelcomeMessage triggered !!");
//        [InviteReferrals welcomeMessage];
//    }
//    @catch(NSException *exception){
//        NSLog(@"%@", exception.reason);
//        //callback(@[exception.reason, [NSNull null]]);
//    }
//}


// new work nahi hai

//RCT_EXPORT_METHOD(trackInvite){
//    @try{
//        NSLog(@"ShowWelcomeMessage triggered !!");
//        [InviteReferrals welcomeMessage];
//    }
//    @catch(NSException *exception){
//        NSLog(@"%@", exception.reason);
//        //callback(@[exception.reason, [NSNull null]]);
//    }
//}

