HardwareIdentification.GetPackageSpecificToken API changed in Windows 10 - uuid

I'm using HardwareIdentification.GetPackageSpecificToken in my app. See following resource:
https://msdn.microsoft.com/en-us/library/windows/apps/JJ553431.aspx
Now, Windows.System.Profile is no longer available in the new Windows SDK 10240. Any idea where I can find it now?

It's available for device family "Desktop" and "Mobile" only. (See https://msdn.microsoft.com/en-us/library/windows/apps/windows.system.profile.hardwareidentification.getpackagespecifictoken.aspx )
So you have to add an Extension SDK. You can do this using the Reference Manager.
See the detailed description how to add an Extension SDK here:
Windows 10 Mobile - cannot hide status bar (StatusBar doesn't exist in context)

Related

How to add WPF app to "Choose which apps can access your precise location" list in Windows 10?

I have a .NET Framework 4.6.2 WPF app that uses Windows.Devices.Geolocation API to get Latitude and Longitude on Windows 10. It uses the Microsoft.Windows.SDK.Contracts NuGet package, version 10.0.19041.1. It is able to get location information when "Allow desktop apps to access your location" is on in Location Privacy Settings.
The first time location information is requested I want to get the prompt for permission to use precise location if it is not enabled. I am calling RequestAccessAsync() before calling GeoLocator.GetGeopositionAsync(), but get no prompt.
I have tried making a sparse package with the Location capability enabled and registering it, and am able to get a package ID in the WPF app, but still get no prompt.
I have tried using System.Windows.Application.Current.Dispatcher.Invoke() to run RequestAccessAsync() on the UI thread as this says it must: https://learn.microsoft.com/en-us/windows/uwp/maps-and-location/get-location#step-1-request-access-to-the-users-location
You must call the RequestAccessAsync method from the UI thread and your app must be in the foreground.
But get no prompt.
I am thinking that the app needs be listed in the "Choose which apps can access your precise location" list in Location Privacy Settings for this to work. How do I do that?
I want to get the prompt for permission to use precise location if it is not enabled ...
You will no longer get a prompt. See my answer here for details.
What you should do is to prompt the user to change the setting himself/herself in the Settings app.

Codename One Preferences/Storage permissions

I have developed and published an app in Google Play Store, which only send simple String request to REST API and store the results in the Preferences. The same app is also submitted to Windows Store for publication, however it was rejected due to the following reason:
The app declares use of the sensitive capability [musicLibrary, picturesLibrary, videosLibrary] without appearing to access the declared capability. Please removed the sensitive capability declaration and re-submit the app.
Upon inspection to Google Play Store submission, I noticed the same permissions are requested:
This app has access to:Photos/Media/Filesread the contents of your USB storagemodify or delete the contents of your USB storageStorageread the contents of your USB storagemodify or delete the contents of your USB storageOtherreceive data from Internetview network connectionsfull network accessprevent device from sleeping
So my question is, do Preferences really need these permissions, or can I set some kind of build hints to remove these permission requests, especially for UWP build? I have also tried to set android.blockExternalStoragePermission build hint, but the permissions are still requested in Android build. I have yet to try iOS build since currently I don't have Apple Developer account.
Thank you very much in advance.
Edit #1 (23/10/2018):
Upon further inspection, I found that I have mistakenly uploaded the version that didn't declare android.blockExternalStoragePermission to Google Play Store, so all good on Android version.
Currently I'm not using any of cn1libs, and here's the list of all classes imported in my application:
java.util.HashMapjava.util.Mapjava.util.Randomcom.codename1.components.InfiniteProgresscom.codename1.components.ToastBarcom.codename1.components.ToastBar.Statuscom.codename1.io.CharArrayReadercom.codename1.io.JSONParsercom.codename1.io.Logcom.codename1.io.NetworkManagercom.codename1.io.Preferencescom.codename1.io.rest.Responsecom.codename1.io.rest.Restcom.codename1.l10n.L10NManagercom.codename1.ui.Buttoncom.codename1.ui.Componentcom.codename1.ui.Containercom.codename1.ui.Dialogcom.codename1.ui.FontImagecom.codename1.ui.Formcom.codename1.ui.Labelcom.codename1.ui.events.ActionEventcom.codename1.ui.events.ActionListenercom.codename1.ui.layouts.BorderLayoutcom.codename1.ui.layouts.FlowLayoutcom.codename1.ui.layouts.GridLayoutcom.codename1.ui.plaf.Bordercom.codename1.ui.plaf.Stylecom.codename1.ui.plaf.UIManagercom.codename1.ui.util.Resources
So my original question remain, how do I set the build hints to prevent the same external storage read/write permission in Windows and iOS?
See the section titled "Android Permissions" here, for a list of some API's that might trigger extra permissions. I suggest extracting the manifest from the XML and inspecting it. It should include two permissions based on your description you should have two permissions there:
android.permission.WRITE_EXTERNAL_STORAGE - which you should have been disabled when you applied android.blockExternalStoragePermission
android.permission.INTERNET - this one you actually need
I'm assuming you have a permission for media access and here it becomes a question of where it came from?
Did you use a cn1lib that might include a feature that triggers this?
Do you have a feature in the app that isn't active yet?
Once you have the specific name or results of this investigation comment here and I'll revise the answer with more details.

PhoneProductId in appxmanifest: Upgrade from Silverlight to Runtime vs. Map Service Application Id (wp RT 8.1)

I'm updating an app from Windows Phone Silverlight 8.1 to WP Runtime 8.1 and got an issue with the "PhoneProductId" in the Package.appxmanifest:
1) Either I provide the Id from the old Silverlight version of the app. Then I can update it in the console via "AppDeployCmd.exe" /targetdevice:de /update MyApp_1.2.3.4_AnyCPU.appxbundle" with no user data being lost. But when I run MapRouteFinder.GetDrivingRouteAsync(...) I get an InvalidCredentials-error, since I haven't provided the proper Map Service Application Id, which in RT needs to replace the PhoneProductId (in Silverlight, it needed to be provided via c#, alongside the Authentication Token).
2) Or I provide the Map Service Application Id and can use MapRouteFinder.GetDrivingRouteAsync properly. But then I can neither /update the app (error message "Application is not installed" in the console) because of different PhoneProductIds in the two app versions. I also can't /install it without first uninstalling it ("Could not register package").
Anybody got a way out of this dilemma?
I've now uploaded soulution number 2 to the store, with GetDrivingRouteAsync working before the upload. The update did work, without any user data being lost, so no problem here.
However, when using the version from the store, GetDrivingRouteAsync is again not working (same problem as in solution number 1).
Seems to be exactly the same issue as this one:
https://stackoverflow.com/questions/32891052/invalid-credentials-with-getdrivingrouteasync-only-when-i-create-packages-for-st

Silverlight FTP file upload not work in server

I have create a file upload project in silverlight
using FtpClient by following this link
(https://github.com/dittodhole/sharpLightFtp).
It works well in local development(visual studio) and local
iis server also.But when I host this into my server i get following problem.
var success = ftpClient.BasicConnect();
success becomes false.What may be the reason for this?
Actually I am the author of this library.
Did you read the README file? It explains the steps:
You need to follow this awesome tutorial to enable elevated trust in-browser, which is needed for socket-programming.
So, my guesses:
Missing signing/Missing reg-entry for the CA
or missing policy-file

Sharing Passbook Passes .pkpass

I created a simple demo passbook pass in iOS 6. I emailed it to myself and it works fine. Now I need to share it with people. I uploaded the .pkpass file to the server but safari is not able to recognize the file format or mime type and hence it does not download it.
Any ideas how can I share it?
Safari should recognise these.
I think you probably need to add the MIME type to your web server, so it knows how to present the file to visitors.
Edit: the MIME type you need to add to your web server is application/vnd.apple.pkpass
Passbook is only availiable on the iPhone 5 or phone users that have upgraded is iOS6. It is also available on the latest OS X Mountain Lion 10.8.2 release.
If the person doesn't have any of these, when they see it in their email, it will just show the .pkpass file as is. If they have Passbook on their device, it will do some graphical markup to it and they can click to add it to Passbook.
The MIME type has to be supported by your email server, but since you received the pass, it appears your server supports it, or doesn't care. In my case, we had issues with Amazon Web Services Simple Email Services as their WebAPI wasn't accepting files of type:
application/vnd.apple.pkpass
Which has been remedied.
https://forums.aws.amazon.com/thread.jspa?messageID=384277
To download a passbook file in Safari (mobile and desktop), you have add the correct mimetype to your server.
To do so, you can simply create an .htaccess file (or edit the existing one) and append the following line:
AddType application/vnd.apple.pkpass .pkpass
This will do the magic. After this change, if you'll click on a link <a href="..."> that points to a .pkpass file using Safari mobile on your iPhone it will automatically open it with Passbook.
I think that the pkpass files will only be recognised by:
Devices running iOS6 and above (i.e. with the passbook App installed)
Safari on OSX 10.8.2 (or above)
Edit: Google Chrome Version 23.0.1271.91 and above on iOS6 now also supports direct download of .pkpass files

Resources