AdMob Interstitial ads providing inconsistent DismissingOverlay callbacks - windows-phone-8

I am trying to use AdMob Interstitial Ads in my application in Windows Phone 8.
The version of "GoogleAds.dll" I am using is: "6.5.13.0".
Everything is working fine as per the samples provided by AdMob.
I just had one query regarding the "DismissingOverLay" callback provided by the Interstitial Ad. It says that it is provided "After the interstitial/overlay is dismissed."
But in my case I am getting it in the following scenarios -
1.) When I dismiss the Ad by clicking the close image or hardware back key.(This is fine.)
2.) When the Ad is clicked and external browser is open and when the external browser is closed. (once when control leaves the app and once when it comes back.)
3.) When the hardware lock button is pressed. (in this case I get the dismissed callback but when I unlock the screen, I can still find the ad, not being dismissed.)
Why I just need a clarification on this because I am trying to run some custom code when the Ad is actually dismissed, but as I am getting these callbacks at various points I am unable to find out when to accept these callbacks and when to reject?

Related

What event is raised when the Start button is pressed in Windows Phone 8.1 RT

I used MediaCapture APIs in my App. Let's say I started recording and preview. During recording, I pressed Start key and quickly come back to the App by long pressing Back key and selecting my app (task swap). The result is that the preview is frozen either running on Emulator or 8.1 WP hardware. I don't find a better event to register for Start key. I understand that this.Resume can handle restoration when your APP is being deactivated. But here I mean I switch back from Start within 2~3 seconds and the Resume call is not get called. I am thinking that I can disable preview when Start key is pressed as a workaround. Then when App is brought back to foreground, user can restart recording. However, both scenarios I can't find a proper event. Of course if preview is not frozen when APP is swapped back, I don't need to do anything. Now it seems preview is not working after task swapped back from Start.
Here are the APIs I am using
_mediaCapture.StartRecordToStorageFileAsync(_profile, _recordStorageFile);
capturePreview.Source = App._mediaCapture;
_mediaCapture.StartPreviewAsync();
The issue you're hitting here has to do with the fact that as long as the debugger is attached, suspending/resuming won't work like it will once your app is running on its own.
See here: https://msdn.microsoft.com/en-us/library/windows/apps/hh974425.aspx
Try the same thing you're doing right now, except press the Suspend button in VS once your app is in the background. To bring it back, press the Resume button. Alternatively, try the same thing without the debugger attached.
As long as you're handling the Suspending/Resuming events correctly, MediaCapture lifecycle won't be a problem.
To learn more, have a look at the UniversalCameraSample on the Microsoft github repository: http://aka.ms/2015builduniversalcamerasample. It targets Windows 10, but a lot still applies to 8.1.
There are three events you can register for.
CoreWindow.Activated will be raised when you are no longer the foreground app. This can happen because the user switched away, or because something like a Reminder or Phone Call popped up on top, etc. Simply getting a toast notification does not raise the Activated event.
CoreWindow.VisibilityChanged will be raised when you are no longer visible. This happens when the user switches away, locks the phone, etc.
CoreApplication.Suspending will be raised when you are being suspended. The system doesn't suspend you immediately when the user switches away (in case they switch back quickly, eg they had accidentally hit the Start button). Instead it waits a few seconds before raising this event.

How to write an app that does not open a window in Windows Phone

I want to write an app that just manipulates the content of it's own tile and then silently terminates.
How do I get rid of any default window and splash screen?
Thanks!
You cannot do this fully. Tapping the tile will always launch the app so there will always be a context switch even if it exits immediately.
The closest you can get is to write a Silverlight app and not include a SplashScreenImage.jpg file. When the app starts up immediately exit by calling Application.Terminate (Runtime apps always show their splash screens while loading, but splash screens are optional for Silverlight apps).
This isn't recommended and is likely to confuse your users. A better design would be to let the app launch and do something useful such as displaying more information about what is on the tile or letting the user know what changes are being made.
As Romasz says, this may not pass certification. See Windows and Windows Phone Store Policies for the certification requirements. I suspect an immediate exit with no reason given will appear as and be treated as an app crash.

pubCenter Ads aren't showing up in trial version

Did I have to do something special when i submitted the app to the app store? I noticed there was an optional section for adding a pubCenter ad but I didn't fill it in, however i created the ad in pubCenter and included the Ad control and entered the correct Ad ID to the control
Ads are not showing up.
When debugging I had to use default values ( was using the actual application ID and adunit ID which is wrong)
ApplicationId="test_client"
AdUnitId="Image320_50"
Furthermore I have to enable these capabilities in order for the ads to show up, after I enable them they worked !
Required Manifest Capabilities
Apps Targeting Windows Phone 8.0
The following ID_CAP capabilities must be included in the manifest of the advertising-enabled app.
•ID_CAP_IDENTITY_USER
•ID_CAP_MEDIALIB_PHOTO
•ID_CAP_NETWORKING
•ID_CAP_PHONEDIALER
•ID_CAP_WEBBROWSERCOMPONENT

Windows Phone 8 App Failed Certification

I recently submitted a very simple app to the WP app store that is basically buttons that play sounds on click.
However, the app failed certification for the following reason(s):
Comments: Result: Fail
The application terminates unexpectedly in response to user input.
Steps to Reproduce:
Play music from music+videos hub and Launch the application.
Tap on any option from MY APPS NAME HERE.
Notice the application unexpectedly terminates.
Comments: Result: Fail
The application terminates unexpectedly in response to user input.
Steps to reproduce:
Play music on the device from the Music + Videos Hub.
Launch the application.
Press the device's universal volume control.
Select "Pause" from the device's universal volume control.
Notice the application unexpectedly terminates.*
My questions are:
What is "the device's universal volume control" ?
How can I stop these errors from happening?
I used Blend to assign a sound to the buttons so there is no code to work with as far as I can see.
I've written similar apps for the Android market and always use a 'stop' and 'release' for each mediaplayer element at the beginning of each button's code. I'm assuming I need something similar here but not sure how to go about it in WP8. Any ideas?
Unviersal volume control refers to the phone physical volume buttons.
Did you have AdMod ads in your app? Recently i found an app with the same behavior failing certification and it was caused by AdMob control doesn't working right when the volume buttons show the volume popup over the app.
If you follow this link, you can see a workaround:
https://groups.google.com/forum/#!topic/google-admob-ads-sdk/vw61ZdJALYo
Hope this helps.

Windows .net Google.Apis hangs on the call to InsertMediaUpload.Upload -- there is no timeout

I am using GoogleApis to upload documents to Google Drive using the InsertMediaUpload class from the FilesResource namespace and the Upload method. It is working well for me with the following exception:
After calling InsertMediaUpload, a browser window appears asking the user to log into their Google (usually Gmail) account. If the user simply closes the browser window instead of clicking on "Accept" or "Cancel" then the current process appears to be hung. I suppose there should a timeout of a minute or two so that if the user opts to not log in the current windows application will not simply hang and stop working indefinitely.
There is no need for sample code here. What should happen when the user simply closes the browser window instead of clicking cancel if they are no longer interested in uploading a document? Crashing (or hanging) the current process should not be a possibility, but that is what occurs. One would hope closing the browser window would have the same effect as clicking the cancel button -- just another way of opting out of an upload to Google Drive, right?
Thanks in advance for any help with this.
You're not supposed to get authentication message from InsertMediaUpload class. You should handle authentication by yourself. Authentication browser window you get is for your development convenience, not for production code. Please take a look at .net quickstart. In this quickstart, you'll see GetAuthorization method which handles authentication. Modify this method on your needs and you'll get what you want.