Question

I'm experiencing some odd behavior when integrating AdColony's 2.2.4 library with an application using SVProgressHUD. If the standard configuration call is made in the app delegate...

[AdColony configureWithAppID:kAdColonyAppID zoneIDs:@[kAdColonyZoneID] delegate:nil logging:true];

SVProgressHUD no longer pops up in the app by calling

[SVProgressHUD showWithStatus@"Status..."];

Simply commenting out the AdColony configureWithAppID call causes SVProgressHUD to function again normally. Has anyone else encountered this, or found a way to make them both work in the same application?

Was it helpful?

Solution

It looks like the SVProgressHUD code is doing a check on line 436 that doesn't take into account that there can be multiple UIWindows in existence belonging to the UIWindowLevelNormal level. The consequence of this is that the HUD view is being added to the wrong window. In order to get the SVProgressHUD working, you can modify the for loop starting on line 436 as follows:

for (UIWindow *window in frontToBackWindows) {
    if (window.keyWindow) {
        [window addSubview:self.hudView];
        break;
    }
}

Please feel free to contact us (support@adcolony.com) with any further integration questions you may have.

OTHER TIPS

It works for me ,I have added adcolony framework so success messages for SVProgress hud was not showing: I comment the code:

//        for (UIWindow *window in frontToBackWindows)
//            if (window.windowLevel == UIWindowLevelNormal) {
//                [window addSubview:self.overlayView];
//                break;
//            }

and replace with

for (UIWindow *window in frontToBackWindows) {
            if (window.keyWindow) {
                [window addSubview:self.hudView];
                break;
            }
        }

So It works,.. .Thanks

The simplest way which worked for me is

[[[UIApplication sharedApplication] keyWindow] addSubview:self. overlayView];

This performs the same action the accepted answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top