How to include Rewarded ads to bind with Python on iOS?

I am currently trying to create a mobile application with rewarded ads and I struggle with the code on XCode.

For now I have already integrated interstitial ads and I would like to adapt the code for rewarded ads.

Here is my current working code for interstitial ads adapted from something found on Github:


UIView *gView;
UIViewController *gViewColtroller;

@interface adInterstitial : NSObject
/// The interstitial ad.
@property(nonatomic, strong) GADInterstitial *interstitial;
@property (strong, nonatomic) GADRequest *request;
@end

@implementation adInterstitial

-(id)init {
    [self createAndLoadInterstitial];
    NSLog(@"adInterstitial init");
    return self;
}

- (void)createAndLoadInterstitial {
    self.interstitial = [[GADInterstitial alloc] initWithAdUnitID:@"ca-app-pub-3940256099942544/4411468910"]; // test id
    UIWindow *window = [UIApplication sharedApplication].keyWindow;
    UIViewController *rootViewController = window.rootViewController;
    self.interstitial.delegate = self;

    GADRequest *request = [GADRequest request];
    request.testDevices = @[ kGADSimulatorID, @"2077ef9a63d2b398840261c8221a0c9a" ];
    [self.interstitial loadRequest:request];
    NSLog(@"createAndLoadInterstitial");
}

- (void)interstitialWillDismissScreen:(GADInterstitial *)ad {
    //  Method for reloading the object so that you can show ads again
    NSLog(@"interstitialWillDismissScreen");
    [self createAndLoadInterstitial];
}

- (void)InterstitialView {  // show interstitial ADS
    if (self.interstitial.isReady) {
        NSLog(@"Show interstitial ADS!");
        UIWindow *window = [UIApplication sharedApplication].keyWindow;
        UIViewController *rootViewController = window.rootViewController;
        [self.interstitial presentFromRootViewController:rootViewController];
    } else {
        NSLog(@"interstitial Ad wasn't ready");
    }
}
@end

And here is my attempt with rewarded ads:

@interface adRewarded : NSObject
/// The interstitial ad.
@property(nonatomic, strong) GADRewardedAd *rewarded;
@property (strong, nonatomic) GADRequest *request;
@end

@implementation adRewarded

-(id)init {
    [self createAndLoadRewarded];
    NSLog(@"adRewarded init");
    return self;
}

- (void)createAndLoadRewarded {
    self.rewarded = [[GADRewardedAd alloc] initWithAdUnitID:@"ca-app-pub-3940256099942544/4411468910"]; // test id
    UIWindow *window = [UIApplication sharedApplication].keyWindow;
    UIViewController *rootViewController = window.rootViewController;
    self.rewarded.delegate = self;

    GADRequest *request = [GADRequest request];
    request.testDevices = @[ kGADSimulatorID, @"2077ef9a63d2b398840261c8221a0c9a" ];
    [self.rewarded loadRequest:request];
    NSLog(@"createAndLoadRewarded");
}

- (void)interstitialWillDismissScreen:(GADRewardedAd *)ad {
    //  Method for reloading the object so that you can show ads again
    NSLog(@"rewardedWillDismissScreen");
    [self createAndLoadRewarded];
}

- (void)RewardedView {  // show interstitial ADS
    if (self.rewarded.isReady) {
        NSLog(@"Show rewarded ADS!");
        UIWindow *window = [UIApplication sharedApplication].keyWindow;
        UIViewController *rootViewController = window.rootViewController;
        [self.rewarded presentFromRootViewController:rootViewController];
    } else {
        NSLog(@"rewarded Ad wasn't ready");
    }
}
@end

And I obtain an error on the line : self.rewarded.delegate = self;
The error is : Property 'delegate' not found on object of type 'GADRewardedAd'

Just for info to start the ad in Python I am using the following code:

from pyobjus import autoclass
current_ad = autoclass("adInterstitial").alloc().init()
current_ad.show()

I also tried to use the Google documentation https://developers.google.com/admob/ios/rewarded#objective-c to create a new version but I struggle with the object named ViewController.

Either I get this error if I just copy paste the example:
Cannot find interface declaration for ViewController; did you mean UIViewController

or I get this error if I replace with UIViewController:

Cannot synthesize weak property in file using manual reference counting

Would you please know how to solve it ?

Thank you in advance!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật