Skip to content

Commit

Permalink
Merge pull request #75 from hansemannn/update-ios-sdk
Browse files Browse the repository at this point in the history
Update Admob iOS SDK to 7.27.0
  • Loading branch information
hansemannn authored Jan 28, 2018
2 parents 8315694 + e409ca2 commit ebb79c9
Show file tree
Hide file tree
Showing 98 changed files with 500 additions and 227 deletions.
12 changes: 6 additions & 6 deletions ios/Classes/TiAdmobModuleAssets.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@

@implementation TiAdmobModuleAssets

- (NSData*) moduleAsset
- (NSData *)moduleAsset
{

return nil;
return nil;
}

- (NSData*) resolveModuleAsset:(NSString*)path
- (NSData *)resolveModuleAsset:(NSString *)path
{

return nil;
return nil;
}

@end
58 changes: 57 additions & 1 deletion ios/Classes/TiAdmobView.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ - (void)setKeywords_:(id)value
{
if ([value isKindOfClass:[NSString class]]) {
[[self request] setKeywords:@[[TiUtils stringValue:value]]];
NSLog(@"[WARN] Ti.Admob: The property `keywords` for string values is deprecated. Please use an array of string values instead.");
NSLog(@"[WARN] Ti.Admob: The property `keywords` with string values is deprecated. Please use an array of string values instead.");
} else if ([value isKindOfClass:[NSArray class]]) {
[[self request] setKeywords:value];
} else {
Expand Down Expand Up @@ -280,36 +280,68 @@ + (NSDictionary *)dictionaryFromInterstitial:(GADInterstitial *)interstitial

- (void)adViewDidReceiveAd:(GADBannerView *)view
{
if (![[self proxy] _hasListeners:@"didReceiveAd"]) {
return;
}

[self.proxy fireEvent:@"didReceiveAd" withObject:[TiAdmobView dictionaryFromBannerView:view]];
}

- (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error
{
if (![[self proxy] _hasListeners:@"didFailToReceiveAd"]) {
return;
}

[self.proxy fireEvent:@"didFailToReceiveAd" withObject:@{@"adUnitId": view.adUnitID, @"error":error.localizedDescription}];
}

- (void)adViewWillPresentScreen:(GADBannerView *)adView
{
if (![[self proxy] _hasListeners:@"willPresentScreen"]) {
return;
}


[self.proxy fireEvent:@"willPresentScreen" withObject:[TiAdmobView dictionaryFromBannerView:adView]];
}

- (void)adViewWillDismissScreen:(GADBannerView *)adView
{
if (![[self proxy] _hasListeners:@"willDismissScreen"]) {
return;
}


[self.proxy fireEvent:@"willDismissScreen" withObject:[TiAdmobView dictionaryFromBannerView:adView]];
}

- (void)adViewDidDismissScreen:(GADBannerView *)adView
{
if (![[self proxy] _hasListeners:@"didDismissScreen"]) {
return;
}

[self.proxy fireEvent:@"didDismissScreen" withObject:[TiAdmobView dictionaryFromBannerView:adView]];
}

- (void)adViewWillLeaveApplication:(GADBannerView *)adView
{
if (![[self proxy] _hasListeners:@"willLeaveApplication"]) {
return;
}

[self.proxy fireEvent:@"willLeaveApplication" withObject:[TiAdmobView dictionaryFromBannerView:adView]];
}

- (void)didReceiveInAppPurchase:(GADInAppPurchase *)purchase
{
if (![[self proxy] _hasListeners:@"didReceiveInAppPurchase"]) {
return;
}

DebugLog(@"[WARN] Ti.Admob: The GADInAppPurchase class has been deprecated by Google and will be removed in the future.");

[self.proxy fireEvent:@"didReceiveInAppPurchase" withObject:@{
@"productId": purchase.productID,
@"quantity": [NSNumber numberWithInteger:purchase.quantity]
Expand All @@ -320,22 +352,38 @@ - (void)didReceiveInAppPurchase:(GADInAppPurchase *)purchase

- (void)interstitialDidReceiveAd:(GADInterstitial *)ad
{
if (![[self proxy] _hasListeners:@"didReceiveAd"]) {
return;
}

[self.proxy fireEvent:@"didReceiveAd" withObject:[TiAdmobView dictionaryFromInterstitial:ad]];
[self showInterstitial];
}

- (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error
{
if (![[self proxy] _hasListeners:@"didFailToReceiveAd"]) {
return;
}

[self.proxy fireEvent:@"didFailToReceiveAd" withObject:@{@"adUnitId": ad.adUnitID, @"error":error.localizedDescription}];
}

- (void)interstitialWillPresentScreen:(GADInterstitial *)ad
{
if (![[self proxy] _hasListeners:@"willPresentScreen"]) {
return;
}

[self.proxy fireEvent:@"willPresentScreen" withObject:[TiAdmobView dictionaryFromInterstitial:ad]];
}

- (void)interstitialWillDismissScreen:(GADInterstitial *)ad
{
if (![[self proxy] _hasListeners:@"willDismissScreen"]) {
return;
}

[self.proxy fireEvent:@"willDismissScreen" withObject:[TiAdmobView dictionaryFromInterstitial:ad]];
}

Expand All @@ -345,11 +393,19 @@ - (void)interstitialDidDismissScreen:(GADInterstitial *)ad
[self removeFromSuperview];
}, NO);

if (![[self proxy] _hasListeners:@"didDismissScreen"]) {
return;
}

[self.proxy fireEvent:@"didDismissScreen" withObject:[TiAdmobView dictionaryFromInterstitial:ad]];
}

- (void)interstitialWillLeaveApplication:(GADInterstitial *)ad
{
if (![[self proxy] _hasListeners:@"willLeaveApplication"]) {
return;
}

[self.proxy fireEvent:@"willLeaveApplication" withObject:[TiAdmobView dictionaryFromInterstitial:ad]];
}

Expand Down
2 changes: 1 addition & 1 deletion ios/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2013 Appcelerator, Inc.
Copyright 2013-present Appcelerator, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
9 changes: 5 additions & 4 deletions ios/admob.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
24DD6CF91134B3F500162E58 /* TiAdmobModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DD6CF71134B3F500162E58 /* TiAdmobModule.h */; };
24DD6CFA1134B3F500162E58 /* TiAdmobModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DD6CF81134B3F500162E58 /* TiAdmobModule.m */; };
3A4F268F1C68DDF7003E06CF /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A4F268E1C68DDF7003E06CF /* iAd.framework */; };
3AC840121C60A7F3002A52E3 /* libAdapterIAd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AC840101C60A7E1002A52E3 /* libAdapterIAd.a */; };
3AEA89BF1C5F727300FBA64B /* GoogleMobileAds.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AEA89BD1C5F71A100FBA64B /* GoogleMobileAds.framework */; };
3AF5B7731C233383002E3DC7 /* TiAdmobTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AF5B7711C233383002E3DC7 /* TiAdmobTypes.h */; };
AA747D9F0F9514B9006C5449 /* TiAdmob_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* TiAdmob_Prefix.pch */; };
Expand Down Expand Up @@ -78,7 +77,6 @@
buildActionMask = 2147483647;
files = (
3A4F268F1C68DDF7003E06CF /* iAd.framework in Frameworks */,
3AC840121C60A7F3002A52E3 /* libAdapterIAd.a in Frameworks */,
CE6C17A01982D1170017C788 /* AdSupport.framework in Frameworks */,
DAD5D7CF12527E11009CF986 /* AudioToolbox.framework in Frameworks */,
CE6C17A21982D12D0017C788 /* AVFoundation.framework in Frameworks */,
Expand Down Expand Up @@ -271,6 +269,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEPLOYMENT_POSTPROCESSING = NO;
DSTROOT = /tmp/TiAdmob.dst;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -326,6 +325,7 @@
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEPLOYMENT_POSTPROCESSING = YES;
DSTROOT = /tmp/TiAdmob.dst;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -398,7 +398,7 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DDEBUG",
Expand All @@ -419,6 +419,7 @@
baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEPLOYMENT_POSTPROCESSING = YES;
DSTROOT = /tmp/TiAdmob.dst;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_MODEL_TUNING = G5;
Expand All @@ -436,7 +437,7 @@
GCC_WARN_UNUSED_VALUE = NO;
GCC_WARN_UNUSED_VARIABLE = NO;
INSTALL_PATH = /usr/local/lib;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
OTHER_CFLAGS = "-DTI_POST_1_2";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = TiAdmob;
Expand Down
2 changes: 2 additions & 0 deletions ios/documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Change Log
<pre>
v2.2.0 Update Admob iOS SDK to 7.27.0, remove iAd adapter due to Google removal

v2.1.0 [MOD-2196] Support the iAd adapter

v2.0.0 [MOD-2182] Updating Admob SDK to 7.6.0, support iOS 9, support for new API's'
Expand Down
2 changes: 2 additions & 0 deletions ios/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ the example for a detailed example of different banner types.

### iAd

⚠️ Removed by the Admob SDK 7.x and Ti.Admob 2.2.0

Starting in 2.1.0 you can use the included iAd adapter to turn on the iAd mediation in your Admob account.

## Usage
Expand Down
2 changes: 2 additions & 0 deletions ios/documentation/view.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ Store).

### didReceiveInAppPurchase

⚠️ Deprecated by the Admob SDK 7.x and Ti.Admob 2.2.0

Called when the user clicks on the buy button of an in-app purchase ad. After the receiver handles the purchase, it must
call the GADInAppPurchase object's reportPurchaseStatus: method.

1 change: 0 additions & 1 deletion ios/hooks/README

This file was deleted.

35 changes: 0 additions & 35 deletions ios/hooks/add.py

This file was deleted.

19 changes: 0 additions & 19 deletions ios/hooks/install.py

This file was deleted.

34 changes: 0 additions & 34 deletions ios/hooks/remove.py

This file was deleted.

18 changes: 0 additions & 18 deletions ios/hooks/uninstall.py

This file was deleted.

4 changes: 2 additions & 2 deletions ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.1.1
version: 2.2.0
architectures: armv7 i386 x86_64 arm64
description: AdMob module for ad delivery via AdMob
author: Jeff Haynie, Stephen Tramer, Jasper Kennis, Jon Alter and Hans Knoechel
Expand All @@ -15,4 +15,4 @@ name: admob
moduleid: ti.admob
guid: 0d005e93-9980-4739-9e41-fd1129c8ff32
platform: iphone
minsdk: 5.1.0
minsdk: 6.2.2
8 changes: 1 addition & 7 deletions ios/module.xcconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
//
// PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE
// PICKED UP DURING THE APP BUILD FOR YOUR MODULE
//
FRAMEWORK_SEARCH_PATHS=$(SRCROOT)/../../modules/iphone/ti.admob/2.1.1/platform "~/Library/Application\ Support/Titanium/modules/iphone/ti.admob/2.1.1/platform"

OTHER_LDFLAGS=$(inherited) -framework AdSupport -framework AudioToolbox -framework AVFoundation -framework CoreGraphics -framework CoreMedia -framework CoreMotion -framework CoreTelephony -framework CoreVideo -framework Foundation -framework GLKit -framework JavaScriptCore -framework MediaPlayer -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework SafariServices -framework StoreKit -framework SystemConfiguration -framework WebKit -framework GoogleMobileAds
OTHER_LDFLAGS=$(inherited) -framework AdSupport -framework AudioToolbox -framework AVFoundation -framework CoreGraphics -framework CoreMedia -framework CoreMotion -framework CoreTelephony -framework CoreVideo -framework Foundation -framework GLKit -framework JavaScriptCore -framework MediaPlayer -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework SafariServices -framework iAd -framework StoreKit -framework SystemConfiguration -framework WebKit -framework GoogleMobileAds
1 change: 0 additions & 1 deletion ios/platform/GoogleMobileAds.framework/GoogleMobileAds

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion ios/platform/GoogleMobileAds.framework/Headers

This file was deleted.

Loading

0 comments on commit ebb79c9

Please sign in to comment.