Microsoft Advertising Crash
We recently received a report about a crash happening in the Microsoft Advertising SDK.
Game: Halcyon
Device: T7575
Exception: NullReferenceException
Stack: Microsoft.Advertising.Mobile.Shared.WebRequestWrapper.WebRespCallback(IAsyncResult result)
Microsoft seems to be working on a fix already as seen in the below quote.
Hello All,
Our dev team is testing an update for this issue currently. Unfortunately I don’t have an exact date on when it will be available at this time.
- Nick Grizzell
This error occured when the user navigated away from the application while it was in the process of fetching an ad.
I’ve fixed this by doing the following.
I hooked both “Microsoft.Phone.Shell.PhoneApplicationService.Current.Activated” and “Microsoft.Phone.Shell.PhoneApplicationService.Current.Deactivated” events, Deactivated is fired when a user navigates away from your application and Activated when they re-navigate to it.
Deactivated:
pubCenterObject.RemoveAll();
pubCenterObject = null;
Activated:
pubCenterObject = AdGameComponent.Current;
pubCenterObject.CreateAd( Config.PubCenterID, new Rectangle( 0, 0, 480, 80 ) );
As you can see, in Deactivated we remove all instances of DrawableAd, then in Activated we create a new instance of DrawableAd, This fixes the issue and helps out until Microsoft releases their fix.
1 Notes/ Hide
-
mobile-broadbandservice reblogged this from vevix
-
vevix posted this
