Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…dmob into appcelerator-modules-master
  • Loading branch information
Astrovic committed Jan 15, 2021
1 parent 6c20069 commit 077b4f0
Show file tree
Hide file tree
Showing 47 changed files with 175 additions and 316 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ ios/dist/

# These should eventually be linted as well
android/example/
ios/example/
ios/example/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ ios/admob.xcodeproj/project.xcworkspace/xcuserdata/*

node_modules/

TESTS-*.xml
TESTS-*.xml
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ iphone/platform/
test/
apidoc/
Jenkinsfile
dangerfile.js
dangerfile.js
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ buildModule {
iosLabels = 'osx && xcode-12'
npmPublish = isMaster // By default it'll do github release on master anyways too
npmPublishArgs = '--access public --dry-run'
}
}
10 changes: 5 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
dependencies {
implementation 'com.google.android.ads.consent:consent-library:1.0.8'
implementation 'com.facebook.android:audience-network-sdk:5.11.0'
implementation 'com.google.ads.mediation:facebook:5.11.0.0'
implementation 'com.facebook.android:audience-network-sdk:5.6.1'
implementation 'com.google.ads.mediation:facebook:5.6.1.0'
implementation 'com.google.android.gms:play-services-base:17.1.0'
implementation 'com.google.android.gms:play-services-ads:19.2.0'
implementation 'com.google.android.gms:play-services-ads-base:19.2.0'
implementation 'com.google.android.gms:play-services-ads:18.3.0'
implementation 'com.google.android.gms:play-services-ads-base:18.3.0'
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
implementation 'com.google.android.gms:play-services-ads-lite:19.2.0'
implementation 'com.google.android.gms:play-services-ads-lite:18.3.0'
}
8 changes: 2 additions & 6 deletions android/documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Change Log

v5.0.2 Update Google Mobile Ads SDK 19.2.0
Update Audience Network SDK 5.11.0
Update Facebook Adapter 5.11.0.0

<pre>

v4.5.0 Update APIs to match the Swift version of the iOS part of the module. Set Titanium 8.0.0 as minimum.
v4.5.0 Update APIs to match the Swift version of the iOS part of the module. Set Titanium 8.0.0 as minimum.

v4.4.0 Maintain API parity with iOS module and introduce Interstitial ads support on Android.

v4.3.0 Support the Facebook Audience Network adapter
Android integration guide: https://developers.google.com/admob/android/mediation/facebook

v4.2.1 Fix Kroll annotation for requestConsentInfoUpdateForPublisherIdentifiers.

v4.2.0 Expose getId() and isAdTrackingLimited() from AdvertisingIdClient.Info.
Expand Down
2 changes: 1 addition & 1 deletion android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# during compilation, packaging, distribution, etc.
#

version: 5.0.2
version: 5.0.1
apiversion: 4
architectures: arm64-v8a armeabi-v7a x86 x86_64
description: Titanium Admob module for Android
Expand Down
60 changes: 28 additions & 32 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,39 @@ const ENV = process.env;

// Add links to artifacts we've stuffed into the ENV.ARTIFACTS variable
async function linkToArtifacts() {
if (ENV.ARTIFACTS && (ENV.BUILD_STATUS === 'SUCCESS' || ENV.BUILD_STATUS === 'UNSTABLE')) {
const artifacts = ENV.ARTIFACTS.split(';');
if (artifacts.length !== 0) {
const artifactsListing = '- ' + artifacts.map(a => danger.utils.href(`${ENV.BUILD_URL}artifact/${a}`, a)).join('\n- ');
message(`:floppy_disk: Here are the artifacts produced:\n${artifactsListing}`);
}
}
if (ENV.ARTIFACTS && (ENV.BUILD_STATUS === 'SUCCESS' || ENV.BUILD_STATUS === 'UNSTABLE')) {
const artifacts = ENV.ARTIFACTS.split(';');
if (artifacts.length !== 0) {
const artifactsListing = '- ' + artifacts.map(a => danger.utils.href(`${ENV.BUILD_URL}artifact/${a}`, a)).join('\n- ');
message(`:floppy_disk: Here are the artifacts produced:\n${artifactsListing}`);
}
}
}

async function checkLintLog() {
const lintLog = path.join(__dirname, 'lint.log');
if (!fs.existsSync(lintLog)) {
return;
}
const contents = fs.readFileSync(lintLog, 'utf8');
fail('`npm run lint` failed, please check messages below for output.');
message(`:bomb: Here's the output of \`npm run lint\`:\n\`\`\`${contents}\`\`\``);
const lintLog = path.join(__dirname, 'lint.log');
if (!fs.existsSync(lintLog)) {
return;
}
const contents = fs.readFileSync(lintLog, 'utf8');
fail('`npm run lint` failed, please check messages below for output.');
message(`:bomb: Here's the output of \`npm run lint\`:\n\`\`\`${contents}\`\`\``);
}

async function main() {
// do a bunch of things in parallel
// Specifically, anything that collects what labels to add or remove has to be done first before...
await Promise.all([
junit({
pathToReport: './TESTS-*.xml'
}),
dependencies({
type: 'npm'
}),
linkToArtifacts(),
checkLintLog(),
moduleLint(),
]);
// do a bunch of things in parallel
// Specifically, anything that collects what labels to add or remove has to be done first before...
await Promise.all([
junit({ pathToReport: './TESTS-*.xml' }),
dependencies({ type: 'npm' }),
linkToArtifacts(),
checkLintLog(),
moduleLint(),
]);
}
main()
.then(() => process.exit(0))
.catch(err => {
fail(err.toString());
process.exit(1);
});
.then(() => process.exit(0))
.catch(err => {
fail(err.toString());
process.exit(1);
});
4 changes: 1 addition & 3 deletions ios/Classes/TiAdmobModuleAssets.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
*/
#import "TiAdmobModuleAssets.h"

extern NSData* filterDataInRange(NSData* thedata, NSRange range);
extern NSData *filterDataInRange(NSData *thedata, NSRange range);

@implementation TiAdmobModuleAssets

- (NSData *)moduleAsset
{


return nil;
}

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


return nil;
}
Expand Down
17 changes: 10 additions & 7 deletions ios/Classes/TiAdmobView.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,9 @@ - (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestErro
return;
}

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

- (void)adViewWillPresentScreen:(GADBannerView *)adView
Expand Down Expand Up @@ -377,8 +378,9 @@ - (void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADReque
return;
}

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

- (void)interstitialWillPresentScreen:(GADInterstitial *)ad
Expand All @@ -401,9 +403,10 @@ - (void)interstitialWillDismissScreen:(GADInterstitial *)ad

- (void)interstitialDidDismissScreen:(GADInterstitial *)ad
{
TiThreadPerformOnMainThread(^{
[self removeFromSuperview];
},
TiThreadPerformOnMainThread(
^{
[self removeFromSuperview];
},
NO);

if (![[self proxy] _hasListeners:@"didDismissScreen"]) {
Expand Down
23 changes: 1 addition & 22 deletions ios/documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
# Change Log

v3.0.1 Update AdMob SDK to 7.69.0
Update Audience Network SDK 6.2.0
Update Facebook Adapter 6.2.0.0
AppTrackingTransparency (iOS 14)

v2.5.2 Update AdMob SDK to 7.64.0
Update Audience Network SDK 5.10.1
Update Facebook Adapter 5.10.1.0

<pre>
v2.4.4 Update AdMob SDK to 7.59.0
Update PersonalizedAdConsent to 1.5.0 (Removed all references to deprecated UIWebView)
Update Audience Network SDK 5.8.0
Update Facebook Adapter 5.8.0.2

v2.4.3 Update AdMob SDK to 7.57.0
Update Audience Network SDK 5.7.1

v2.4.2 Added support for Rewarded Video Ads.
Update AdMob SDK to 7.47.0
Update Audience Network SDK 5.4.0

v2.5.0 Updated to Admob iOS SDK to 7.49.0
v2.4.0 Support the Facebook Audience Network adapter
iOS integration guide: https://developers.google.com/admob/ios/mediation/facebook

Expand Down
2 changes: 1 addition & 1 deletion 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: 3.0.1
version: 3.0.0
architectures: armv7 x86_64 arm64
mac: false
description: AdMob module for ad delivery via AdMob
Expand Down
Binary file modified ios/platform/FBAudienceNetwork.framework/FBAudienceNetwork
Binary file not shown.
31 changes: 5 additions & 26 deletions ios/platform/FBAudienceNetwork.framework/Headers/FBAdSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,6 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAdSettings : NSObject
*/
@property (class, nonatomic, copy, readonly) NSString *routingToken;

/**
User's consent for advertiser tracking.
The setter API only works in iOS14 or above and won't take effect in iOS13 or below.
*/
+ (void)setAdvertiserTrackingEnabled:(BOOL)advertiserTrackingEnabled;

/**
Returns test mode on/off.
*/
Expand All @@ -141,6 +134,8 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAdSettings : NSObject
@param deviceHash The id of the device to use test mode, can be obtained from debug log or testDeviceHash
Copy the current device Id from debug log and add it as a test device to get test ads. Apps
running on emulator will automatically get test ads. Test devices should be added before loadAd is called.
*/
Expand Down Expand Up @@ -201,7 +196,9 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAdSettings : NSObject
/**
Sets the url prefix to use when making ad requests.
This method should never be used in production.
This method should never be used in production.
*/
+ (void)setUrlPrefix:(nullable NSString *)urlPrefix;

Expand All @@ -215,24 +212,6 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAdSettings : NSObject
*/
+ (void)setLogLevel:(FBAdLogLevel)level;

/// Data processing options.
/// Please read more details at https://developers.facebook.com/docs/marketing-apis/data-processing-options
///
/// @param options Processing options you would like to enable for a specific event. Current accepted value is LDU for
/// Limited Data Use.
/// @param country A country that you want to associate to this data processing option. Current accepted values are 1,
/// for the United States of America, or 0, to request that we geolocate that event.
/// @param state A state that you want to associate with this data processing option. Current accepted values are 1000,
/// for California, or 0, to request that we geolocate that event.
+ (void)setDataProcessingOptions:(NSArray<NSString *> *)options country:(NSInteger)country state:(NSInteger)state;

/// Data processing options.
/// Please read more details at https://developers.facebook.com/docs/marketing-apis/data-processing-options
///
/// @param options Processing options you would like to enable for a specific event. Current accepted value is LDU for
/// Limited Data Use.
+ (void)setDataProcessingOptions:(NSArray<NSString *> *)options;

@end

@protocol FBAdLoggingDelegate <NSObject>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ FB_EXPORT void FBAdSettingsBridgeAddTestDevice(char const *deviceID);
FB_EXPORT void FBAdSettingsBridgeSetURLPrefix(char const *urlPrefix);
FB_EXPORT void FBAdSettingsBridgeSetIsChildDirected(bool isChildDirected);
FB_EXPORT void FBAdSettingsBridgeSetMixedAudience(bool mixedAudience);
FB_EXPORT void FBAdSettingsBridgeSetAdvertiserTrackingEnabled(bool advertiserTrackingEnabled);
FB_EXPORT void FBAdSettingsBridgeSetDataProcessingOptions(char const *_Nonnull options[], int length);
FB_EXPORT void FBAdSettingsBridgeSetDetailedDataProcessingOptions(char const *_Nonnull options[],
int length,
int country,
int state);
FB_EXPORT char const *__nullable FBAdSettingsBridgeGetBidderToken(void);

FB_EXTERN_C_END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#import <FBAudienceNetwork/FBAdExtraHint.h>
#import <FBAudienceNetwork/FBAdIconView.h>
#import <FBAudienceNetwork/FBAdOptionsView.h>
#import <FBAudienceNetwork/FBAdSDKNotificationManager.h>
#import <FBAudienceNetwork/FBAdSettings.h>
#import <FBAudienceNetwork/FBAdView.h>
#import <FBAudienceNetwork/FBAudienceNetworkAds.h>
Expand Down Expand Up @@ -58,4 +57,4 @@
// NOTE: Any changes should also be made to the module.modulemap
// to ensure comptability with Swift apps using Cocoapods

#define FB_AD_SDK_VERSION @"6.2.0"
#define FB_AD_SDK_VERSION @"5.9.0"
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ typedef NS_ENUM(NSInteger, FBAdFormatTypeName) {
FBAdFormatTypeNameUnknown = 0,
FBAdFormatTypeNameBanner,
FBAdFormatTypeNameInterstitial,
FBAdFormatTypeNameInstream,
FBAdFormatTypeNameNative,
FBAdFormatTypeNameNativeBanner,
FBAdFormatTypeNameRewardedVideo,
Expand All @@ -90,6 +91,13 @@ FB_CLASS_EXPORT FB_SUBCLASSING_RESTRICTED @interface FBAudienceNetworkAds : NSOb
+ (void)initializeWithSettings:(nullable FBAdInitSettings *)settings
completionHandler:(nullable void (^)(FBAdInitResults *results))completionHandler;

/**
Returns ad format type name for a given placement id.
@param placementId Placement id that is configured for the current app.
*/
+ (FBAdFormatTypeName)adFormatTypeNameForPlacementId:(NSString *)placementId;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit 077b4f0

Please sign in to comment.