Skip to content

Commit

Permalink
feat/fix iOS compilation warnings (#28)
Browse files Browse the repository at this point in the history
* 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 586fd73.

* 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 3993cce.

Co-authored-by: Thomas So <[email protected]>
  • Loading branch information
richashukla23 and thomasmso authored Jun 27, 2020
1 parent b16e926 commit 3c3c4c1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#import "ALHomeViewController.h"
#import <AppLovinSDK/AppLovinSDK.h>
#import <MessageUI/MFMailComposeViewController.h>
#import <SafariServices/SafariServices.h>

@interface ALHomeViewController()
Expand All @@ -17,7 +16,6 @@ @interface ALHomeViewController()
@end

@implementation ALHomeViewController
static NSString *const kSupportEmail = @"[email protected]";
static NSString *const kSupportLink = @"https://support.applovin.com/support/home";
static const NSInteger kRowIndexToHideForPhone = 3;

Expand Down Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import AppLovinSDK
import MessageUI
import SafariServices

class ALHomeViewController: UITableViewController, MFMailComposeViewControllerDelegate
class ALHomeViewController: UITableViewController
{
let kSupportEmail = "[email protected]"
let kSupportLink = "https://support.applovin.com/support/home"

let kRowIndexToHideForPhones = 3;
Expand Down Expand Up @@ -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)
}
}

0 comments on commit 3c3c4c1

Please sign in to comment.