-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of ssh://stash.corp.appnexus.com:7999/mobile-sd…
…k/app_mobile-sdk-ios
- Loading branch information
Showing
82 changed files
with
3,510 additions
and
2,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
521 changes: 521 additions & 0 deletions
521
examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
...eIntegration/SimpleIntegrationObjC.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/AppDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* Copyright 2020 APPNEXUS INC | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface AppDelegate : UIResponder <UIApplicationDelegate> | ||
|
||
@property (strong, nonatomic) UIWindow *window; | ||
|
||
@end | ||
|
30 changes: 30 additions & 0 deletions
30
examples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/AppDelegate.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* Copyright 2020 APPNEXUS INC | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import "AppDelegate.h" | ||
|
||
@interface AppDelegate () | ||
|
||
@end | ||
|
||
@implementation AppDelegate | ||
|
||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | ||
// Override point for customization after application launch. | ||
return YES; | ||
} | ||
|
||
@end |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...ples/ObjectiveC/SimpleIntegration/SimpleIntegrationObjC/BannerAd/BannerAdViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* Copyright 2020 APPNEXUS INC | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import "BannerAdViewController.h" | ||
#import <AppNexusSDK/AppNexusSDK.h> | ||
|
||
|
||
|
||
@interface BannerAdViewController () <ANBannerAdViewDelegate> | ||
|
||
@property (nonatomic, readwrite, strong) ANBannerAdView *banner; | ||
|
||
|
||
@end | ||
|
||
@implementation BannerAdViewController | ||
|
||
- (void)viewDidLoad | ||
{ | ||
[super viewDidLoad]; | ||
self.title = @"Banner Ad"; | ||
|
||
int adWidth = 300; | ||
int adHeight = 250; | ||
NSString *adID = @"1281482"; | ||
|
||
// We want to center our ad on the screen. | ||
CGRect screenRect = [[UIScreen mainScreen] bounds]; | ||
CGFloat originX = (screenRect.size.width / 2) - (adWidth / 2); | ||
CGFloat originY = (screenRect.size.height / 2) - (adHeight / 2); | ||
|
||
// Needed for when we create our ad view. | ||
CGRect rect = CGRectMake(originX, originY, adWidth, adHeight); | ||
CGSize size = CGSizeMake(adWidth, adHeight); | ||
|
||
// Make a banner ad view. | ||
self.banner = [ANBannerAdView adViewWithFrame:rect placementId:adID adSize:size]; | ||
self.banner.rootViewController = self; | ||
self.banner.delegate = self; | ||
[self.view addSubview:self.banner]; | ||
|
||
// Since this example is for testing, we'll turn on PSAs and verbose logging. | ||
self.banner.shouldServePublicServiceAnnouncements = NO; | ||
|
||
// Load an ad. | ||
[self.banner loadAd]; | ||
} | ||
|
||
- (void)adDidReceiveAd:(id)ad { | ||
NSLog(@"Ad did receive ad"); | ||
} | ||
|
||
-(void)ad:(id)ad requestFailedWithError:(NSError *)error{ | ||
NSLog(@"Ad request Failed With Error"); | ||
} | ||
|
||
- (void)didReceiveMemoryWarning | ||
{ | ||
[super didReceiveMemoryWarning]; | ||
// Dispose of any resources that can be recreated. | ||
} | ||
|
||
@end |
Oops, something went wrong.