Skip to content

Commit

Permalink
update admob ios sdk to 7.31.0, deprecated gender & birthday for privacy
Browse files Browse the repository at this point in the history
  • Loading branch information
Liming Xie committed May 25, 2018
1 parent 5260d0b commit f2e7fb7
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 55 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-admobpro",
"version": "2.31.5",
"version": "2.31.6",
"description": "Ultimate Cordova Plugin for Google AdMob and DFP to monetize hybrid apps. Show mobile Ad with single line of JavaScript. Compatible with Cordova CLI, PhoneGap Build, Intel XDK/Crosswalk, Google ChromeApp, Ionic, Meteor, etc.",
"cordova": {
"id": "cordova-plugin-admobpro",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-admobpro"
version="2.31.5">
version="2.31.6">

<name>AdMob Plugin Pro</name>
<description>Ultimate Cordova Plugin for Google AdMob and DFP to monetize hybrid apps. Show mobile Ad with single line of JavaScript. Compatible with Cordova CLI, PhoneGap Build, Intel XDK/Crosswalk, Google ChromeApp, Ionic, Meteor, etc.</description>
Expand Down
10 changes: 0 additions & 10 deletions src/android/AdMobPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,6 @@ private AdRequest buildAdRequest() {
}
}

if(mGender != null) {
if("male".compareToIgnoreCase(mGender) != 0) builder.setGender(AdRequest.GENDER_MALE);
else if("female".compareToIgnoreCase(mGender) != 0) builder.setGender(AdRequest.GENDER_FEMALE);
else builder.setGender(AdRequest.GENDER_UNKNOWN);
}
if(mLocation != null) builder.setLocation(mLocation);
if(mForFamily != null) {
Bundle extras = new Bundle();
Expand Down Expand Up @@ -421,11 +416,6 @@ private PublisherAdRequest buildPublisherAdRequest() {
builder = builder.addNetworkExtras(new AdMobExtras(bundle));
}

if(mGender != null) {
if("male".compareToIgnoreCase(mGender) != 0) builder.setGender(AdRequest.GENDER_MALE);
else if("female".compareToIgnoreCase(mGender) != 0) builder.setGender(AdRequest.GENDER_FEMALE);
else builder.setGender(AdRequest.GENDER_UNKNOWN);
}
if(mLocation != null) builder.setLocation(mLocation);
if(mForFamily != null) {
Bundle extras = new Bundle();
Expand Down
5 changes: 0 additions & 5 deletions src/ios/CDVAdMobPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@ - (GADRequest*) __buildAdRequest:(BOOL)forBanner forDFP:(BOOL)fordfp
request.testDevices = [NSArray arrayWithObjects:deviceId, kGADSimulatorID, nil];
NSLog(@"request.testDevices: %@, <Google> tips handled", deviceId);
}
if(self.mGender) {
if( [self.mForChild caseInsensitiveCompare:@"male"] == NSOrderedSame ) request.gender = kGADGenderMale;
else if( [self.mForChild caseInsensitiveCompare:@"female"] == NSOrderedSame ) request.gender = kGADGenderFemale;
else request.gender = kGADGenderMale;
}
if(self.mLocation) {
double lat = [[self.mLocation objectAtIndex:0] doubleValue];
double lng = [[self.mLocation objectAtIndex:1] doubleValue];
Expand Down
Binary file modified src/ios/GoogleMobileAds.framework/GoogleMobileAds
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ GAD_ASSUME_NONNULL_BEGIN
/// forwarded to custom events for purposes of populating an ad request to a 3rd party ad network.
@interface GADCustomEventRequest : NSObject

/// User's gender set in GADRequest. If not specified, returns kGADGenderUnknown.
@property(nonatomic, readonly, assign) GADGender userGender;

/// User's birthday set in GADRequest. If not specified, returns nil.
@property(nonatomic, readonly, copy, GAD_NULLABLE) NSDate *userBirthday;

/// If the user's latitude, longitude, and accuracy are not specified, userHasLocation returns NO,
/// and userLatitude, userLongitude, and userLocationAccuracyInMeters return 0.
@property(nonatomic, readonly, assign) BOOL userHasLocation;
Expand Down Expand Up @@ -54,6 +48,14 @@ GAD_ASSUME_NONNULL_BEGIN
/// Indicates if the testing property has been set in GADRequest.
@property(nonatomic, readonly, assign) BOOL isTesting;

#pragma mark Deprecated methods

/// Deprecated. User's gender set in GADRequest. If not specified, returns kGADGenderUnknown.
@property(nonatomic, readonly, assign) GADGender userGender GAD_DEPRECATED_ATTRIBUTE;

/// Deprecated. User's birthday set in GADRequest. If not specified, returns nil.
@property(nonatomic, readonly, copy, GAD_NULLABLE) NSDate *userBirthday GAD_DEPRECATED_ATTRIBUTE;

@end

GAD_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ GAD_ASSUME_NONNULL_BEGIN
/// // Request an ad without any additional targeting information.
/// [adView loadRequest:[GADRequest request]];
/// </pre>
GAD_DEPRECATED_ATTRIBUTE
@interface GADNativeExpressAdView : UIView

#pragma mark - Initialization
Expand Down
35 changes: 16 additions & 19 deletions src/ios/GoogleMobileAds.framework/Headers/GADRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ GAD_ASSUME_NONNULL_BEGIN
/// Add this constant to the testDevices property's array to receive test ads on the simulator.
GAD_EXTERN const id kGADSimulatorID;

/// Genders to help deliver more relevant ads.
/// Deprecated gender constants.
typedef NS_ENUM(NSInteger, GADGender) {
kGADGenderUnknown, ///< Unknown gender.
kGADGenderMale, ///< Male gender.
kGADGenderFemale ///< Female gender.
kGADGenderUnknown, ///< Deprecated.
kGADGenderMale, ///< Deprecated.
kGADGenderFemale ///< Deprecated.
};

/// Specifies optional parameters for ad requests.
Expand All @@ -34,9 +34,9 @@ typedef NS_ENUM(NSInteger, GADGender) {
/// Ad networks may have additional parameters they accept. To pass these parameters to them, create
/// the ad network extras object for that network, fill in the parameters, and register it here. The
/// ad network should have a header defining the interface for the 'extras' object to create. All
/// networks will have access to the basic settings you've set in this GADRequest (gender, birthday,
/// testing mode, etc.). If you register an extras object that is the same class as one you have
/// registered before, the previous extras will be overwritten.
/// networks will have access to the basic settings you've set in this GADRequest. If you register
/// an extras object that is the same class as one you have registered before, the previous extras
/// will be overwritten.
- (void)registerAdNetworkExtras:(id<GADAdNetworkExtras>)extras;

/// Returns the network extras defined for an ad network.
Expand All @@ -58,12 +58,6 @@ typedef NS_ENUM(NSInteger, GADGender) {

#pragma mark User Information

/// Provide the user's gender to increase ad relevancy.
@property(nonatomic, assign) GADGender gender;

/// Provide the user's birthday to increase ad relevancy.
@property(nonatomic, copy, GAD_NULLABLE) NSDate *birthday;

/// The user's current location may be used to deliver more relevant ads. However do not use Core
/// Location just for advertising, make sure it is used for more beneficial reasons as well. It is
/// both a good idea and part of Apple's guidelines.
Expand Down Expand Up @@ -110,15 +104,18 @@ typedef NS_ENUM(NSInteger, GADGender) {

#pragma mark Deprecated Methods

/// Provide the user's birthday to increase ad relevancy.
/// Deprecated property. The user's gender.
@property(nonatomic, assign) GADGender gender GAD_DEPRECATED_ATTRIBUTE;

/// Deprecated property. The user's birthday.
@property(nonatomic, copy, GAD_NULLABLE) NSDate *birthday GAD_DEPRECATED_ATTRIBUTE;

/// Deprecated.
- (void)setBirthdayWithMonth:(NSInteger)month
day:(NSInteger)day
year:(NSInteger)year
GAD_DEPRECATED_MSG_ATTRIBUTE(" use the birthday property.");
year:(NSInteger)year GAD_DEPRECATED_ATTRIBUTE;

/// When Core Location isn't available but the user's location is known supplying it here may
/// deliver more relevant ads. It can be any free-form text such as @"Champs-Elysees Paris" or
/// @"94041 US".
/// Deprecated.
- (void)setLocationWithDescription:(NSString *GAD_NULLABLE_TYPE)locationDescription
GAD_DEPRECATED_MSG_ATTRIBUTE(" use setLocationWithLatitude:longitude:accuracy:.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ GAD_ASSUME_NONNULL_BEGIN
/// The video controller class provides a way to get the video metadata and also manages video
/// content of the ad rendered by the Google Mobile Ads SDK. You don't need to create an instance of
/// this class. When the ad rendered by the Google Mobile Ads SDK loads video content, you may be
/// able to get an instance of this class from the rendered ad object. Currently only native express
/// ad view class exposes video controller.
/// able to get an instance of this class from the rendered ad object.
@interface GADVideoController : NSObject

/// Delegate for receiving video notifications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
/// idempotent and should not crash regardless of when or how many times the method is called.
- (void)stopBeingDelegate;

/// Some ad transition types may cause issues with particular Ad SDKs. The adapter may decide
/// whether the given animation type is OK. Defaults to YES.
- (BOOL)isBannerAnimationOK:(GADMBannerAnimationType)animType;

/// Present an interstitial using the supplied UIViewController, by calling
/// presentViewController:animated:completion:.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
/// enabled.
- (NSNumber *)childDirectedTreatment;

/// The end user's gender set by the publisher in GADRequest. Returns kGADGenderUnknown if it has
/// not been specified.
- (GADGender)userGender;

/// The end user's birthday set by the publisher. Returns nil if it has not been specified.
- (NSDate *)userBirthday;

/// Returns YES if the publisher has specified latitude and longitude location.
- (BOOL)userHasLocation;

Expand All @@ -53,4 +46,14 @@
/// Keywords describing the user's current activity. Example: @"Sport Scores".
- (NSArray *)userKeywords;

#pragma mark Deprecated

/// Deprecated. The end user's gender set by the publisher in GADRequest. Returns kGADGenderUnknown
/// if it has not been specified.
- (GADGender)userGender GAD_DEPRECATED_ATTRIBUTE;

/// Deprecated. The end user's birthday set by the publisher. Returns nil if it has not been
/// specified.
- (NSDate *)userBirthday GAD_DEPRECATED_ATTRIBUTE;

@end

0 comments on commit f2e7fb7

Please sign in to comment.