Skip to content

Commit

Permalink
Migration to SDK v11 (11.0.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Astrovic committed Feb 27, 2024
1 parent d4ad124 commit 2416182
Show file tree
Hide file tree
Showing 500 changed files with 7,362 additions and 33,597 deletions.
5 changes: 4 additions & 1 deletion apidoc/Admob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ properties:
summary: The deviceId for emulators to be used with <Modules.Admob.View.testDevices> property
permission: read-only
platforms: [android, iphone, ipad]
deprecated:
since: "7.0.0"
notes: Simulators are already in test mode by default.

- name: TRACKING_AUTHORIZATION_STATUS_NOT_DETERMINED
type: Number
Expand Down Expand Up @@ -718,7 +721,7 @@ objects:

- name: testDeviceIdentifiers
type: Array<String>
summary: Array of "TEST-DEVICE-HASHED-ID" strings. You can use Admob.SIMULATOR_ID for simulator.
summary: Array of "TEST-DEVICE-HASHED-ID" strings.
optional: true

- name: callback
Expand Down
2 changes: 1 addition & 1 deletion apidoc/LoadOptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ properties:

- name: testDevices
type: Array<String>
summary: Test ads will be returned for devices with device IDs specified in this array. Use AdMob.SIMULATOR_ID to add the simulator.
summary: Test ads will be returned for devices with device IDs specified in this array.
52 changes: 40 additions & 12 deletions apidoc/View.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ properties:
type: Array<String>
summary: An array of test device ids. Adding the id of a test device to this array will allow that device to be served test ads.
description: |
Use the module constant `SIMULATOR_ID` to use the simulator as a test device.
If you do not know the id for your device, launch your app and request an ad
like you normally would, then look in the console for the id.
Expand Down Expand Up @@ -109,18 +108,47 @@ properties:
- name: tagForChildDirectedTreatment
type: Boolean
summary: his property allows you to specify whether you would like your app to be treated as child-directed for purposes of the Children's Online Privacy Protection Act (COPPA), http:///business.ftc.gov/privacy-and-security/childrens-privacy.
summary: his property allows you to specify whether you would like your app to be treated as child-directed for purposes of the Children's Online Privacy Protection Act (COPPA), https://www.ftc.gov/business-guidance/privacy-security/childrens-privacy.
description: |
If you call this method with `true`, you are indicating that your app should be treated as child-directed for purposes of the
Children's Online Privacy Protection Act (COPPA). If you call this method with NO, you are indicating that your app should
not be treated as child-directed for purposes of the Children's Online Privacy Protection Act (COPPA). If you do not call this
method, ad requests will include no indication of how you would like your app treated with respect to COPPA.
By setting this method, you certify that this notification is accurate and you are authorized to act on behalf of the owner of
the app. You understand that abuse of this setting may result in termination of your Google account.
It may take some time for this designation to be fully implemented in applicable Google services. This designation will
only apply to ad requests for which you have set this method.
For purposes of the [Children's Online Privacy Protection Act (COPPA)](https://www.ftc.gov/business-guidance/privacy-security/childrens-privacy), there is a setting called tagForChildDirectedTreatment.
As an app developer, you can indicate whether you want Google to treat your content as child-directed when you make an ad request. When you indicate that you want Google to treat your content as child-directed, Google takes steps to disable IBA and remarketing ads on that ad request. The setting options are as follows:
- Set `tagForChildDirectedTreatment` to `true` to indicate that you want your content treated as child-directed for purposes of COPPA. This prevents the transmission of the Advertising Identifier, IDFA.
- Set `tagForChildDirectedTreatment` to `false` to indicate that you don't want your content treated as child-directed for purposes of COPPA.
- Don't set `tagForChildDirectedTreatment` if you don't want to indicate how you would like your content treated with respect to COPPA.
By setting this tag, you certify that this notification is accurate and you are authorized to act on behalf of the owner of the app. You understand that abuse of this setting may result in termination of your Google Account.
platforms: [iphone, ipad]

- name: tagForUnderAgeOfConsent
type: Boolean
summary: his property allows you to specify whether you would like your app to be treated as users in the European Economic Area (EEA) under the age of consent, https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32016R0679.
description: |
You can mark your ad requests to receive treatment for users in the European Economic Area (EEA) under the age of consent. This feature is designed to help facilitate compliance with the [General Data Protection Regulation (GDPR)](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32016R0679). Note that you may have other legal obligations under GDPR. Review the European Union’s guidance and consult with your own legal counsel. Note that Google's tools are designed to facilitate compliance and do not relieve any particular publisher of its obligations under the law. [Learn more about how the GDPR affects publishers](https://support.google.com/admob/answer/7666366).
When using this feature, a Tag For Users under the Age of Consent in Europe (TFUA) parameter will be included in all future ad requests. This parameter disables personalized advertising, including remarketing, for that specific ad request. It also disables requests to third-party ad vendors, such as ad measurement pixels and third-party ad servers.
The setting can be used with all versions of the Google Mobile Ads SDK by setting the `tagForUnderAgeOfConsent` property on the GADMobileAds.requestConfiguration object and passing in `true`.
- Set `tagForUnderAgeOfConsent` to `true` to indicate that you want ad requests to be handled in a manner suitable for users under the age of consent. This also prevents the transmission of the Advertising Identifier, IDFA.
- Not setting `tagForUnderAgeOfConsent` indicates that you don't want ad requests to be handled in a manner suitable for users under the age of consent.
The tags to enable the `tagForChildDirectedTreatmentsetting` and `tagForUnderAgeOfConsent` shouldn't both simultaneously be set to `true`. If they are, the child-directed setting takes precedence.
platforms: [iphone, ipad]
since: 7.0.0

- name: maxAdContentRating
type: String
summary: his property allows you to specify a maximum ad content rating.
description: |
Apps can set a maximum ad content rating for all ad requests using the `maxAdContentRating` property. This setting applies to all future ad requests for the remainder of the session. The possible values for this property are based on [digital content label classifications](https://support.google.com/admob/answer/7562142), and should be one of the following Admob module constants:
- `MAX_AD_CONTENT_RATING_GENERAL`
- `MAX_AD_CONTENT_RATING_PARENTAL_GUIDANCE`
- `MAX_AD_CONTENT_RATING_TEEN`
- `MAX_AD_CONTENT_RATING_MATURE_AUDIENCE`
platforms: [iphone, ipad]
since: 7.0.0

events:
- name: didReceiveAd
Expand Down
9 changes: 7 additions & 2 deletions ios/Classes/TiAdmobModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ - (void)resetConsent:(id)unused

- (void)setTagForUnderAgeOfConsent:(id)tagForUnderAgeOfConsent
{
DEPRECATED_REMOVED(@"Admob.setTagForUnderAgeOfConsent", @"5.0.0", @"5.0.0 (Removed since Ti.Admob 5.0.0. You can set 'tagForUnderAgeOfConsent' parameter in Admob.requestConsentInfoUpdateWithParameters() )");
DEPRECATED_REMOVED(@"Admob.setTagForUnderAgeOfConsent", @"5.0.0", @"5.0.0 (Removed since Ti.Admob 5.0.0. You can set 'tagForUnderAgeOfConsent' parameter in Admob.requestConsentInfoUpdateWithParameters() or in Admob.createView() )");
/*
ENSURE_TYPE(tagForUnderAgeOfConsent, NSNumber);
[[PACConsentInformation sharedInstance] setTagForUnderAgeOfConsent:[TiUtils boolValue:tagForUnderAgeOfConsent]];
Expand All @@ -393,7 +393,7 @@ - (void)setTagForUnderAgeOfConsent:(id)tagForUnderAgeOfConsent

- (NSNumber *)isTaggedForUnderAgeOfConsent:(id)unused
{
DEPRECATED_REMOVED(@"Admob.isTaggedForUnderAgeOfConsent", @"5.0.0", @"5.0.0 (Removed since Ti.Admob 5.0.0. You can set 'tagForUnderAgeOfConsent' parameter in Admob.requestConsentInfoUpdateWithParameters() )");
DEPRECATED_REMOVED(@"Admob.isTaggedForUnderAgeOfConsent", @"5.0.0", @"5.0.0 (Removed since Ti.Admob 5.0.0. You can set 'tagForUnderAgeOfConsent' parameter in Admob.requestConsentInfoUpdateWithParameters() or in Admob.createView() )");
//return @([[PACConsentInformation sharedInstance] isTaggedForUnderAgeOfConsent]);
}

Expand Down Expand Up @@ -500,4 +500,9 @@ - (void)setInMobi_updateGDPRConsent:(id)updateGDPRConsent
MAKE_SYSTEM_PROP(AD_TYPE_REWARDED_VIDEO, TiAdmobAdTypeRewardedVideo);
MAKE_SYSTEM_PROP(AD_TYPE_APP_OPEN, TiAdmobAdTypeAppOpen);

MAKE_SYSTEM_STR(MAX_AD_CONTENT_RATING_GENERAL, GADMaxAdContentRatingGeneral);
MAKE_SYSTEM_STR(MAX_AD_CONTENT_RATING_PARENTAL_GUIDANCE, GADMaxAdContentRatingParentalGuidance);
MAKE_SYSTEM_STR(MAX_AD_CONTENT_RATING_TEEN, GADMaxAdContentRatingTeen);
MAKE_SYSTEM_STR(MAX_AD_CONTENT_RATING_MATURE_AUDIENCE, GADMaxAdContentRatingMatureAudience);

@end
4 changes: 4 additions & 0 deletions ios/Classes/TiAdmobView.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

- (void)setTagForChildDirectedTreatment_:(id)value;

- (void)setTagForUnderAgeOfConsent_:(id)value;

- (void)setMaxAdContentRating_:(NSString *)maxAdContentRating;

- (void)setRequestAgent_:(id)value;

- (void)setContentURL_:(id)value;
Expand Down
37 changes: 30 additions & 7 deletions ios/Classes/TiAdmobView.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,32 @@ - (void)setAdBackgroundColor_:(id)value
- (void)setTagForChildDirectedTreatment_:(id)value
{
ENSURE_TYPE(value, NSNumber);
[GADMobileAds.sharedInstance.requestConfiguration tagForChildDirectedTreatment:[TiUtils boolValue:value]];
GADMobileAds.sharedInstance.requestConfiguration.tagForChildDirectedTreatment = [TiUtils boolValue:value] ? @YES : @NO;
}

- (void)setTagForUnderAgeOfConsent_:(id)value
{
ENSURE_TYPE(value, NSNumber);
GADMobileAds.sharedInstance.requestConfiguration.tagForUnderAgeOfConsent = [TiUtils boolValue:value] ? @YES : @NO;
}

- (void)setMaxAdContentRating_:(NSString *)maxAdContentRating
{
NSLog(@"[DEBUG] MaxAdContentRating setted to: %@", maxAdContentRating);
if ([maxAdContentRating isEqualToString:GADMaxAdContentRatingGeneral]) {
[GADMobileAds.sharedInstance.requestConfiguration setMaxAdContentRating:GADMaxAdContentRatingGeneral];
} else if ([maxAdContentRating isEqualToString:GADMaxAdContentRatingParentalGuidance]) {
[GADMobileAds.sharedInstance.requestConfiguration setMaxAdContentRating:GADMaxAdContentRatingParentalGuidance];
} else if ([maxAdContentRating isEqualToString:GADMaxAdContentRatingTeen]) {
[GADMobileAds.sharedInstance.requestConfiguration setMaxAdContentRating:GADMaxAdContentRatingTeen];
} else if ([maxAdContentRating isEqualToString:GADMaxAdContentRatingMatureAudience]) {
[GADMobileAds.sharedInstance.requestConfiguration setMaxAdContentRating:GADMaxAdContentRatingMatureAudience];
} else {
NSLog(@"[DEBUG] Invalid maxAdContentRating: %@", maxAdContentRating);
}
}


- (void)setRequestAgent_:(id)value
{
ENSURE_TYPE(value, NSString);
Expand Down Expand Up @@ -278,7 +301,7 @@ - (void)requestAppOpenAd
//
[GADAppOpenAd loadWithAdUnitID:adUnitId
request:[GADRequest request]
orientation:UIInterfaceOrientationPortrait
//orientation:UIInterfaceOrientationPortrait
completionHandler:^(GADAppOpenAd *_Nullable _appOpenAd, NSError *_Nullable error) {
_isLoadingAd = NO;
if (error) {
Expand Down Expand Up @@ -407,7 +430,7 @@ - (GADAdSize)generateAdSize

- (NSString *)exampleAdId
{
return @"ca-app-pub-3940256099942544/1712485313";
return @"ca-app-pub-3940256099942544/2934735716"; // Banner demo ad unit ID
}

#pragma mark - GADBannerViewDelegate
Expand Down Expand Up @@ -494,11 +517,11 @@ - (void)adWillDismissFullScreenContent:(id<GADFullScreenPresentingAd>)ad
- (void)adDidDismissFullScreenContent:(id<GADFullScreenPresentingAd>)ad
{
if ([ad isKindOfClass:[GADAppOpenAd class]]) {
[adViewController dismissViewControllerAnimated:YES completion:nil];
_isShowingAd = NO;
appOpenAd = nil;
[adViewController dismissViewControllerAnimated:YES completion:nil];
_isShowingAd = NO;
appOpenAd = nil;
}
[self.proxy fireEvent:@"didDismissScreen" withObject:@{ @"adUnitId": adUnitId }];
}

@end
@end
Loading

0 comments on commit 2416182

Please sign in to comment.