Metro App Permissions Settings Charm - windows-runtime

My Metro App, uses Notifications and requires Lock Screen Access. All working great! Now, I notice that a Permissions settings charm is automatically created, with an option to turn On and Off these settings. So this leads me to the following questions:
Do these settings automatically prevent Notifications from being
shown if set to On or Off?
Or does it write a value somewhere that I need to read, and then
determine in my app if I need to Show Notifications or not?
If the answer to question 1 is Yes, great! I don't need to do anything. However, if No please advise on where these settings can be read from.

If the user sets the Notifications permission to Off then no notification will shown.
So when the setting is Off then the toastNotifier.Show(toast) call will do nothing so you don't need to do anything extra.
However if you want to specially handle the case when the notification are turned off then you can check this permission setting with the ToastNotifier.Setting
ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier();
if (toastNotifier.Setting == NotificationSetting.Enabled)
toastNotifier.Show(toast);
else
//Notifacation are disabled do something else

Related

Sonarqube Configuration Option Missing

I cannot seem to get the Configuration Button to appear in the Top right hand corner to amend Rule contents (I can Deactivate or Change Severity but would like to be able to change contents also).
I have tried this both using the default admin/admin and my own user both of which have the Global Permission 'Administer Quality Profile and Gates' set for User and Group.
This has been tried with both the In-Built Profile (Sonar way) and my own created from a copy of 'Sonar Way'.
We are using Version 4.5.2 but the same issues seem to exist with Version 5.1 which I have also downloaded.
Don't know whether this is something stupid I am doing, a Plug-In required or possibly a Paid Option but any help or information would be gratefully received as all the Documentation and YouTube vids seem to suggest we are configured correctly and should be able to do this.
Regards,
Dave.
There's no link named "Configuration" in version 4.5. I suppose you mix management of "Quality Profiles", which requires the permission "Administer Quality Profiles and Gates" and global management console, named "Settings", which requires the permission "Administer System".
Screenshot: https://www.evernote.com/l/APs76rLwBZJHEaI7a5C7di--y3peIf42BiY

What contract am I not specifying?

When I try to run my Windows Store app, it won't, and shows me this:
..."does not support the contract specified"? What contract? I'm not implementing any contract; I assume it means the Settings contract or some such, but I'm not doing any of those yet.
I went to the Help page suggested, and it says, in part, "To diagnose these errors
There are no sure ways to fix these errors. Use these techniques to diagnose the problem."
The first suggestion is:
Open Event Viewer (on the Windows Start menu, search for Event Viewer.) In Event Viewer, navigate in the tree to the Application and Services Log\Microsoft\Windows\Apps folder.
Filter the view to event Ids: 5900-6000
Examine the log and see what occurred.
Windows 8.1 only brings up web pages when I search for "Event Viewer"
Actually, I did write a utility to catch event logs, and I ran that. I found these:
***Type: Error
Source: Microsoft-Windows-Immersive-Shell
Time Generated: 11/27/2014 15:10:39
Message: Activation of app App.adaf78a74.a8c80.a4ff5.a99ca.a97636d548196_8wekyb3d8bbwe!Designer.App failed with error: -2144927148 See the Microsoft-Windows-TWinUI/Operational log for additional information.
Type: Error
Source: Microsoft-Windows-Immersive-Shell
Time Generated: 11/27/2014 15:20:08
Message: Activation of app axXAndSpace.Visits_qtyjefqf75sa6!App failed with error: -2144927148 See the Microsoft-Windows-TWinUI/Operational log for additional information.***
But where is "Microsoft-Windows-TWinUI/Operational log"?
The second suggestion on the Help page was:
Use the native debugger
Configure the project to run under a native debugger.
In Visual Studio, set the Debugger Type to Native Only on the Debug (Debugging in C++ and JavaScript) page of the property pages of the start-up project.
Look at the exceptions being thrown by looking at the output window. You might want to configure the debugger to stop when these exceptions are thrown.
I did that, but it gave me no more information than previously - nothing at all displays in the Output pane.
What could be the cause of this?
UPDATE
Just to update the progress:
Based on Iris Classon's suggestions, I went to Control Panel to see if my app was installed so that I could uninstall it, but it's not in that list.
If I search for the app by typing its name, it tries to start up - its splash screen displays, but goes no further than that.
I went to Program Files\WindowsApps, and when selecting it got, "You don't currently have persimmons to access this folder, click continue to continually get access"
That leads me to "You have been denied permission to access this folder; to gain access to this folder, you will need to use the security tab"
Click the "security tab" link takes me to that tab, and a "For special permissions or advanced settings, click Advanced"
I do so.
That takes me to a Permissions tab, which says, "You must have Read permissions to view the properties of this object; Click continue to attempt the operation with administrative permissions"
I then selected (one at a time, as that is all it allows):
Trusted Installer : Full control
System: Read, Write, and Execute
System: Full Control
Administrators: Read & Execute
But so far, none of that seems to do anything good.
UPDATE 2
This problem has just "gone away" today; I don't think it was anything I did. I added a UserControl, tried running the app again, and now it runs - I don't see that error message. However, I do see a seemingly unrelated one. (at least I got further).
I just had this problem on a fresh install of Windows 8.1 on my laptop. I'm not sure which one of these steps solved it, but until somebody can give you a more exact answer here is something to try as I am sure you are keen on coding.
Only Store Apps run from VS gives that error, other Store apps work fine.
I first of all changed permissions on my WindowsApps folder under Program Files and made sure that I had full access to the folder and sub folders. Restarted the laptop, still no luck.
Then I set up an admin guest account (just something I tend to do for when I need to record tutorials- so not related to trying to solve the error). Out of curiosity I tried to create and run the same Windows Store App and got an error that another user had installed the app. Strange, how was it installed if it gave me the error that it couldn't activate the app on the main account?
I logged back in as the main user and uninstalled the application (which was showing up as installed), and I can now run any Store App from VS without problems.
Not sure this is an answer since I'm not sure what made it work, but give it a try and hopefully somebody else can clear this us up. I'll investigate further, but I'm on a train right now with poor WiFi connection :)
Best of luck!
I had the same scenario, here are the steps I did to resolve:
I tried to create packages, chose not to associate with the store.
It said that the certificate is expired, I created a new test certificate.
I created the test packages successfully.
Tried to run the project from VS and it finally ran.
I believe all of this had to do with the certificate. very frustrating and time wasting issue.
I also had the same problem and following steps fixed it. Hope it will help some one else.
Open the appxmanifest file
Go to "Packaging" tab
Select "Choose Certificate" and select "Pick from certificate store" and select your cetificate and click on ok

How to cancel or manage focus of a PhotoCaptureDevice in Windows Phone 8

I had a camera app for WP7 which was able to control focus so when the user released the shutter button, focus action was properly cancelled.
Now I'm trying to migrate this app to WP8 but I can't find anywhere how to reproduce this.
Any ideas?
Best regards.
I've found the answer, just in case you ever need it.
You have to use this line:
//Device is a PhotoCaptureDevice instance
Device.SetProperty(KnownCameraPhotoProperties.LockedAutoFocusParameters, AutoFocusParameters.Focus);
This will cause the focus operation to pause.
Then, whenever you want to use the autfocus again you have to reset the locked parameter like this:
Device.SetProperty(KnownCameraPhotoProperties.LockedAutoFocusParameters, AutoFocusParameters.None);
Let me know if it doesn't work for you :D

Missing a notification for a trashed/deleted file

I am using push notifications to watch changes. When I add or update a file everything is ok.
When I delete a file (i.e. it goes to bin) then I do get a notification for that file lets say changeid=81477. When I go to get that change I find that it no longer exists so I can't work out what changed. However if I then go and look at changes I can see a change id=81478 that I never received a notification for. Looking at this change I can see that explicityTrashed = true, which is indicates this is related to the deleted file.
Now, my guess is that change 81477 was superceded by 81478 for some reason, but why do I not receive a notification for 81478?
Someone (non-google) on google+ suggested keeping a track of last change processed and grabbing all changes greater than that when a notification arrives, but this is a workaround to me.
The problem I have is not getting one of the notifications at all. I am posting here in the hope that someone from Google can answer this satisfactorily.
Is it a bug? Or is it expected?
Should we not rely on getting all changes from notifications and implement something similar to suggested?

Flex - display welcome screen on first launch with checkbox for never show again

I need to display a "What's new in version x.x" Dialog with a checkbox to allow users to not show the dialog on future launches. Can anyone help me by telling me what I need to look up in the api, or possibly an example?
You can create a file in File.applicationStorageDirectory where you store whether the user checked the checkbox or not.
Every time you run the app, you check if the file exists. If it does not exist, then create it.
Read the value in the file and according to it display the message or not
When the dialog is dismissed, check the value of the checkbox and update the file.
You can even use that file to store other preferences of your application like in this example.