Giter VIP home page Giter VIP logo

mobile-sdk-ios's Introduction

Appnexus iOS SDK

Caution

We no longer release source code updates of iOS SDK to Github. This is not a deprecation of our SDK, only an open-source deprecation as we are taking our Android and iOS Mobile SDKs private.
Future updates starting from SDK v9.0 will be released only as compiled .xcframework binary file and will be available for apps to download and integrate through CocoaPods, Swift Package Manager, Carthage and Direct download.
Please contact your account managers or submit a ticket via the Customer Support Portal: https://help.xandr.com/ if you have any questions.

See the documentation on our wiki here: https://docs.xandr.com/bundle/mobile-sdk/page/xandr-mobile-sdks.html

Get the latest release notes here: https://docs.xandr.com/bundle/mobile-sdk/page/ios-sdk-release-notes.html

Use Cocoapods?

Easily include the AppNexus SDK in your Podfile:

platform :ios, '12.0'

target 'MyAmazingApp' do
pod 'AppNexusSDK'
end

mobile-sdk-ios's People

Contributors

akashvermacardinal avatar anwzhang avatar asharmaa avatar avermaios avatar avohraa avatar clausjoergensen avatar davidappnexus avatar erikpoort avatar geir avatar kirubakarmuruganandam avatar kowshickkarthick avatar mkuliszkiewicz avatar piidro avatar ppuviarasu avatar pyrtsa avatar ronlissack avatar rpagaria avatar saik0s avatar syn-deepakbadiger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobile-sdk-ios's Issues

AppNexus SDK causing memory leaks (`createOMIDAdSessionforNative`)

We have noticed memory leaks related to AppNexus SDK. It happens with the latest SDK (7.11) and previous one as well. After several ad requests, in few minutes, the memory usage jumps from ~100MB to over 500MB and the test device heats very much. On our side (the integration) it seems that everything is retained correctly.

We have been able to narrow the issue to the registerOMID function inside ANNativeAdResponse.m, specifically line 191:

self.omidAdSession = [[ANOMIDImplementation sharedInstance] createOMIDAdSessionforNative:self.viewForTracking withScript:scripts];

The above line probably creates some retain cycles and memory leaks.

Setting the enableOpenMeasurement flag to false on app start solves the issue. However, as we correctly understand the consequences of such change we cannot do it (limited tracking).

Could you please fix those memory leaks?

CocoaPods support

Hi!
I see you are doing a manual release and distribution. This also means that SDK users have to integrate the SDK manually into the project.

Have you considered added CocoaPods support? It's very popular now and simplifies integration. I have noticed you are using external dependencies for other ads providers. This can also be handled by CocoaPods as most of the ads services already support it.

Would like to hear your thoughts.

Stop using EKEventStore

Apps compiled with AppNexus SDK will get rejected by Apple due to the usage of -[EKEventStore requestAccessToEntityType: completion:], unless the key NSCalendarsUsageDescription is specified in the app's Info.plist.

This functionality should be removed, documented and/or made optional (eg: through the usage of a subspec) so apps are not forced to include the NSCalendarsUsageDescription.

ANMediationContainerView doesn't resize when use SmartMediation

Hello AppNexus Team,

We've update to your lastest version 5.1.1 to support Smart Mediation.
To get the format Parallax and Video Smart:
we have sent request as following code:

let banner = ANBannerAdView(frame: frame, memberId: memberID, inventoryCode: inventoryCode, adSize: CGSize(width: 320, height: 180))

we have response. and our ANBannerAdView has been resize to fit the tableview, but we have a margin white around ANMediationContainerView,
We've already use the following code, banner?.shouldResizeAdToFitContainer = true
but truns out that ANMediationContainerView doesn't fit the size of ANBannerAdView.

screenshot 2019-02-22 at 18 06 52

Do you have idea about it ?
Thank you for your attention.

Cannot alter appearance proxy for toolbar on a webview ad

Hey all,

I'm working on an issue at Shazam; our default appearance proxy settings for window and UIToolBar tintColor leave us with invisible controls (white on white) on the toolbar of some fullscreen web ads served through your SDK.

I believe you sent some sample code that suggested setting these properties in the adWillPresent callback (and then resetting them in adWillClose). However, that callback does not happen early enough; it seems the views in question must already have been added to the window at that point, as they do not respond to the appearance changes. I tried a few other callbacks but couldn't get one to work.

So, just a couple of quick questions:

  1. Do you know of a presentation callback that fires for ads in the in-SDK browser, before that browser is added to a window?
  2. Preferably, is there an exposed UIView subclass that acts as a superview for the in-SDK browser, so that I can just use appearanceWhenContainedIn during our initial group of appearance proxy calls?

Any help appreciated.

Segmentation fault in `+[OMIDAppnexusScriptInjector injectScriptContent:intoHTML:error:]`

Application which uses AppNexus 4.11 SDK crashes with the following stack:

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x88b38
Crashed Thread:  0

Application Specific Information:
Selector name found in current argument registers: injectScriptContent:intoHTML:error:

Thread 0 Crashed:
0   libobjc.A.dylib                      0x00000001837801a0 objc_retain + 16
1   AppNexusSDK                          0x0000000102d2f628 +[OMIDAppnexusScriptInjector injectScriptContent:intoHTML:error:] (OMIDScriptInjector.m:27)
2   AppNexusSDK                          0x0000000102d1bcb0 -[ANOMIDImplementation prependOMIDJSToHTML:] (ANOMIDImplementation.m:147)
3   AppNexusSDK                          0x0000000102cf36dc -[ANAdWebViewController initWithSize:HTML:webViewBaseURL:configuration:] (ANAdWebViewController.m:182)
4   AppNexusSDK                          0x0000000102cf3514 -[ANAdWebViewController initWithSize:HTML:webViewBaseURL:] (ANAdWebViewController.m:149)
5   AppNexusSDK                          0x0000000102d0bce8 -[ANMRAIDContainerView initWithSize:HTML:webViewBaseURL:] (ANMRAIDContainerView.m:145)
6   AppNexusSDK                          0x0000000102d229a8 -[ANUniversalAdFetcher handleStandardAd:] (ANUniversalAdFetcher.m:419)
7   AppNexusSDK                          0x0000000102d2209c -[ANUniversalAdFetcher continueWaterfall] (ANUniversalAdFetcher.m:0)
8   AppNexusSDK                          0x0000000102d21a40 -[ANUniversalAdFetcher processAdServerResponse:] (ANUniversalAdFetcher.m:206)
9   AppNexusSDK                          0x0000000102d2180c __33-[ANUniversalAdFetcher requestAd]_block_invoke.86 (ANUniversalAdFetcher.m:165)
10  libdispatch.dylib                    0x0000000183e9caa0 _dispatch_call_block_and_release + 20
11  libdispatch.dylib                    0x0000000183e9ca60 _dispatch_client_callout + 12
12  libdispatch.dylib                    0x0000000183eddd80 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 960
13  CoreFoundation                       0x0000000184553070 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
14  CoreFoundation                       0x0000000184550bc8 __CFRunLoopRun + 2268
15  CoreFoundation                       0x0000000184470da8 CFRunLoopRunSpecific + 548
16  GraphicsServices                     0x0000000186456020 GSEventRunModal + 96
17  UIKit                                0x000000018e490758 UIApplicationMain + 232
...

The problem is that implementation of this method is inside the pre-built library libOMSDKAppnexus.a, so it's not possible to deduce what's happening inside the closed source OMIDScriptInjector.m:27.

Critical Bug when retrieving creative assets on mobile (iOS)

Hello,

  • I cannot reliabily retrieve creative assets on mobile.
  • While I can retrieve some assets in some conditions, I'm completely unable to retrieve additional creative assets (body1, body2, body3)

In my creative, I'm setting body text, sponsored by, call to action, body1, body2, body3

Here are the different values I've tried in those fields:

SMALL JSON

{"template":"NATIVE_ITM_FLAGSHIP","content": {"borderColor":"#d0021b", "redirectionDeeplink":"test://www.test.com/catalogues/", "redirectionUrl":"https://www.test.com/catalogues/", "title":"Découvrez notre gamme de jus"}}

BIG JSON

{"template":"NATIVE_ITM_FLAGSHIP","content":
  {"borderColor":"#d0021b","callToAction":{"backgroundColor":"#d0021b","backgroundHoverColor":"#d0021b","text":"Je découvre","textColor":"#ffffff","textHoverColor":"#ffffff"},
  "redirectionDeeplink":"test://www.test.com/catalogues/",
  "redirectionUrl":"https://www.test.com/catalogues/",
  "title":"Découvrez notre gamme de jus","variants":
  [{"products":["3175460001625","3073780982818"],"variant":"Multifruits"},{"products":["3175460001625","3073780982818"],"variant":"Tropical"},{"products":["3175460001625","3073780982818"],"variant":"Orange"},{"products":["3175460001625","3073780982818"],"variant":"Fruits rouges"}]}}

base64

eyJ0ZW1wbGF0ZSI6Ik5BVElWRV9JVE1fRkxBR1NISVAiLCJjb250ZW50IjoKICB7ImJvcmRlckNvbG9yIjoiI2QwMDIxYiIsImNhbGxUb0FjdGlvbiI6eyJiYWNrZ3JvdW5kQ29sb3IiOiIjZDAwMjFiIiwiYmFja2dyb3VuZEhvdmVyQ29sb3IiOiIjZDAwMjFiIiwidGV4dCI6IkplIGTDqWNvdXZyZSIsInRleHRDb2xvciI6IiNmZmZmZmYiLCJ0ZXh0SG92ZXJDb2xvciI6IiNmZmZmZmYifSwKICAicmVkaXJlY3Rpb25EZWVwbGluayI6InRlc3Q6Ly93d3cudGVzdC5jb20vY2F0YWxvZ3Vlcy8iLAogICJyZWRpcmVjdGlvblVybCI6Imh0dHBzOi8vd3d3LnRlc3QuY29tL2NhdGFsb2d1ZXMvIiwKICAidGl0bGUiOiJEw6ljb3V2cmV6IG5vdHJlIGdhbW1lIGRlIGp1cyIsInZhcmlhbnRzIjoKICBbeyJwcm9kdWN0cyI6WyIzMTc1NDYwMDAxNjI1IiwiMzA3Mzc4MDk4MjgxOCJdLCJ2YXJpYW50IjoiTXVsdGlmcnVpdHMifSx7InByb2R1Y3RzIjpbIjMxNzU0NjAwMDE2MjUiLCIzMDczNzgwOTgyODE4Il0sInZhcmlhbnQiOiJUcm9waWNhbCJ9LHsicHJvZHVjdHMiOlsiMzE3NTQ2MDAwMTYyNSIsIjMwNzM3ODA5ODI4MTgiXSwidmFyaWFudCI6Ik9yYW5nZSJ9LHsicHJvZHVjdHMiOlsiMzE3NTQ2MDAwMTYyNSIsIjMwNzM3ODA5ODI4MTgiXSwidmFyaWFudCI6IkZydWl0cyByb3VnZXMifV19fQ==

Small Text
TEST BODY TEXT

Results:

image

As you can see, the behavior on mobile is unexpected:

  • Text can be retrieved
  • Base64 encoded JSON can't be retrieved unless it's in sponsoredBy
  • A Small JSON can be retrieved in bodyText and sponsoredBy, but a larger JSON can only be retrieved in sponsoredBy. Could it be an issue regarding some unexpected/unauthorized/unescaped characters in the JSON ?
  • Body1, Body2, Body3 are never retrieved properly on mobile, but this could be an issue with our code.
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.title = "Native Ad"
        
        // Do any additional setup after loading the view.
        nativeAdRequest = ANNativeAdRequest()
        nativeAdRequest!.placementId = "placementId" 
        nativeAdRequest!.forceCreativeId = myCreativeId
        nativeAdRequest!.shouldLoadIconImage = true
        nativeAdRequest!.shouldLoadMainImage = true
        nativeAdRequest!.delegate = self
        nativeAdRequest!.loadAd()
    }
    
    
    func adRequest(_ request: ANNativeAdRequest, didReceive response: ANNativeAdResponse) {
        self.nativeAdResponse = response
        let adNib = UINib(nibName: "ANNativeAdView", bundle: Bundle.main)
        let array = adNib.instantiate(withOwner: self, options: nil)
        let nativeAdView = array.first as? ANNativeAdView
        nativeAdView?.titleLabel.text = nativeAdResponse?.title
        nativeAdView?.bodyLabel.text = nativeAdResponse?.body
        nativeAdView?.iconImageView.image = nativeAdResponse?.iconImage
        nativeAdView?.mainImageView.image = nativeAdResponse?.mainImage
        nativeAdView?.sponsoredLabel.text = nativeAdResponse?.sponsoredBy
        print("CUSTOMELEMENTS", nativeAdResponse?.customElements)
        print("CREATIVE ID", nativeAdResponse?.creativeId)
        print("BODY", nativeAdResponse?.body)
        print("DESCRIPTION", nativeAdResponse?.additionalDescription)
        print("SPONSORED BY", nativeAdResponse?.sponsoredBy)
        print("CALL TO ACTION", nativeAdResponse?.callToAction)
        nativeAdView?.callToActionButton.setTitle(nativeAdResponse?.callToAction, for: .normal)
        nativeAdResponse?.delegate = self
        nativeAdResponse?.clickThroughAction = ANClickThroughAction.openSDKBrowser
        view.addSubview(nativeAdView!)
        do {
            try nativeAdResponse?.registerView(forTracking: nativeAdView!, withRootViewController: self, clickableViews: [nativeAdView?.callToActionButton! as Any, nativeAdView?.mainImageView! as Any])
        } catch {
            print("Failed to registerView for Tracking")
        }        
    }

feel free to ask for any details that could speed up the investigation of this issue,

Anton

Is there any progress on this issue?

Not sure how to get your attention. Is there any progress on this issue?


Is there any progress on this issue?

dyld[3804]: Library not loaded: @rpath/OMSDK_Appnexus.framework/OMSDK_Appnexus
  Referenced from: /private/var/containers/Bundle/Application/8A27702B-F189-4A27-ABD9-4A51BB734D83/JPNews.app/Frameworks/AppNexusSDK.framework/AppNexusSDK
  Reason: tried: '/Users/toke.refstrup/Library/Caches/JetBrains/AppCode2021.2/DerivedData/News-gtrybevjoagxjoatqbtiihezqtby/Build/Products/Debug-iphoneos/OMSDK_Appnexus.framework/OMSDK_Appnexus' (no such file), '/private/var/containers/Bundle/Application/8A27702B-F189-4A27-ABD9-4A51BB734D83/JPNews.app/Frameworks/OMSDK_Appnexus.framework/OMSDK_Appnexus' (no such file), '/private/var/containers/Bundle/Application/8A27702B-F189-4A27-ABD9-4A51BB734D83/JPNews.app/Frameworks/AppNexusSDK.framework/Frameworks/OMSDK_Appnexus.framework/OMSDK_Appnexus' (no such file), '/usr/lib/swift/OMSDK_Appnexus.framework/OMSDK_Appnexus' (no such file), '/private/var/containers/Bundle/Application/8A27702B-F189-4A27-ABD9-4A51BB734D83/JPNews.app/Frameworks/OMSDK_Appnexus.framework/OMSDK_Appnexus' (no such file), '/usr/lib/swift/OMSDK_Appnexus.framework/OMSDK_Appnexus' (no such file), '/private/var/containers/Bundle/Application/8A27702B-F189-4A27-ABD9-4A51BB734D83/JPNews.app/Frameworks/OMSDK_Appnexus.framework/OMSDK_Appnexus' (no such file), '/System/Library/Frameworks/OMSDK_Appnexus.framework/OMSDK_Appnexus' (no such file)
Signal: SIGABRT (signal SIGABRT)

Originally posted by @icedice in #70 (comment)

iPhone X - WKWebView scrollView gets undesired insets

We have a scenario where ANBannerAdView is inside a scroll view of ours, where we handle safe area insets etc for iPhone X. Such being the case, things break when the scroll view inside the web view contained inside ANBannerAdView gets the iPhone X automatic insets treatment. (see attached screen shot; the ad content is scrolled within the ad view itself and is therefore partially obscured).

Doing this on the web view fixes things (but since we don't have clean access to this view, I'm requesting that this is fixed inside your SDK):
webView.scrollView.contentInsetAdjustmentBehavior = .never

screen shot 2018-02-20 at 16 02 33

screen shot 2018-02-20 at 16 02 08

How to identifier different type of Google advertising without ANAdAdapterNativeAdMobAdType

Hello AppNexus Team,

In my application iOS, I am using Google as mediation. when I got the response of ANNativeAdResponse, I used to check networkCode to identifier the AdMob (Google) type.

Actually, I could received two type of Google Advertsing, as AdMobContent and AdMobInstall, I used to use ANAdAdapterNativeAdMobAdType to separate them as following code :

if let rawType = elements[kANAdAdapterNativeAdMobAdKey] as? Int, let type = ANAdAdapterNativeAdMobAdType(rawValue: rawType) { switch type { case .content: case .install: }

From your last update, ANAdAdapterNativeAdMobAdType is not available anymore.
How could I identifier different type of google advertising ?

Thank you for your attention.

Getting banner's size when creating an "ANBannerAdView" with several adSizes

Hi, I'm just starting with AppNexus and the AppNexus iOS SDK. I'm creating a banner ad using something similar to:

let ad = ANBannerAdView(frame: frame, memberId: id, inventoryCode: "code")
ad?.adSizes = [size1, size2, size3, size4]
ad?.loadAd()

I want to adjust the height of the view depending on the banner's height. I tried using ad?.adSize but it always returns the size of the first element in the array. In this case size1.

For this reason, I'm unable to adjust the height of the container view when the height is different than size1 and I end up with empty spaces. How can I get the size of the actual banner that's being used?

screen shot 2017-11-15 at 15 45 32

screen shot 2017-11-15 at 15 56 24

MRAID playVideo command always plays video full screen

I noticed in the code specifically in
[ANMRAIDContainerView adShouldPlayVideoWithUri]
in response to the playVideo command, it calls
[ANMRAIDUtil playVideoWithUri:uri fromRootViewController:withCompletionTarget:completionSelector:];
, then it plays video fullscreen, is this correct ?

because we have a problem where a video ad starts playing fullscreen once the ad is loaded without the user tapping on it, more over, the app crashes sometimes with this crash log

Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x18f9fafe0 __exceptionPreprocess 1 libobjc.A.dylib 0x18e45c538 objc_exception_throw 2 CoreFoundation 0x18f9faeb4 +[NSException raise:format:] 3 Foundation 0x190493760 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 4 UIKit 0x195da8fd0 -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] 5 UIKit 0x195e01b0c +[UIWindow _synchronizeDrawingWithPreCommitHandler:] 6 UIKit 0x195be67a8 -[UIApplication _setStatusBarHidden:animationParameters:changeApplicationFlag:] 7 UIKit 0x195b33710 -[UIApplication _updateCurrentStatusBarViewControllerAppearance] 8 UIKit 0x195ba1a80 -[UIViewController setNeedsStatusBarAppearanceUpdate] 9 UIKit 0x195c266dc -[UIViewController _setPresentedStatusBarViewController:] 10 UIKit 0x195ea163c -[UIViewController _dismissViewControllerWithAnimationController:interactionController:completion:] 11 UIKit 0x195c56848 -[UIViewController _dismissViewControllerWithTransition:from:completion:] 12 UIKit 0x195bfe6dc -[UIViewController dismissViewControllerWithTransition:completion:] 13 UIKit 0x195bfe4bc -[UIViewController dismissViewControllerWithTransition:completion:] 14 UIKit 0x195ea07e4 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] 15 UIKit 0x195bfe230 -[UIViewController dismissViewControllerAnimated:completion:] 16 AVKit 0x19d29ac50 -[AVPlayerViewController _transitionFromFullScreenViewControllerAnimated:completionHandler:] 17 AVKit 0x19d29d5f8 -[AVPlayerViewController(AVPlayerViewController_WebKitOnly) exitFullScreenAnimated:completionHandler:] 18 WebCore 0x1955c9550 WebCore::WebVideoFullscreenInterfaceAVKit::exitFullscreen(WebCore::IntRect const&) 19 WebCore 0x1955c7de8 WebCore::WebVideoFullscreenInterfaceAVKit::watchdogTimerFired() 20 WebCore 0x194576e00 WebCore::ThreadTimers::sharedTimerFiredInternal() 21 WebCore 0x194576d40 WebCore::timerFired(__CFRunLoopTimer*, void*) 22 CoreFoundation 0x18f9a9aa4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ 23 CoreFoundation 0x18f9a97a8 __CFRunLoopDoTimer 24 CoreFoundation 0x18f9a9068 __CFRunLoopDoTimers 25 CoreFoundation 0x18f9a6c8c __CFRunLoopRun 26 CoreFoundation 0x18f8d6da4 CFRunLoopRunSpecific 27 WebCore 0x1945a8d3c RunWebThread(void*) 28 libsystem_pthread.dylib 0x18eabd68c _pthread_body 29 libsystem_pthread.dylib 0x18eabd59c _pthread_body 30 libsystem_pthread.dylib 0x18eabacb4 thread_start

ANGlobal's getUserAgent return null

WKWebView's evaluateJavaScript is a async process so method useragent always return null before the data handled.
I found already have a override method evaluateJavaScript in WKWebView+ANCategory.
So used it fix the problem.
#30

Swift Package is broken

  1. We can't actually consume the package because you aren't using proper semantic versioning and releasing as major.minor.patch, and as such Xcode tries to use the latest release within such a version number scheme which is 7.7.1

You need do a 7.15.0 release to fix this.

  1. You apparently didn't test your package, because it's giving a warning about a unhandled file

found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
SourcePackages/checkouts/mobile-sdk-ios/sdk/sourcefiles/Viewability/OMSDK_Appnexus.xcframework

Interstitial ad crashes the whole application if orientation not supported

I'm testing interstitial ads in my app and it keeps crashing when the ad tries to set the orientation of the screen (I guess). The app is locked in portrait mode. I'm using the new 6.0 SDK and running the app on iOS 12.4 (iPhone XR). Even though the ad would like to change the orientation to landscape or whatever it shouldn't crash if it's disallowed.

Here's some error log...

`
2019-09-13 08:23:23.065857+0300 xxx[7142:63370] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [ANInterstitialAdViewController shouldAutorotate] is returning YES'
*** First throw call stack:
(
0 CoreFoundation 0x00000001129288db __exceptionPreprocess + 331
1 libobjc.A.dylib 0x0000000110aafac5 objc_exception_throw + 48
2 CoreFoundation 0x0000000112928735 +[NSException raise:format:] + 197
3 UIKitCore 0x000000011f996303 -[UIViewController __supportedInterfaceOrientations] + 921
4 UIKitCore 0x000000011f996859 -[UIViewController __withSupportedInterfaceOrientation:apply:] + 45
5 UIKitCore 0x000000011f9971dd -[UIViewController _updateLastKnownInterfaceOrientationOnPresentionStack:] + 223
6 UIKitCore 0x000000011ffbc405 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 165
7 UIKitCore 0x000000011f89f04a -[_UIFullscreenPresentationController _placeCounterRotationViewWithView:inWindow:fromOrientation:toOrientation:force:] + 560
8 UIKitCore 0x000000011f89ed5d -[_UIFullscreenPresentationController _adjustOrientationIfNecessaryInWindow:forViewController:preservingViewController:] + 887
9 UIKitCore 0x000000011f894a0e -[UIPresentationController _presentWithAnimationController:interactionController:target:didEndSelector:] + 953
10 UIKitCore 0x000000011f98991b -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1485
11 UIKitCore 0x000000011f98b516 -[UIViewController _presentViewController:withAnimationController:completion:] + 4608
12 UIKitCore 0x000000011f98ddd7 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 98
13 UIKitCore 0x000000011f98e2ef -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 511
14 UIKitCore 0x000000011f98dd3e -[UIViewController _presentViewController:animated:completion:] + 172
15 UIKitCore 0x000000011f98df9c -[UIViewController presentViewController:animated:completion:] + 150
16 almaRap 0x000000010d862e14 -[ANInterstitialAd displayAdFromViewController:autoDismissDelay:] + 2033
17 almaRap 0x000000010d84308b $s7almaRap28InterstitialAdViewControllerC012adDidReceiveD0yyypFTo + 155
18 almaRap 0x000000010d850e08 -[ANAdView adDidReceiveAd:] + 137
19 almaRap 0x000000010d863172 -[ANInterstitialAd universalAdFetcher:didFinishRequestWithResponse:] + 480
20 almaRap 0x000000010d87d6a5 -[ANUniversalAdFetcher processFinalResponse:] + 170
21 almaRap 0x000000010d87ed71 -[ANUniversalAdFetcher didCompleteFirstLoadFromWebViewController:] + 501
22 almaRap 0x000000010d8698dc __66-[ANMRAIDContainerView didCompleteFirstLoadFromWebViewController:]_block_invoke + 297
23 libdispatch.dylib 0x00000001151c1d02 _dispatch_client_callout + 8
24 libdispatch.dylib 0x00000001151c46be _dispatch_continuation_pop + 440
25 libdispatch.dylib 0x00000001151d4997 _dispatch_source_invoke + 2072
26 libdispatch.dylib 0x00000001151cd8e3 _dispatch_main_queue_callback_4CF + 911
27 CoreFoundation 0x000000011288fa79 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
28 CoreFoundation 0x000000011288a126 __CFRunLoopRun + 2310
29 CoreFoundation 0x00000001128894d2 CFRunLoopRunSpecific + 626
30 GraphicsServices 0x00000001171fa2fe GSEventRunModal + 65
31 UIKitCore 0x000000011ff7afc2 UIApplicationMain + 140
32 almaRap 0x000000010d83d51b main + 80
33 libdyld.dylib 0x000000011522f541 start + 1
34 ??? 0x0000000000000001 0x0 + 1

`

Crash [ANBrowserViewController loadAndPresentStoreControllerWithiTunesId:] sur IOS 13.0

Hello AppNexus team,

We have a crash 100% reproduced when we click sur advertising format interstitiel or native, if only the redirection url concern App Store in iOS 13.0.

Capture d’écran 2019-10-28 à 11 31 33

After investigation from our side, the problem looks comes from subclassing of SKStoreProductViewController
In apple's documentation, they mentioned that The SKStoreProductViewController class does not support subclassing or embedding, and must be used as-is. If you compile with the iOS 13 SDK, attempting to instantiate a subclass of SKStoreProductViewController results in a runtime exception.

Here is the documentation and our crash log. https://developer.apple.com/documentation/storekit/skstoreproductviewcontroller

More information about the crash, we have 300 since last week, 100% in iOS 13.0. We are using version 6.1.

Please fix it soon, thank you in advance. Have a good day !

fr.leboncoin.leboncoin_issue_crash_5a3c1e1821b14db58a982ba45288c051_DNE_1_v2.txt

Cannot implement "ANCustomAdapterBanner" protocol in Swift

My ObjC project works but I have issues with Swift.

Whenever I conform to the "ANCustomAdapterBanner" protocol I receive an error saying I need to implement required methods.

ReuestAdWithSize method is fine, the main issue comes from required delegate, if I declare it like this:
"public var delegate: ANCustomAdapterBannerDelegate?" Xcode is complaining that I am not conforming to "ANCustomAdapter". If i click on fix in Xcode it will add this delegate: "public var delegate: ANCustomAdapterDelegate?". Now I have two delegates with same name.

public var delegate: ANCustomAdapterDelegate?
public var delegate: ANCustomAdapterBannerDelegate?

If I remove one of them Xcode is complaining again about missing required delegate.
Am I doing something wrong here?
Thank you.

Error building with Carthage

When you run carthage update, with a fresh project, you get this error:

A shell task failed with exit code 66:
2016-12-02 15:29:54.482 xcodebuild[46859:559061] warning:  The file reference for "Info.plist" is a member of multiple groups ("" and ""); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
xcodebuild: error: Scheme BuildANSDKFramework is not currently configured for the build action.

BuildANSDKCocoaTouchFramework.sh fails

The following build commands failed:
CopyPlistFile out/AppNexusSDK.framework/SDKIntegrationKeys.plist AppNexusSDK/SDKIntegrationKeys.plist
(1 failure)

AN Localizations overriding parent app localizations

Pods/AppNexusSDK/sdk/Resources/Base.lproj/Localizable.strings

overwrites the parent app localizations.

Please move AN Localization string file inside AN bundle and use NSLocalizedStringFromTableInBundle instead of NSLocalizedString for the "OK" text.

SDK 5.5.1 Crash

Hi,

I have successfully integrated AppNexus in my app. However, on my first controller everything is working fine loading the ads including an interstitial as well. Once I navigate on a second controller and doing the same stuff there (ne instance of ANBannerAdView) I always get a crash with the following stack trace.

The strange thing is, when I remove the ads from the first controller, the second controller is working fine.

Any ideas what this issue below could cause from your perspective? I can not post detailled code due to company sla's

Many thanks,
Maik

2019-08-19 13:59:54.361798+0200 App[35477:8092844] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid number value (infinite) in JSON write'
*** First throw call stack:
(
0 CoreFoundation 0x000000010feb46fb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010f458ac5 objc_exception_throw + 48
2 CoreFoundation 0x000000010feb4555 +[NSException raise:format:] + 197
3 Foundation 0x0000000109be4b78 _writeJSONNumber + 547
4 Foundation 0x0000000109be1a69 _writeJSONValue + 495
5 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
6 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
7 Foundation 0x0000000109be5046 _writeJSONObject + 466
8 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
9 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
10 Foundation 0x0000000109be54ba _writeJSONArray + 300
11 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
12 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
13 Foundation 0x0000000109be5046 _writeJSONObject + 466
14 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
15 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
16 Foundation 0x0000000109be54ba _writeJSONArray + 300
17 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
18 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
19 Foundation 0x0000000109be5046 _writeJSONObject + 466
20 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
21 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
22 Foundation 0x0000000109be54ba _writeJSONArray + 300
23 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
24 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
25 Foundation 0x0000000109be5046 _writeJSONObject + 466
26 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
27 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
28 Foundation 0x0000000109be54ba _writeJSONArray + 300
29 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
30 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
31 Foundation 0x0000000109be5046 _writeJSONObject + 466
32 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
33 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
34 Foundation 0x0000000109be54ba _writeJSONArray + 300
35 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
36 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
37 Foundation 0x0000000109be5046 _writeJSONObject + 466
38 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
39 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
40 Foundation 0x0000000109be54ba _writeJSONArray + 300
41 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
42 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
43 Foundation 0x0000000109be5046 _writeJSONObject + 466
44 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
45 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
46 Foundation 0x0000000109be54ba _writeJSONArray + 300
47 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
48 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
49 Foundation 0x0000000109be5046 _writeJSONObject + 466
50 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
51 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
52 Foundation 0x0000000109be54ba _writeJSONArray + 300
53 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
54 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
55 Foundation 0x0000000109be5046 _writeJSONObject + 466
56 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
57 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
58 Foundation 0x0000000109be54ba _writeJSONArray + 300
59 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
60 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
61 Foundation 0x0000000109be5046 _writeJSONObject + 466
62 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
63 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
64 Foundation 0x0000000109be54ba _writeJSONArray + 300
65 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
66 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
67 Foundation 0x0000000109be5046 _writeJSONObject + 466
68 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
69 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
70 Foundation 0x0000000109be54ba _writeJSONArray + 300
71 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
72 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
73 Foundation 0x0000000109be5046 _writeJSONObject + 466
74 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
75 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
76 Foundation 0x0000000109be54ba _writeJSONArray + 300
77 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
78 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
79 Foundation 0x0000000109be5046 _writeJSONObject + 466
80 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
81 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
82 Foundation 0x0000000109be54ba _writeJSONArray + 300
83 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
84 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
85 Foundation 0x0000000109be5046 _writeJSONObject + 466
86 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
87 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
88 Foundation 0x0000000109be54ba _writeJSONArray + 300
89 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
90 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
91 Foundation 0x0000000109be5046 _writeJSONObject + 466
92 Foundation 0x0000000109be5c7f ___writeJSONArray_block_invoke + 130
93 CoreFoundation 0x000000010fddff0c -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 220
94 Foundation 0x0000000109be54ba _writeJSONArray + 300
95 Foundation 0x0000000109be5a98 ___writeJSONObject_block_invoke + 176
96 CoreFoundation 0x000000010ff249c2 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 226
97 Foundation 0x0000000109be5046 _writeJSONObject + 466
98 Foundation 0x0000000109be1826 -[_NSJSONWriter dataWithRootObject:options:error:] + 124
99 Foundation 0x0000000109be43b7 +[NSJSONSerialization dataWithJSONObject:options:error:] + 337
100 AppNexusSDK 0x00000001072ecc46 +[OMIDAppnexusDictionaryUtil stringFromJSON:] + 54
101 AppNexusSDK 0x00000001072f4cb7 __64-[OMIDAppnexusStatePublisher publishState:toSessions:timestamp:]_block_invoke + 115
102 libdispatch.dylib 0x00000001111f2d7f _dispatch_call_block_and_release + 12
103 libdispatch.dylib 0x00000001111f3db5 _dispatch_client_callout + 8
104 libdispatch.dylib 0x00000001111fb225 _dispatch_lane_serial_drain + 778
105 libdispatch.dylib 0x00000001111fbe9c _dispatch_lane_invoke + 425
106 libdispatch.dylib 0x0000000111205ea3 _dispatch_workloop_worker_thread + 733
107 libsystem_pthread.dylib 0x00000001115a6611 _pthread_wqthread + 421
108 libsystem_pthread.dylib 0x00000001115a63fd start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Application crashes when trying to Download a banner with null width or height

Version: 4.11.1

Issue:

When I try to instantiate ANBannerAdView with a width or height equal to 0 then the application crashes.
I investigated through source code and found out that the ANBannerAdView logs an error message but the execution continues.

if you look at ANBannerAdView 's -setAdSizes: you will find out that the method returns if the size is not valid. However, the process of building the Network request continues and then the Appnexus library crashes in ANBannerAdView 's -internalDelegateUniversalTagSizeParameters and to be specific it is the following line that causes the crash [delegateReturnDictionary setObject:self.adSizes forKey:ANInternalDelegateTagKeySizes];.
That is because self.adSizes is nil.

Suggestion:

When trying to initialise a ANBannerAdView then stop the whole process and return an error via delegate methods or a reference to a NSError object.

Initialize ANBannerAdView with memberId and inventoryCode throws error

Hi there,

when I'm trying to initialize a ANBannerAdView with memberId and inventoryCode I always get an error:
'No known class method for selector 'initWithFrame:memberId:inventoryCode:'
This may be syntax related and since Im not very deep into iOS Development it is likely.

This is the line in my code:
ANBannerAdView *banner = [ANBannerAdView initWithFrame:(CGRect)rect memberId:(NSInteger)memberId inventoryCode:(NSString *)inventoryCode];

memberId is 4-digit Integer and the inventoryCode a String of the placement code I want to request. I followed the Mobile SDK documentation so far it works with the documentation example:
ANBannerAdView *banner = [ANBannerAdView adViewWithFrame:rect placementId:@"12345679"]; but not with memberId+inventoryCode.

I'd be grateful if you could have a look on this and could give me some support.

Thanks in advance!

PS. I'm using the version 5.1.1 of the SDK with cocoapods.

Provide a way to add a friendly obstruction when open measurement is used

When articles containing ads are rendered using UITextView, they are to be covered by specific supplementary views to provide continuous selection:

Simulator Screen Shot - iPhone X - 2020-03-11 at 13 57 11

Screenshot 2020-03-11 at 14 06 09

But putting ads behind these aux views breaks a viewability impression tracking made by Open Measurement SDK.

Fortunately, there is a way to register obstructions in the SDK, but it has to be exposed by the AppNexusSDK.

One of possible solutions is to introduce - [ANBannerAdView addOpenMeasurementFriendlyObstruction:] like shown in the following patch:

diff --git a/sdk/sourcefiles/ANBannerAdView.h b/sdk/sourcefiles/ANBannerAdView.h
index 390e6717..31bbe062 100644
--- a/sdk/sourcefiles/ANBannerAdView.h
+++ b/sdk/sourcefiles/ANBannerAdView.h
@@ -238,6 +238,12 @@ typedef NS_ENUM(NSUInteger, ANBannerViewAdAlignment) {
  */
 @property (nonatomic, readwrite) BOOL enableNativeRendering;
 
+/**
+ *  Excludes a given view from ad viewability calculations
+ *  when open measurement is used.
+ */
+- (void)addOpenMeasurementFriendlyObstruction:(nonnull UIView *)view;
+
 
 /**
  *  nativeAdRendererId :  Native Assembly renderer_id that is associated with the placement.
diff --git a/sdk/sourcefiles/Viewability/ANOMIDImplementation.h b/sdk/sourcefiles/Viewability/ANOMIDImplementation.h
index 222bd75d..8b72d6b2 100644
--- a/sdk/sourcefiles/Viewability/ANOMIDImplementation.h
+++ b/sdk/sourcefiles/Viewability/ANOMIDImplementation.h
@@ -33,5 +33,7 @@
 - (OMIDAppnexusAdSession*) createOMIDAdSessionforNative:(UIView *)view withScript:(NSMutableArray *)scripts;
 - (void) stopOMIDAdSession:(OMIDAppnexusAdSession*) omidAdSession;
 - (void)fireOMIDImpressionOccuredEvent:(OMIDAppnexusAdSession*) omidAdSession;
+- (void)addFriendlyObstruction:(UIView *) view
+    toOMIDAdSession:(OMIDAppnexusAdSession*) omidAdSession;
 
 @end
diff --git a/sdk/sourcefiles/internal/ANBannerAdView.m b/sdk/sourcefiles/internal/ANBannerAdView.m
index d082c88b..f7f2b631 100644
--- a/sdk/sourcefiles/internal/ANBannerAdView.m
+++ b/sdk/sourcefiles/internal/ANBannerAdView.m
@@ -281,8 +281,15 @@ - (NSTimeInterval)autoRefreshInterval {
     return __autoRefreshInterval;
 }
 
-
-
+- (void)addOpenMeasurementFriendlyObstruction:(nonnull UIView *)view {
+    if ([self.contentView isKindOfClass:[ANMRAIDContainerView class]])
+    {
+        ANMRAIDContainerView *standardAdView = (ANMRAIDContainerView *)self.contentView;
+        if (standardAdView.webViewController.omidAdSession != nil) {
+            [[ANOMIDImplementation sharedInstance] addFriendlyObstruction:view toOMIDAdSession:standardAdView.webViewController.omidAdSession];
+        }
+    }
+}
 
 #pragma mark - Transitions
 

High CPU Load on OMIDAppnexusStatePublisher

Our App is getting warm on idle usage if we show AdBanners using AppNexus. If we profile it with Instruments we are getting high time load on [OMIDAppnexusStatePublisher publishState:toSessions:timestamp:container:]

For what is this function? Is it possible to optimize it?

We are using AppNexusSDK 7.7.1.

OMIDAppnexusStatePublisher

Potential risk to block forever in dispatch_semaphore_wait() for a released semaphor ??

Hello,

Thank you for the latest update.
At the mean time, I have a question about your last modification in ANNativeAdRequest.

In the method setImageInBackgroundForImageURL: onObject:forKeyPath: you will release de semaphore after finish download image (mainImage ou iconImage).

In the method universalAdFetcher: didFinishRequestWithResponse:

You have download images in background queue, if semaphore is defined, call dispatch_semaphore_wait(semaphor, DISPATCH_TIME_FOREVER) to wait for this background task.
But what if semaphoreIconImage is released before semaphoreMainImage ?

Does it has risk that semaphoreIconImage finish early and it could be released, so the code will block in
dispatch_semaphore_wait(semaphoreIconImage, DISPATCH_TIME_FOREVER);?

ANBaseUrlConfig videoWebViewUrl

The videoWebViewUrl's return type in ANBaseUrlConfig protocol should be changed to NSURL * as it is used so both in ANProdHTTPBaseUrlConfig and ANProdHTTPSBaseUrlConfig.

Feature requests / issue list

Hello!
First of all thank you for creating this library, we really appreciate it being open source!
We are using it extensively at Schibsted, however there are some things / feature requests that I would like to list in this issue:

  • Would it be possible to make a thin version of this framework that only displays ads in a WKWebView? Current repo has ~557 MB, mostly because of mediation frameworks.

screen shot 2017-06-19 at 11 31 16

  • Some ads cause scrolling performance to deteriorate if we embed them in UITableView / UICollectionView cells
  • Resizing behaviour is a bit cryptic at least to me, could you provide some explanation about how it works ?
  • I know that Carthage is supported, but every time I build AppNexus SDK it also builds KIF
  • NSURLConnection header has this comment at the very top /*** DEPRECATED: The NSURLConnection class should no longer be used. NSURLSession is the replacement for NSURLConnection ***/ I think that ANAdFetcher should be rewritten to NSURLSession
  • Would it be possible to add nullability markers to Obj-C headers ? At the moment everything is bridged to Swift as explicitly unwrapped optional

If you want me to split this into multiple issues please let me know!

The SDK crashes in -[ANGDPRSettings getDeviceAccessConsent] when using TCF 2.0 purpose consent strings

This crash happens when using TCF 2.0 and the purpose consent string is empty.

You get an index out of bounds because a substring is created from an empty string. This happens because the if statement evaluates the string (as opposed to its length) to be greater than zero.

if(purposeConsents > 0){
return [purposeConsents substringToIndex:1];
}

should be:

if(purposeConsents.length > 0){
    return [purposeConsents substringToIndex:1];
}

Missing OMSDK_Appnexus.xcframework when building with carthage

Given the following Cartfile:

github "appnexus/mobile-sdk-ios"

Calling carthage update --new-resolver --use-xcframeworks --platform ios yields the following frameworks:

AppNexusNativeSDK.xcframework
AppNexusSDK.xcframework

However I seem to be needing a framework called OMSDK_Appnexus.xcframework as well. What is this, and how do I get it when using carthage and xcframeworks?

Swift Package Manager Support

Do you have plans to add support for the Swift Package Manager to the SDK anytime soon?

There is already an experimental support for SPM implemented in scope of #55.

GoogleAdapter support through SPM

Hi,

Currently the mobile-sdk-ios is giving support to its installation through SwiftPM but only to its main spec. Could you give also support to GoogleAdapter subspec as well?

Thanks!

GDPR Duplicated symbols

including appnexus and amazon ad sdks in one project causes build error.
1

Error:duplicate symbol _IABConsent_ConsentString in:
Error:  /Users/admin/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator/AppNexusSDK/libAppNexusSDK.a(ANGDPRSettings.o)
Error:  /Users/admin/work/test/******/AmazonAd.framework/AmazonAd(AMConstants.o)

2

Error:duplicate symbol _IABConsent_SubjectToGDPR in:
Error:  /Users/admin/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator/AppNexusSDK/libAppNexusSDK.a(ANGDPRSettings.o)
Error:  /Users/admin/work/test/******/AmazonAd.framework/AmazonAd(AMConstants.o)

As I see, need to change contants' names in AppNexusSDK/sdk/internal/config/ANGDPRSettings.m

NSString * const  ANGDPR_ConsentString = @"ANGDPR_ConsentString";
NSString * const  ANGDPR_ConsentRequired = @"ANGDPR_ConsentRequired";
NSString * const  IABConsent_ConsentString = @"IABConsent_ConsentString";
NSString * const  IABConsent_SubjectToGDPR = @"IABConsent_SubjectToGDPR";

because amazon uses the same names.

ANMultiAdRequest: could not parse valid tag in request

Hi,

Our app has itegration with your SDK. We use ANNativeAdRequest to get native ads. And it works correctly (althout there are some memory leaks - I will report it in a separate issue).

Now, we want to avoid native ads duplication and we're trying to use ANMultiAdRequest.

But after integrating it, we get the following errors (the log from SDK debug mode and printed error from ANMultiAdRequest delegate):

2021-04-18 01:18:20.783102+0200 AppName  APPNEXUS DEBUG  +[ANUniversalTagAdServerResponse generateTagsFromResponseData:] -- jsonResponse={
    error = "Could not parse valid tag in request";
}
2021-04-18 01:18:20.783181+0200 AppName APPNEXUS ERROR  +[ANUniversalTagAdServerResponse generateTagsFromResponseData:] -- FAILED to find an array of tags in UT Reponse data.
(lldb) po error
Error Domain=com.appnexus.sdk Code=2 "multi_ad_request_failed UT Response FAILED to return any ad objects." UserInfo={NSLocalizedDescription=multi_ad_request_failed UT Response FAILED to return any ad objects.}
MultiAdRequest failed with error: Error Domain=com.appnexus.sdk Code=2 "multi_ad_request_failed UT Response FAILED to return any ad objects." UserInfo={NSLocalizedDescription=multi_ad_request_failed UT Response FAILED to return any ad objects.}

We have no idea what tag and how to fix it. Could you help us with that?

"GADInvalidInitializationException" version 5.3

Hello,
We are updating version to 5.3 and we use Google and SmartAd mediation as well.

I have this crash after launch application.

*** Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized incorrectly. Google AdMob publishers should follow instructions here: https://googlemobileadssdk.page.link/admob-ios-update-plist to include the AppMeasurement framework, set the -ObjC linker flag, and set GADApplicationIdentifier with a valid App ID. Google Ad Manager publishers should follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist'

As the log mentioned, I already set the -ObjC linker flag, and set GADApplicationIdentifier in plist with our ID, also add GADMobileAds.sharedInstance().start(completionHandler: nil) in appDelegate didFinishLaunchingWithOptions, but the crash still there.

Since we are using as mediation, do I still need to add AppMeasurement framework?
Because it didn't include in the SDK.

Do you have idea about it ?
Thank you for your attention.

Update Google-Mobile-Ads-SDK dependency

Hi,

We need to use the GoogleAdapter subspec but we are having some conflicts while trying to install the dependency. The error is:

Can't merge user_target_xcconfig for pod targets: ["Foo", "Google-Mobile-Ads-SDK"]. Singular build setting EXCLUDED_ARCHS[sdk=iphonesimulator*] has different values.

This seems to be caused by a conflict between the Google-Mobile-Ads-SDK library which defines in its Podspec:

"user_target_xcconfig": {
    "EXCLUDED_ARCHS[sdk=iphonesimulator*]": "i386"
}

This seems to be fixed in the version 8.2.0.1 (you can see their release notes here) so we would need to update the dependency to -at least- that version.

Can't recognize ANBannerAdView in Swift project

Hi guys,

I've added the AppNexusSDK via cocoapods, and created a bridgning-header, where I've imported "AppNexusSDK/ANBannerAdView.h" .. If I'm not writing AppNexusSDK/ infront of the .h-file, it won't be recognized.
My issue now is, that my swift file still not recognizes the ANBannerAdView-class..

Any idea why?
I have tried to import the ANBannerAdView like you do normally with swift as well, without any luck.

Thanks.

Error log when integrating via SwiftPM

Thanks for adding support for SwiftPM, everything works with the exception of this error log.

APPNEXUS ERROR  NSString * _Nullable ANPathForANResource(NSString * _Nullable __strong, NSString * _Nullable __strong) -- Could not find resource SDK-Info.plist. Please make sure that all the resources in sdk/resources are included in your app target's "Copy Bundle Resources".

I think it's caused by this line NSDictionary *sdkPlist = [NSDictionary dictionaryWithContentsOfFile:ANPathForANResource(@"SDK-Info", @"plist")];

Screenshot 2021-07-16 at 09 33 42

We can see that the requests have proper sdk version.

Is this something we should worry about?

Mediation Updates

We are seeing little to no usage for some of the mediation adapters that are included in the Mobile SDK. This I2I is to notify our SDK users that we will NOT be actively maintaining or supporting the adapters in the list (see below) from the next SDK release onwards.

  1. Amazon
  2. InMobi
  3. Millennial Media
  4. Mopub

The adapters will be removed from Podspec(Cocoapods).
Please note that we do not plan to remove/deprecate the aforementioned adapters in code, but rather we will be moving these adapters to a different folder within the Mobile SDK repository.
If there is enough interest in certain mediation adapter(s), we will remain open to the idea of adding them back to our list of supported adapters.
Our hope with this change is that we will be able to provide faster and more frequent updates to the remaining subset of supported mediation adapters in the future.
If you have any questions/comments please let us know either via GitHub/or via Xandr Support.

Unable to build xcframework with carthage

I'm trying to build the SDK as an xcframework using carthage however I'm getting this error:

Ld /Users/[REDACTED]/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/mobile-sdk-ios/7.13/Build/Intermediates.noindex/AppNexusSDK.build/Release-iphonesimulator/AppNexusSDK.build/Objects-normal/arm64/Binary/AppNexusSDK normal arm64 (in target 'AppNexusSDK' from project 'AppNexusSDK')
    cd /Users/[REDACTED]temp/carthageTest/Carthage/Checkouts/mobile-sdk-ios/sdk
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios9.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -L/Users/[REDACTED]/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/mobile-sdk-ios/7.13/Build/Products/Release-iphonesimulator -F/Users/[REDACTED]/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/mobile-sdk-ios/7.13/Build/Products/Release-iphonesimulator -Fsourcefiles/Viewability -F/Users/t[REDACTED]/temp/carthageTest/Carthage/Checkouts/mobile-sdk-ios/sdk/sourcefiles/Viewability -filelist /Users/t[REDACTED]/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/mobile-sdk-ios/7.13/Build/Intermediates.noindex/AppNexusSDK.build/Release-iphonesimulator/AppNexusSDK.build/Objects-normal/arm64/AppNexusSDK.LinkFileList -install_name @rpath/AppNexusSDK.framework/AppNexusSDK -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/[REDACTED]/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/mobile-sdk-ios/7.13/Build/Intermediates.noindex/AppNexusSDK.build/Release-iphonesimulator/AppNexusSDK.build/Objects-normal/arm64/AppNexusSDK_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework AdSupport -framework AVFoundation -framework AVKit -framework CoreGraphics -framework CoreTelephony -framework MediaPlayer -framework MessageUI -framework OMSDK_Appnexus -framework QuartzCore -framework StoreKit -framework SystemConfiguration -framework UIKit -framework WebKit -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/[REDACTED]/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/mobile-sdk-ios/7.13/Build/Intermediates.noindex/AppNexusSDK.build/Release-iphonesimulator/AppNexusSDK.build/Objects-normal/arm64/AppNexusSDK_dependency_info.dat -o /Users/[REDACTED]/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/mobile-sdk-ios/7.13/Build/Intermediates.noindex/AppNexusSDK.build/Release-iphonesimulator/AppNexusSDK.build/Objects-normal/arm64/Binary/AppNexusSDK
ld: in sourcefiles/Viewability/OMSDK_Appnexus.framework/OMSDK_Appnexus(OMIDAdEvents.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld /Users/[REDACTED]/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/mobile-sdk-ios/7.13/Build/Intermediates.noindex/AppNexusSDK.build/Release-iphonesimulator/AppNexusSDK.build/Objects-normal/arm64/Binary/AppNexusSDK normal arm64
(1 failure)

Adding arn64 to excluded architectures for any iOS Simulator SDK in the SDK's build settings resolves the issue but this will cause the framework to not work om iOS sim on apple silicon.

Cannot open App Store when tapping an ad

Hi I have following standard code which doesn't open app store when I tap an ad which says "Install App".

banner.opensInNativeBrowser = YES;
banner.autoRefreshInterval = 60;
banner.alignment = ANBannerViewAdAlignmentCenter;
banner.transitionType = ANBannerViewAdTransitionTypeFade;
banner.transitionDirection = ANBannerViewAdTransitionDirectionUp;
banner.transitionDuration = 0.3;
[banner loadAd];

Any suggestion why ?

FYI: I have tried it with banner.opensInNativeBrowser = NO; also

Xandr SDK v8.0 Removal Notice for Deprecated APIs

We Intent to remove all the deprecated API's listed below in Xandr SDK v8.0. If you are using any of the below API's we request to migrate to their equivalent. If you have any questions reach out to Xandr support.

Class Property(s) and Method(s)
ANBannerAdView Property : externalUid, adType, creativeId
Method : - (void)setAllowNativeDemand:(BOOL)nativeDemand withRendererId:(NSInteger)rendererId;
ANInterstitialAd Property : externalUid, adType, creativeId
ANInstreamVideoAd Property : externalUid, adType, creativeId
ANMultiAdRequest Property : externalUid, adType, creativeId
ANExternalUserId Property : source, userId
Method : - (nullable instancetype)initWithSource:(ANExternalUserIdSource)source userId:(nonnull NSString *)userId;
ANNativeAdRequest Property : adType, externalUid
ANNativeAdResponse Property : creativeId
ANSDKSettings Property : HTTPSEnabled, externalUserIdArray, useAdnxsSimpleDomain
ANTargetingParameters Property : externalUid

[BUG] ANInstreamVideoAd.m videoAdDidClose calls removeAd

I believe this is a bug because ads are not done playing, this method callback should not remove ad player.

videoAdDidClose method is called after webview with ad is dismissed. Example project works because it does not implement this method.

MobileSDK v6.0

MobileSDK v6.0 introduces changes intended to make the SDK lightweight, minimizing its footprint on disk and in memory. This version includes the following changes, but otherwise introduces no new functionality:

  1. The SDK itself is now built only as a dynamic framework.
  2. To streamline mediation adapter upgrades, we are removing mediation adapter libraries.
  3. Mediation adapters can now be included only via source code or Cocoapods
    a. This benefits the publisher to choose the mediation networks needed.
    b. The supported version of third-party mediation network will be provided in the wiki for publisher reference

Application freezes when download native ad

Hello,

We've experience a freeze issues when download native ad in a tableview, we have produce in a bad network connection (Edge)
After the investigate, we find out that in the ANNativeAdRequest, In method setImageForImageURL:onObject:forKeyPath: you have created an loadImageData operation to download image, then, you've add this operations in mainQueue.

Then this method has been use in universalAdFetcher: didFinishRequestWithResponse:to download mainImage and iconImage for Native ad, with completion of an other operation finish.
So the operations are all in [NSOperationQueue mainQueue], the finish block depends on others, so it will executed once load image data operations finish, and it make the freezes.

Here is our proposition to solve this problem:
Create another queue for download image data, we've run some test with this solution, and it fix the problems.

Please fix it soon, it absolutely has huge impact for the user experience of our application.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.