Skip to content

Commit

Permalink
Publishing latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnbuso committed Jan 3, 2017
1 parent fba1984 commit 54f977d
Show file tree
Hide file tree
Showing 49 changed files with 591 additions and 586 deletions.
4 changes: 2 additions & 2 deletions Objective-C/AdvancedExample/AdvancedExample/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import <UIKit/UIKit.h>
@import UIKit;

@interface AppDelegate : UIResponder<UIApplicationDelegate>

@property(strong, nonatomic) UIWindow *window;
@property(nonatomic, strong) UIWindow *window;

@end
32 changes: 0 additions & 32 deletions Objective-C/AdvancedExample/AdvancedExample/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "AppDelegate.h"
#import "MainViewController.h"

@interface AppDelegate ()

Expand All @@ -13,35 +12,4 @@ - (BOOL)application:(UIApplication *)application
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for
// certain types of temporary interruptions (such as an incoming phone call or SMS message) or
// when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame
// rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store
// enough application state information to restore your application to its current state in case
// it is terminated later.
// If your application supports background execution, this method is called instead of
// applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo
// many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If
// the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also
// applicationDidEnterBackground:.
}

@end
21 changes: 7 additions & 14 deletions Objective-C/AdvancedExample/AdvancedExample/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,47 @@ static NSString *const kBipBopContentPath =
@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8";

// Standard pre-roll
static NSString *const kPrerollTag =
@"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
static NSString *const kPrerollTag = @"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
@"iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&"
@"output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&"
@"correlator=";

// Skippable
static NSString *const kSkippableTag =
@"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
static NSString *const kSkippableTag = @"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
@"iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&"
@"output=vast&unviewed_position_start=1&"
@"cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";

// Post-roll
static NSString *const kPostrollTag =
@"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
static NSString *const kPostrollTag = @"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
@"iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&"
@"output=vmap&unviewed_position_start=1&"
@"cust_params=deployment%3Ddevsite%26sample_ar%3Dpostonly&cmsid=496&vid=short_onecue&"
@"correlator=";

// Ad rues
static NSString *const kAdRulesTag =
@"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
static NSString *const kAdRulesTag = @"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
@"iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&"
@"output=vast&unviewed_position_start=1&"
@"cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&"
@"correlator=";

// Ad rules pods
static NSString *const kAdRulesPodsTag =
@"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
static NSString *const kAdRulesPodsTag = @"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
@"iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&"
@"output=vast&unviewed_position_start=1&"
@"cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostpod&cmsid=496&vid=short_onecue&"
@"correlator=";

// VMAP pods
static NSString *const kVMAPPodsTag =
@"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
static NSString *const kVMAPPodsTag = @"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
@"iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&"
@"output=vmap&unviewed_position_start=1&"
@"cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostpod&cmsid=496&vid=short_onecue&"
@"correlator=";

// Wrapper
static NSString *const kWrapperTag =
@"http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
static NSString *const kWrapperTag = @"http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&"
@"iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&"
@"output=vast&unviewed_position_start=1&"
@"cust_params=deployment%3Ddevsite%26sample_ct%3Dredirectlinear&correlator=";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#import <UIKit/UIKit.h>

@import GoogleInteractiveMediaAds;
@import UIKit;

@interface MainViewController : UIViewController

Expand Down
17 changes: 10 additions & 7 deletions Objective-C/AdvancedExample/AdvancedExample/MainViewController.m
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#import <UIKit/UIKit.h>
#import "MainViewController.h"

#import "Constants.h"
#import "MainViewController.h"
#import "Video.h"
#import "VideoViewController.h"
#import "VideoTableViewCell.h"

@interface MainViewController () <UIAlertViewDelegate>

// Storage point for videos.
@property(nonatomic, copy) NSArray *videos;
/// Storage point for videos.
@property(nonatomic, copy) NSArray<Video *> *videos;

/// AdsLoader for IMA SDK.
@property(nonatomic, strong) IMAAdsLoader *adsLoader;

/// Language for ad UI.
@property(nonatomic, strong) NSString *language;

@end
Expand Down Expand Up @@ -112,9 +115,9 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"showVideo"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
Video *video = self.videos[indexPath.row];
VideoViewController *headedTo = (VideoViewController *)[segue destinationViewController];
headedTo.video = video;
headedTo.adsLoader = self.adsLoader;
VideoViewController *destVC = (VideoViewController *)[segue destinationViewController];
destVC.video = video;
destVC.adsLoader = self.adsLoader;
}
}

Expand Down
22 changes: 11 additions & 11 deletions Objective-C/AdvancedExample/AdvancedExample/Video.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@import AVFoundation;
@import UIKit;

@interface Video : NSObject

// The title of the video
@property(nonatomic, strong) NSString *title;
/// The title of the video.
@property(nonatomic, copy) NSString *title;

// The thumbnail for the video list.
/// The thumbnail for the video list.
@property(nonatomic, strong) UIImage *thumbnail;

// The URL for the video media file
@property(nonatomic, strong) NSString *video;
/// The URL for the video media file.
@property(nonatomic, copy) NSString *video;

// The URL for the VAST response
@property(nonatomic, strong) NSString *tag;
/// The URL for the VAST response.
@property(nonatomic, copy) NSString *tag;

// Returns an initialized video.
/// Returns an initialized video.
- (instancetype)initWithTitle:(NSString *)title
thumbnail:(UIImage *)thumbnail
video:(NSString *)video
tag:(NSString *)tag;

@end
@end
10 changes: 5 additions & 5 deletions Objective-C/AdvancedExample/AdvancedExample/Video.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ - (instancetype)initWithTitle:(NSString *)title
tag:(NSString *)tag {
self = [super init];
if (self) {
self.title = [title copy];
self.thumbnail = [thumbnail copy];
self.video = [video copy];
self.tag = [tag copy];
_title = [title copy];
_thumbnail = [thumbnail copy];
_video = [video copy];
_tag = [tag copy];
}
return self;
}

@end
@end
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#import <UIKit/UIKit.h>
@import UIKit;

#import "Video.h"

@interface VideoTableViewCell : UITableViewCell

@property(nonatomic, weak, readwrite) IBOutlet UIImageView *thumbnail;
@property(nonatomic, weak, readwrite) IBOutlet UILabel *videoLabel;
@property(nonatomic, weak) IBOutlet UIImageView *thumbnail;
@property(nonatomic, weak) IBOutlet UILabel *videoLabel;

- (void)populateWithVideo:(Video *)Video;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#import <UIKit/UIKit.h>
@import UIKit;

@import GoogleInteractiveMediaAds;

#import "Video.h"

@interface VideoViewController : UIViewController

// UI Outlets
Expand Down
Loading

0 comments on commit 54f977d

Please sign in to comment.