diff --git a/README.md b/README.md index c180589..681f2ee 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # react-native-yandex-mobile-ads -Implementation Yandex ads for react native +Implementation Yandex Mobile Ads SDK for react native ## Installation @@ -37,7 +37,7 @@ $ react-native link react-native-yandex-mobile-ads ## Usage ```tsx -import { BannerView, InterstitialAdManager } from 'react-native-yandex-mobile-ads'; +import { BannerView, InterstitialAdManager, RewardedAdManager } from 'react-native-yandex-mobile-ads'; console.log('error', err)} /> -InterstitialAdManager.showAd('R-M-DEMO-320x480') +InterstitialAdManager.showAd('R-M-DEMO-interstitial') .then((didClick: boolean) => { console.log('clicked: ' + didClick); }) .catch((error: any) => { console.log('error: ' + error); }); + +RewardedAdManager.showAd('R-M-DEMO-rewarded-client-side-rtb') + .then((resp) => { + const amount = resp.amount; + const type = resp.type; + const clicked = resp.click; + console.log( + `amount: ${amount}, type: ${type}, clicked: ${clicked}` + ); + }) + .catch((error: any) => { + console.log('error: ' + error); + }); +}} ``` ## Contributing +Mobile Ads SDK [documentation](https://yandex.ru/dev/mobile-ads/doc/intro/about.html) +You can look at alternative implementations [react-native-admob](https://github.com/sbugert/react-native-admob), +[react-native-fbads](https://github.com/callstack/react-native-fbads) and implement similar code See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow. diff --git a/android/build.gradle b/android/build.gradle index 6b69c2a..9ad2a8e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -19,9 +19,9 @@ def safeExtGet(prop, fallback) { android { compileSdkVersion safeExtGet('YandexMobileAds_compileSdkVersion', 31) - buildToolsVersion safeExtGet('YandexMobileAds_buildToolsVersion', '29.0.2') + buildToolsVersion safeExtGet('YandexMobileAds_buildToolsVersion', '31.0.0') defaultConfig { - minSdkVersion safeExtGet('YandexMobileAds_minSdkVersion', 16) + minSdkVersion safeExtGet('YandexMobileAds_minSdkVersion', 24) targetSdkVersion safeExtGet('YandexMobileAds_targetSdkVersion', 31) versionCode 1 versionName "1.0" @@ -54,10 +54,8 @@ repositories { dependencies { def mobileadsVersion = safeExtGet('YandexMobileAds_mobileadsVersion', '5.2.0') - def mobmetrikaVersion = safeExtGet('YandexMobileAds_mobmetrikaVersion', '4.2.0') //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation "com.yandex.android:mobileads:$mobileadsVersion" - implementation "com.yandex.android:mobmetricalib:$mobmetrikaVersion" } diff --git a/android/src/main/java/com/reactnativeyandexmobileads/BannerView.java b/android/src/main/java/com/reactnativeyandexmobileads/BannerView.java index ddf5ed9..262b70b 100644 --- a/android/src/main/java/com/reactnativeyandexmobileads/BannerView.java +++ b/android/src/main/java/com/reactnativeyandexmobileads/BannerView.java @@ -5,6 +5,7 @@ import android.util.TypedValue; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.LifecycleEventListener; @@ -121,18 +122,26 @@ public void onAdFailedToLoad(@NonNull AdRequestError adRequestError) { event.putInt("errorCode", adRequestError.getCode()); event.putString("errorMessage", adRequestError.getDescription()); - mEventEmitter.receiveEvent(getId(), "onError", event); + sendEvent("onError", event); myAdView = null; } @Override public void onLeftApplication() { - mEventEmitter.receiveEvent(getId(), "onLeftApplication", null); + sendEvent("onLeftApplication", null); } @Override public void onReturnedToApplication() { - mEventEmitter.receiveEvent(getId(), "onReturnedToApplication", null); + sendEvent("onReturnedToApplication", null); + } + + private void sendEvent(String name, @Nullable WritableMap event) { + ReactContext reactContext = (ReactContext) getContext(); + reactContext.getJSModule(RCTEventEmitter.class).receiveEvent( + getId(), + name, + event); } } diff --git a/android/src/main/java/com/reactnativeyandexmobileads/InterstitialAdManager.java b/android/src/main/java/com/reactnativeyandexmobileads/InterstitialAdManager.java index a914775..c52c6b5 100644 --- a/android/src/main/java/com/reactnativeyandexmobileads/InterstitialAdManager.java +++ b/android/src/main/java/com/reactnativeyandexmobileads/InterstitialAdManager.java @@ -77,7 +77,7 @@ public void onImpression(ImpressionData impressionData) { @Override public void onAdClicked() { - + mDidClick = true; } @Override diff --git a/android/src/main/java/com/reactnativeyandexmobileads/RewardedAdManager.java b/android/src/main/java/com/reactnativeyandexmobileads/RewardedAdManager.java index cae7c90..bf31280 100644 --- a/android/src/main/java/com/reactnativeyandexmobileads/RewardedAdManager.java +++ b/android/src/main/java/com/reactnativeyandexmobileads/RewardedAdManager.java @@ -2,11 +2,13 @@ import androidx.annotation.NonNull; +import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.LifecycleEventListener; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.WritableMap; import com.yandex.mobile.ads.common.AdRequest; import com.yandex.mobile.ads.common.AdRequestError; import com.yandex.mobile.ads.rewarded.Reward; @@ -78,7 +80,7 @@ public void onImpression(ImpressionData impressionData) { @Override public void onAdClicked() { - + mDidClick = true; } @Override @@ -111,13 +113,18 @@ public void onAdDismissed() { @Override public void onRewarded(@NonNull Reward reward) { - mPromise.resolve(mDidClick); + WritableMap event = Arguments.createMap(); + + event.putInt("amount", reward.getAmount()); + event.putString("type", reward.getType()); + event.putBoolean("click", mDidClick); + + mPromise.resolve(event); cleanUp(); } @Override public void onLeftApplication() { - mDidClick = true; } @Override diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 0c72fdd..713440a 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -205,8 +205,7 @@ dependencies { } implementation project(':reactnativeyandexmobileads') - implementation 'com.yandex.android:mobileads:4.2.0' - implementation 'com.yandex.android:mobmetricalib:3.20.1' + implementation 'com.yandex.android:mobileads:5.2.0' } // Run this once to be able to run the application with BUCK diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 4cfc05b..bbca14c 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -15,6 +15,7 @@ android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" + android:exported="true" android:windowSoftInputMode="adjustResize"> diff --git a/example/android/build.gradle b/example/android/build.gradle index ef4b449..03284b3 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -2,10 +2,10 @@ buildscript { ext { - buildToolsVersion = "29.0.2" - minSdkVersion = 16 - compileSdkVersion = 29 - targetSdkVersion = 29 + buildToolsVersion = "31.0.0" + minSdkVersion = 24 + compileSdkVersion = 31 + targetSdkVersion = 31 } repositories { google() diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 21578ac..3e38d74 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -185,9 +185,10 @@ PODS: - React-cxxreact (= 0.63.4) - React-jsi (= 0.63.4) - React-jsinspector (0.63.4) - - react-native-yandex-mobile-ads (0.3.0): + - react-native-yandex-mobile-ads (0.3.6): - React-Core - - YandexMobileAds (= 4.3.1) + - YandexMobileAds + - YandexMobileAdsInstream - React-RCTActionSheet (0.63.4): - React-Core/RCTActionSheetHeaders (= 0.63.4) - React-RCTAnimation (0.63.4): @@ -248,17 +249,19 @@ PODS: - React-Core (= 0.63.4) - React-cxxreact (= 0.63.4) - React-jsi (= 0.63.4) - - YandexMobileAds (4.3.1): - - YandexMobileAds/Static (= 4.3.1) - - YandexMobileAds/Static (4.3.1): - - YandexMobileMetrica (< 4.0.0, >= 3.14.1) - - YandexMobileMetrica (3.17.0): - - YandexMobileMetrica/Static (= 3.17.0) - - YandexMobileMetrica/Static (3.17.0): - - YandexMobileMetrica/Static/Core (= 3.17.0) - - YandexMobileMetrica/Static/Crashes (= 3.17.0) - - YandexMobileMetrica/Static/Core (3.17.0) - - YandexMobileMetrica/Static/Crashes (3.17.0): + - YandexMobileAds (5.1.0): + - YandexMobileAds/Static (= 5.1.0) + - YandexMobileAds/Static (5.1.0): + - YandexMobileMetrica (< 5.0.0, >= 4.0.0) + - YandexMobileAdsInstream (0.11.0): + - YandexMobileAds (~> 5.1.0) + - YandexMobileMetrica (4.2.0): + - YandexMobileMetrica/Static (= 4.2.0) + - YandexMobileMetrica/Static (4.2.0): + - YandexMobileMetrica/Static/Core (= 4.2.0) + - YandexMobileMetrica/Static/Crashes (= 4.2.0) + - YandexMobileMetrica/Static/Core (4.2.0) + - YandexMobileMetrica/Static/Crashes (4.2.0): - YandexMobileMetrica/Static/Core - Yoga (1.14.0) @@ -297,6 +300,7 @@ SPEC REPOS: trunk: - boost-for-react-native - YandexMobileAds + - YandexMobileAdsInstream - YandexMobileMetrica EXTERNAL SOURCES: @@ -372,7 +376,7 @@ SPEC CHECKSUMS: React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31 React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949 React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a - react-native-yandex-mobile-ads: e7d932b670bd05ab4579ea0256a37aeb7085ed35 + react-native-yandex-mobile-ads: 8a789d8457719482b02b0a3954ffb7aab8db921e React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336 React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0 @@ -383,10 +387,11 @@ SPEC CHECKSUMS: React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b - YandexMobileAds: 8f9bdf380364875c468ded8f33bf6e9cc711b3a2 - YandexMobileMetrica: 9e713c16bb6aca0ba63b84c8d7b8b86d32f4ecc4 + YandexMobileAds: 45b76c6321cbfaca2527f99ba280a5381a60a7d1 + YandexMobileAdsInstream: 837123da818502bb467e7f4a6aaf5ce83b006b73 + YandexMobileMetrica: f5f9c605eaaba33ff6ab2b6bc3259035ca60ed87 Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6 PODFILE CHECKSUM: 033c5c63aa0fd74cc3ae49dd714e9a8fdb0d68ac -COCOAPODS: 1.10.1 +COCOAPODS: 1.11.3 diff --git a/example/ios/Void.swift b/example/ios/Void.swift new file mode 100644 index 0000000..6401dd6 --- /dev/null +++ b/example/ios/Void.swift @@ -0,0 +1,8 @@ +// +// Void.swift +// YandexMobileAdsExample +// +// Created by valery on 21.08.2022. +// + +import Foundation diff --git a/example/ios/YandexMobileAdsExample.xcodeproj/project.pbxproj b/example/ios/YandexMobileAdsExample.xcodeproj/project.pbxproj index a734d13..f0abb45 100644 --- a/example/ios/YandexMobileAdsExample.xcodeproj/project.pbxproj +++ b/example/ios/YandexMobileAdsExample.xcodeproj/project.pbxproj @@ -11,6 +11,7 @@ 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 1A60EAF328B2CBEF0089A794 /* Void.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A60EAF228B2CBEF0089A794 /* Void.swift */; }; 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; @@ -47,6 +48,7 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = YandexMobileAdsExample/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = YandexMobileAdsExample/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = YandexMobileAdsExample/main.m; sourceTree = ""; }; + 1A60EAF228B2CBEF0089A794 /* Void.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Void.swift; sourceTree = ""; }; 2D02E47B1E0B4A5D006451C7 /* YandexMobileAdsExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "YandexMobileAdsExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 2D02E4901E0B4A5D006451C7 /* YandexMobileAdsExample-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "YandexMobileAdsExample-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 47F7ED3B7971BE374F7B8635 /* Pods-YandexMobileAdsExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YandexMobileAdsExample.debug.xcconfig"; path = "Target Support Files/Pods-YandexMobileAdsExample/Pods-YandexMobileAdsExample.debug.xcconfig"; sourceTree = ""; }; @@ -117,6 +119,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */, 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 13B07FB71A68108700A75B9A /* main.m */, + 1A60EAF228B2CBEF0089A794 /* Void.swift */, ); name = YandexMobileAdsExample; sourceTree = ""; @@ -265,8 +268,7 @@ TestTargetID = 13B07F861A680F5B00A75B9A; }; 13B07F861A680F5B00A75B9A = { - DevelopmentTeam = V92TAEDMJJ; - LastSwiftMigration = 1120; + LastSwiftMigration = 1340; }; 2D02E47A1E0B4A5D006451C7 = { CreatedOnToolsVersion = 8.2.1; @@ -393,7 +395,7 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-YandexMobileAdsExample/Pods-YandexMobileAdsExample-resources.sh", "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle", - "${PODS_ROOT}/YandexMobileAds/static/YandexMobileAds.framework/YandexMobileAdsBundle.bundle", + "${PODS_ROOT}/YandexMobileAds/static/YandexMobileAds.xcframework/YandexMobileAdsBundle.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( @@ -460,6 +462,7 @@ files = ( 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, + 1A60EAF328B2CBEF0089A794 /* Void.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -499,6 +502,7 @@ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -507,6 +511,11 @@ INFOPLIST_FILE = YandexMobileAdsExampleTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -521,11 +530,17 @@ 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; INFOPLIST_FILE = YandexMobileAdsExampleTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -544,7 +559,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = V92TAEDMJJ; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = YandexMobileAdsExample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -568,7 +583,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = V92TAEDMJJ; + DEVELOPMENT_TEAM = ""; "HEADER_SEARCH_PATHS[arch=*]" = ( "$(inherited)", "\"${PODS_ROOT}/Headers/Public\"", @@ -618,6 +633,11 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "YandexMobileAdsExample-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -645,6 +665,11 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "YandexMobileAdsExample-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -671,6 +696,11 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "YandexMobileAdsExample-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -697,6 +727,11 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "YandexMobileAdsExample-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", + "\"$(inherited)\"", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -761,7 +796,7 @@ LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; LIBRARY_SEARCH_PATHS = ( "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", - "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = YES; @@ -814,7 +849,7 @@ LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)"; LIBRARY_SEARCH_PATHS = ( "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", - "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"", + "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.2/$(PLATFORM_NAME)\"", "\"$(inherited)\"", ); MTL_ENABLE_DEBUG_INFO = NO; diff --git a/example/ios/YandexMobileAdsExample/Images.xcassets/AppIcon.appiconset/Contents.json b/example/ios/YandexMobileAdsExample/Images.xcassets/AppIcon.appiconset/Contents.json index 118c98f..8121323 100644 --- a/example/ios/YandexMobileAdsExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/example/ios/YandexMobileAdsExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -2,37 +2,52 @@ "images" : [ { "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/example/src/App.tsx b/example/src/App.tsx index 5da88d3..c19138a 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,19 +1,19 @@ import React, { Component } from 'react'; import { Button, StyleSheet, View } from 'react-native'; -import { BannerView } from 'react-native-yandex-mobile-ads'; import { + BannerView, InterstitialAdManager, RewardedAdManager, } from 'react-native-yandex-mobile-ads'; -export default class BannerAd extends Component { +export default class ExampleAd extends Component { render() { return ( console.log('onLoad')} onLeftApplication={() => console.log('onLeftApplication')} onReturnedToApplication={() => @@ -21,34 +21,39 @@ export default class BannerAd extends Component { } onError={(err: any) => console.log('error', err)} /> - -