From 3c3c4c18a569dc35387a333afa081455c6bb5c5e Mon Sep 17 00:00:00 2001 From: richashukla23 Date: Fri, 26 Jun 2020 18:38:40 -0700 Subject: [PATCH] feat/fix iOS compilation warnings (#28) * feat/fix iOS compilation warnings https://app.asana.com/0/1175063922135039/1177178857510161 * Fixing incompatible type warning * Reverting the previous check in and conforming to MFMailComposeViewControllerDelegate protocol instead * Update formatting * Revert "Update formatting" This reverts commit 586fd73f76693dbd4c58918ce7a809f330472ddd. * Update formatting * ObjC log amount and currencyName * Removing email functionality * Add logging of amout and currencyName * Remove MFMAilComposeViewController import and protocol conforming as email functionality is not needed anymore * Remove email functionality - swift * Remove support email - ObjC * Also print amount and currencyName - swift * Remove redundant logging * Amout logging update - Obj C * Update AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosZoneViewController.swift * Update AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosViewController.swift * No need of print only using NSLog * Revert "No need of print only using NSLog" This reverts commit 3993cce6261c8f3cd47cf7465cbb607d77b38999. Co-authored-by: Thomas So <5104410+thomasmso@users.noreply.github.com> --- .../ALDemoRewardedVideosViewController.m | 5 +---- .../ALDemoRewardedVideosZoneViewController.m | 7 ++---- .../Base Classes/ALHomeViewController.m | 22 ------------------- .../ALDemoRewardedVideosViewController.swift | 1 + ...DemoRewardedVideosZoneViewController.swift | 1 + .../Base Classes/ALHomeViewController.swift | 18 +-------------- 6 files changed, 6 insertions(+), 48 deletions(-) diff --git a/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/AppLovin/Rewarded/Basic Integration/ALDemoRewardedVideosViewController.m b/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/AppLovin/Rewarded/Basic Integration/ALDemoRewardedVideosViewController.m index 6730d9f634..04c5268204 100644 --- a/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/AppLovin/Rewarded/Basic Integration/ALDemoRewardedVideosViewController.m +++ b/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/AppLovin/Rewarded/Basic Integration/ALDemoRewardedVideosViewController.m @@ -69,11 +69,8 @@ - (void)rewardValidationRequestForAd:(ALAd *)ad didSucceedWithResponse:(NSDictio awarded and the name of the currency. However, ideally, you should verify this with your server before granting it. */ // i.e. - "Coins", "Gold", whatever you set in the dashboard. - NSString *currencyName = response[@"currency"]; - // For example, "5" or "5.00" if you've specified an amount in the UI. - NSString *amountGivenString = response[@"amount"]; - NSNumber *amountGiven = @([amountGivenString floatValue]); + NSLog(@"Received %@ %@", response[@"amount"], response[@"currencyName"]); // Do something with this information. // [MYCurrencyManagerClass updateUserCurrency: currencyName withChange: amountGiven]; diff --git a/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/AppLovin/Rewarded/Zone Integration/ALDemoRewardedVideosZoneViewController.m b/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/AppLovin/Rewarded/Zone Integration/ALDemoRewardedVideosZoneViewController.m index ef75f27ae7..1c55df6709 100644 --- a/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/AppLovin/Rewarded/Zone Integration/ALDemoRewardedVideosZoneViewController.m +++ b/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/AppLovin/Rewarded/Zone Integration/ALDemoRewardedVideosZoneViewController.m @@ -69,16 +69,13 @@ - (void)rewardValidationRequestForAd:(ALAd *)ad didSucceedWithResponse:(NSDictio awarded and the name of the currency. However, ideally, you should verify this with your server before granting it. */ // i.e. - "Coins", "Gold", whatever you set in the dashboard. - NSString *currencyName = response[@"currency"]; - // For example, "5" or "5.00" if you've specified an amount in the UI. - NSString *amountGivenString = response[@"amount"]; - NSNumber *amountGiven = @([amountGivenString floatValue]); + NSLog(@"Received %@ %@", response[@"amount"], response[@"currencyName"]); // Do something with this information. // [MYCurrencyManagerClass updateUserCurrency: currencyName withChange: amountGiven]; [self logCallback: __PRETTY_FUNCTION__]; - + // By default we'll show a UIAlertView informing your user of the currency & amount earned. // If you don't want this, you can turn it off in the Manage Apps UI. } diff --git a/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/Base Classes/ALHomeViewController.m b/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/Base Classes/ALHomeViewController.m index 4bf030c534..7820f1ccaf 100644 --- a/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/Base Classes/ALHomeViewController.m +++ b/AppLovin MAX Demo App - ObjC/AppLovin MAX Demo App - ObjC/Base Classes/ALHomeViewController.m @@ -8,7 +8,6 @@ #import "ALHomeViewController.h" #import -#import #import @interface ALHomeViewController() @@ -17,7 +16,6 @@ @interface ALHomeViewController() @end @implementation ALHomeViewController -static NSString *const kSupportEmail = @"support@applovin.com"; static NSString *const kSupportLink = @"https://support.applovin.com/support/home"; static const NSInteger kRowIndexToHideForPhone = 3; @@ -99,26 +97,6 @@ - (void)openSupportSite } } -- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error -{ - switch ( result ) - { - case MFMailComposeResultSent: - [[[UIAlertView alloc] initWithTitle: @"Email Sent" - message: @"Thank you for your email, we will process it as soon as possible." - delegate: nil - cancelButtonTitle: @"OK" - otherButtonTitles: nil] show]; - case MFMailComposeResultCancelled: - case MFMailComposeResultSaved: - case MFMailComposeResultFailed: - default: - break; - } - - [self dismissViewControllerAnimated: YES completion: nil]; -} - - (void)addFooterLabel { UILabel *footer = [[UILabel alloc] init]; diff --git a/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosViewController.swift b/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosViewController.swift index 56a63fda42..a3a9e03982 100644 --- a/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosViewController.swift +++ b/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosViewController.swift @@ -65,6 +65,7 @@ extension ALDemoRewardedVideosViewController : ALAdRewardDelegate // "amount" - "5" or "5.00" if you've specified an amount in the UI. if let amount = response["amount"] as? NSString, let currencyName = response["currency"] as? NSString { + print("Received \(amount) \(currencyName)") logCallback() } } diff --git a/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosZoneViewController.swift b/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosZoneViewController.swift index c66846b1f4..3320a7624d 100644 --- a/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosZoneViewController.swift +++ b/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/AppLovin/Rewarded/ALDemoRewardedVideosZoneViewController.swift @@ -70,6 +70,7 @@ extension ALDemoRewardedVideosZoneViewController : ALAdRewardDelegate // "amount" - "5" or "5.00" if you've specified an amount in the UI. if let amount = response["amount"] as? NSString, let currencyName = response["currency"] as? NSString { + print("Received \(amount) \(currencyName)") logCallback() } } diff --git a/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/Base Classes/ALHomeViewController.swift b/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/Base Classes/ALHomeViewController.swift index 5faa31960c..c9da3399fe 100644 --- a/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/Base Classes/ALHomeViewController.swift +++ b/AppLovin MAX Demo App - Swift/AppLovin MAX Demo App - Swift/Base Classes/ALHomeViewController.swift @@ -11,9 +11,8 @@ import AppLovinSDK import MessageUI import SafariServices -class ALHomeViewController: UITableViewController, MFMailComposeViewControllerDelegate +class ALHomeViewController: UITableViewController { - let kSupportEmail = "support@applovin.com" let kSupportLink = "https://support.applovin.com/support/home" let kRowIndexToHideForPhones = 3; @@ -131,20 +130,5 @@ class ALHomeViewController: UITableViewController, MFMailComposeViewControllerDe } } - func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) - { - switch ( result.rawValue ) - { - case ( MFMailComposeResult.sent.rawValue ): - let alertVC = UIAlertController(title: "Email Sent", message: "Thank you for your email, we will process it as soon as possible.", preferredStyle: .alert) - let okAction = UIAlertAction(title: "OK", style: .cancel) - alertVC.addAction(okAction) - present(alertVC, animated: true) - default: - break - } - - dismiss(animated: true, completion: nil) - } }