I have integrated admob interstitial ads into my app as Google AdMob SDK sample. After initialize interstitial ad, it appear fine. Problem occures when I clicked on ad and navigate to browser then pressing device's back button to navigate back into app, app crashes every times. Result is crash with message: "The given key was not present in the dictionary."
Is there any solution to stop crashing app?
Same here.
Ad loads.
User clicks on add
Press 'back' button.
App crashes.
Apparently AdMob is aware of the issue (its their bug) but I dont think they are in any rush to fix it.
I have same problem and solve using following code.
This is a workaround.just add given code in app.xml.cs file of your solution.
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
String ex = e.ExceptionObject.ToString().ToLower();
if (ex.Contains("system.collections.generic.keynotfoundexception"))
{
//Caused by Google fullscreen ads
e.Handled = true;
}
else if (Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
Debugger.Break();
}
}
Related
I have a ViewController that will request access to location services on init via
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined)
{
[_locationManager requestWhenInUseAuthorization];
}
This triggers the "Allow app to access your location while you use the app?"-alert.
I use [self addUIInterruptionMonitorWithDescription:handler:] to react to this. I am encountering the following problem: after dismissing the request-dialog, the ui-test does not continue. The alert is dismissed, but Xcode waits for the app to become idle, but it looks like the app is idle:
t = 67.35s Wait for app to idle
The test fails, because the app is stuck here. If i tap into the simulator, Xcode logs.
t = 72.27s Synthesize event
and continues the test.
Is there a reason, why Xcode tries to wait for the app? A workaround seems to be to tell Xcode that the UI changed or an event happened. Is there a way to trigger this?
After presenting the alert you must interact with the interface. This is a known bug with Xcode 7.2. Simply tapping the app works just fine, but is required.
addUIInterruptionMonitorWithDescription("Location Dialog") { (alert) -> Bool in
alert.buttons["Allow"].tap()
return true
}
app.buttons["Find Games Nearby?"].tap()
app.tap() // need to interact with the app for the handler to fire
XCTAssert(app.staticTexts["Authorized"].exists)
See my blog post for more information.
I'm trying to add Admob banner on my Windows Phone 8.1 app, I've done everything same with Google's documentation and When I run it on emulator, it works perfectly. I see test ads and normal ads on screen, but when I run it on real device (Lumia 920) it fails and OnFailedToReceivedAd works and gives me NoFill as errorcode. I'm searching over 2 days on internet. Please help me. My codes below from MainPage.xaml.cs
AdView bannerAd = new AdView
{
Format = AdFormats.Banner,
AdUnitID = "ca-app-pub-4629040566186464/6355149637"
};
bannerAd.ReceivedAd += OnAdReceived;
bannerAd.FailedToReceiveAd += OnFailedToReceiveAd;
DrawingSurfaceBackground.Children.Add(bannerAd);
AdRequest adRequest = new AdRequest();
// adRequest.ForceTesting = true;
bannerAd.LoadAd(adRequest);
}
private void OnAdReceived(object sender, AdEventArgs e)
{
Debug.WriteLine("Received ad succesfully");
txtas.Text = "Received ad succesfully";
}
private void OnFailedToReceiveAd(object sender, AdErrorEventArgs errorCode)
{
Debug.WriteLine("Received ad unsuccesfull"+errorCode.ErrorCode);
txtas.Text = "Received ad unsuccesfull";
}**
I made this app on Unity3d, Because of Google Admob SDK doesn't support Windows Phone, so I've done steps on this website http://gamedevtodied.blogspot.com.tr/2015/06/unity3d-how-to-integrate-admob-for.html. As I said it works on emulator but not working on device.
You will get the NoFill error many times on many of your users devices. This is because not much people on the Windows Phone platform advertise using Google AdMob, and because they did not create an SDK for Windows Phone 8.1 which use 90% of all Windows Phone devices.
The NoFill error is normal, and will occur much less when you release your app. You can register on a different ad provider, for example Microsoft PubCenter or AdDuplex and when the NoFill error occurs, simply display another ad provider ads as a fallback.
I hope it helps.
AdDuplex can't permit to monetize, only promote the app. For a developer is unthinkable not have revenues. It work for free? And eat air... Microsoft pubcenter not work, million of case still wait a response from Microsoft. The reality is that Google stopped to develop SDK of AdMob and actual version is not compatible with Windows Phone 8.1, this is a bad and illegal politic.
I am developing a hybrid app which works fine on android and ios. But in windows, at times application crashes when redirecting between pages. I am getting following error messages in Visual Studio output window.
System.SystemException
Microsoft.Phone.Interop.ni.dll but was not handled in user code
It breaks the application at following point in App.xaml.cs.
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (System.Diagnostics.Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
System.Diagnostics.Debugger.Break();
}
}
I have no idea which part of code is causing this and I have never seen any such crash before.
Please throw some light on this issue!
Thanking you in anticipation!
I want to integrate some voice commands in my windows phone 8.1 app.
The first thing I want to do is to open my app by a voice command and navigate to a certain page.
According to MSDN article Quickstart: Voice commands (XAML) I can use the override of protected virtual void OnActivated(IActivatedEventArgs args) method in App.xaml.cs to meet my requirements. But it does'nt work the way I though it would!
I have the method with the following structure:
protected override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.VoiceCommand)
{
var commandArgs = args as VoiceCommandActivatedEventArgs;
if (commandArgs != null)
{
// ... some logic here
}
}
}
The problem is when I'm activating my app by saying "Open 'name of my app' [optional words]" the app opens but the Activated event never fires! The app opens and OnLaunched event fires. So I can't even enter the OnActivated method.
Does anyone know the problem? Why can't I enter OnActivated method using voice commands?
P.S. I tried it with a simulator as well as with a real device.
you can see this article,
http://t.co/Q5hRxRPvwR
is in spanish, but you will understand.
After you install the app and run it, the xml should be installed, like said in documentation.
After ask to cortana "What can I say?" it will show all you can said, and the apps that supports cortana. Choose you app and you will see what you can say for your app, like
If you say what your app can listen, your app will be activated.
I'm having some problems getting the Flash AS3 Camera to work correctly. If you could help, much appreciated. I looked at olThe details:
I'm able, when publishing to a SWF, to get the webcam up and running and all works fine, popping up the 'may I access your camera dialog' which returns muted or not.
• First question: is there any way to make it so I can bypass the user permission, that is always grant it? We are running a kiosk app. Will the following method work for an AIR app? https://stackoverflow.com/questions/3266939/flash-grant-access-to-webcam-programmatically-behind-the-scenes
• Second question: as I said, I can get the webcam/Camera hookup to work fine when publishing for SWF in IDE, and in browser. But if I switch the project to publish for AIR and run the air app, or test in the IDE, I don't get the security permissions dialog coming up at all. Nothing. Perhaps the security box is off screen? Is there some way to control the placement? Is there something different about using the webcam from within AIR?
I'm happy to NOT publish to AIR, but to use SWF — simply need to be able to read/write to XML files on local disk and think that AIR only way to do that?
Thanks for any help!
The code:
private function initTracking() : void
{
var camW : int = 840;
var camH : int = 640;
// Create the camera
_cam = Camera.getCamera();
if (_cam == null)
{
trace("Unable to locate available cameras.");
return;
}
else
{
trace("Found camera: " + _cam.name);
_cam.addEventListener(StatusEvent.STATUS, camStatusHandler);
_cam.setMode(camW, camH, stage.frameRate);
// Create a video
_vid = new Video(camW, camH);
_vid.attachCamera(_cam);
trace("camera ", _cam, " attached to video ", _vid);
// Create the Motion Tracker
_motionTracker = new MotionTracker(_vid);
// We flip the input as we want a mirror image
_motionTracker.flipInput = true;
}
}
private function camStatusHandler(event:StatusEvent):void
{
trace("camStatusHandler::");
if (_cam.muted)
{
trace("Unable to connect to active camera.");
}
else
{
trace("able to connect to active camera.");
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler, false,0,true);
}
// Remove the status event listener.
_cam.removeEventListener(StatusEvent.STATUS, camStatusHandler);
}
If you publish as AIR, there is no security dialog (the security box for swfs is there to stop 'hackers' gaining control of a users webcam without their knowledge).
If your code works in a swf, it should also work in an AIR app without needing any changes - assuming AIR is running on the desktop and not a mobile device?
If you are not seeing the webcam output when you publish as an AIR app, post the relevant code.
Edit:
The StatusEvent.STATUS event does not occur with AIR apps - it fires when user closes security dialog - hence camStatusHandler never gets called.
So remove camStatusHandler function completely and also this line:
_cam.addEventListener(StatusEvent.STATUS, camStatusHandler);
And add important code from camStatusHandler to the end of initTracking:
addEventListener(Event.ENTER_FRAME, onEnterFrameHandler, false,0,true);