Toast Notifications do not work when application packaged into Appx package - delphi

I have developed a Microsoft Store app and I want to add Toast notifications.
The application is developed using Delphi 10.2.3 and I am using "Desktop Bridge" technology to convert it into an Appx package for the Microsoft Store. Toast Notifications works fine until I package the application into an Appx package (for the Store or Sideloading).
When running from appx and SideLoading, Toast notifications do not work and my app is not listed in the Windows Settings as a notification sender. I figured there must be some manifest extension I need to define. There was a (now deprecated) appxmanifest setting ToastCapable="true", but I am reading that is no longer used nor required for Windows 10.
I have Toast Notification working just fine when I run the application executable, but not when I install it from an Appx package. How do I get Windows 10 to understand my application is a Notification Sender?

Unfortunately it will not work using the provided TNotificationCenter component (I tested in many versions including 10.2.3).
The reason is described in this link: https://blogs.msdn.microsoft.com/universal-windows-app-model/2017/01/31/how-to-ensure-your-toast-notifications-continue-to-work-when-converting-your-win32-app-into-a-windows-store-app-using-project-centennial/
There is a simple fix but you need to modify the component source code. When publishing to the Windows Store, TNotificationCenter should not create a shortcut for your app and should not provide an application ID when creating the IToastNotifier instance. This will be done automatically for you.
I ended up writing my own library to manage Windows 10 notifications because I wanted more elaborate scenarios and custom XML payloads then what is offered but I can confirm that it works when done as per Microsoft instructions.
I compared my classes with System.Win.Notification (found in source\\rtl\common) and here are some tips that you could try to make it work (untested):
#1 - constructor for TNotificationCenterWinRT
FToastNotifier := TToastNotificationManager.Statics.CreateToastNotifier(LWSAppID);
should be ...
FToastNotifier := TToastNotificationManager.Statics.CreateToastNotifier();
#2 - TNotificationCenterWinRT.DoPresentNotification
if CreateShortcut then
should be ...
if True then
Note: if you decided to modify the source file, it is recommended to first make a copy of the file in your project folder and modify that instead.

Related

Opening public iOS files using a Delphi FMX app

I am developing a document viewer app that should be able to handle a custom file type. I already managed to resister my app as default handler for the file type using CFBundleDocumentTypes in my info.plist.
This enables me to choose a file from the explorer and open it in my app using the "copy to..." feature in the sharing options of the file.
The behavior of that feature isn't ideal for me, as it is not very intuitive for new users.
Also the files are (as the name already said) always copied to the internal Directory of my App, which changes their names and wastes a lot of space when opening the same file multiple times.
Adding LSSupportsOpeningDocumentsInPlace to the info.plist changes "copy to.." to be "open in..." which is also triggered by just tappin the file. On the iOS side this is exactly what I want, but now the URL my App receives is security scoped meaning I can't just access the File like one of my own.
The Apple Developer Documentation suggests either requesting Access by using startAccessingSecurityScopedResource() or by using the UIDocument class.
Both of which don't seem to work, I can't find any implementation of startAccessingSecurityScopedResource() in the iOSAPI and UIDocument needs a NSUrl which I can't create from the String "Url" which I get passed on when opening the App, since it is security scoped and can't be accessed.
Is there any other way to gain Access to security scoped Resources using Delphi or did I maybe miss something when looking through the iOSAPI?
I am using the following Versions:
Delphi 10.4 Sydney Patch 3
Platform Assistant Server 21.0
macOS Catalina 10.15.6
Xcode 11.7
iPhone 7 with iOS 13.7

Print raw data in UWP

I'm developing an app in UWP. I need to send to my printer a RAW string (or file) and get that printed. I succed in using the old RawPrinterHelper from here.
I have some problems verifiyng the app using the Windows App Certification Kit.
I get errors like this one :
API ClosePrinter in winspool.drv is not supported for this application type. MyApp.dll calls this API.
I think that DllImport() in RawPrinterHelper is wrong.
Is there a way to use a diffent RawPrinterHelper or bypass the Windows App Certification Kit in some way?
P.S. I need to publish the app on the Microsoft Store.
If you have already run the WACK test with the release build, then as the error described there are APIs not supported for the windows store app. More details please reference Supported API test.
Is there a way to use a diffent RawPrinterHelper or bypass the Windows App Certification Kit in some way
For print relative features in windows store app, please follow this tutorial and the official sample. This provide alternatives to the windows print relative APIs. Details please reference Printing and documents section of Alternatives to Windows APIs in Universal Windows Platform (UWP) apps.
If you want the print feature with no print dialog you may reference this thread.

Delphi and quickbooks examples

We have created a delphi app to connect to quickbooks 11 pro.
We are trying to use BeginSession from the TLB file and it works fine when creating a new company but after restoring a file from one of our clients, which might have been from a newer release it won't connect. But QB doesn't give any error messages, is there a way to make this happen ?
Thanks
Andy
Download the QuickBooks SDK if you haven't already done so, then try using the SDKTestPlus3 tool to see if it can access the company file. If it can't the problem is probably with the company file, if it can the problem is probably with your program.

Does BlackBerry support demo/beta releases for its app developers?

I am interested in developing an app for BlackBerry devices, and was wondering if they support the concept of demo or beta releases for their app developers? By this, I mean the ability to deploy a beta or demo version of my app to a limited/restricted audience, such as business partners, customers, external beta testers, etc. Nothing in their Testing and Deployment documentation indicates either way. Thanks in advance!
There isn't a built in beta process in App World for BlackBerry 10, but you can share the debug version of your app with your beta participants. When you create a debug token, you specify which PINs you want it to be valid for. The debug token will only install on a device with one of those PINs, and your app will only install on a device with your debug token on it. The token will only be valid for 30 days. You would have to deploy it with the command line tools and not App World.
This link on the BlackBerry Developer blog explains how to do it: http://devblog.blackberry.com/2012/04/debug-token/
It's for PlayBook, but the same process applies for BlackBerry 10 as well.
I actually don't know if RIM themselves have anything formal, but since I've always released BlackBerry apps on more than just the official App World store, I've used a beta testing system that is independent of RIM. Luckily, the legacy BlackBerry Java platform gives you the freedom to do this, free of charge. (Note that this answer is not about the upcoming BB10 platform!)
Over-the-Air (OTA) Installation
You can have your beta testers install your beta versions, Over-The-Air (OTA). Unlike iOS, for example, you aren't limited to a certain number of test devices, and you don't have to tell RIM what the unique identifiers of all the test devices are.
So, what I do is just put beta versions of my apps on a webserver, and send links to beta testers that allows them to download them. So, you are in control of who gets access. If you need security to limit the beta version to nobody except the official beta testers, then you are certainly free to add password protected logins to your webserver. That works the same way it would for any other secure web content.
If you do this (OTA), here are a few references:
http://www.blackberryinsight.com/2008/07/08/howto-setup-an-apache-webserver-to-deliver-blackberry-ota-applications/
Blackberry over the air installation
https://stackoverflow.com/a/10307074/119114
There are a couple steps to be aware of:
You normally just upload a .cod file to BlackBerry App World. If you want to deploy an app to your own webserver, you also need the .jad file. A JAD file is basically just a descriptor of the app, that can redirect a BlackBerry browser to the .cod file for installation. Your build process is already probably generating the .jad file for you, in the same output directory where it generates your .cod files.
You may need to configure your webserver to properly setup MIME types for files with a .jad extension. If you use Apache, then this is what you would put in your httpd.conf file:
AddType text/vnd.sun.j2me.app-descriptor jad
you may also need to add a MIME type definition for the .cod type, too
AddType application/vnd.rim.cod .cod
If you don't have access to the web server's httpd.conf file, but can place the JAD and COD in your own user directory, then you can configure the MIME types in a local .htaccess file.
Depending on your web server configuration, there may be a couple more steps necessary. Check the OTA links I provided above.
Desktop Installation
Another option is to simply email your beta versions to beta testers, and have them install on their devices using BlackBerry Desktop Software. I don't do this, but it is another way to accomplish the same thing. For this, you use the .cod file, and also the .alx file, which is also generated by the normal BlackBerry build process.
Note that some of the project properties that get put into the .alx or .jad files are things that you don't need to worry about if you only deploy the .cod file directly to BlackBerry App World. If you use one of the options (ALX for Desktop installation, or JAD for OTA), then I would recommend opening up the .alx or .jad file and just inspecting the values for correctness. They're normal text files, and most of the values should be self-explanatory. I believe all settings can be configured from inside your IDE. If you use the BlackBerry Eclipse plugin, right click on your project, select Properties and look around there.
Here are the official RIM docs on all your installation options
its not possible. When you publish your app in app world, it will be available to all users. So you cant set any special conditions like- available only to some people. Else make it in un published mode. Then only users with sandbox id can access your app.
Check the below link for BB 10 Cascades beta 3 release(Preferrable way of development in BB 10)
https://developer.blackberry.com/cascades/
For BB 10,they are plenty of ways for developing the applications ,check the below link
https://developer.blackberry.com/platforms/

Where to get BlackBerry CSK File for PhoneGap?

I want to use PhoneGap to sign my BlackBerry App. When I go to add the key files it asks for a CSK file.
I went to https://www.blackberry.com/SignedKeys/ and requested keys.
However the files sent to me were 3 different CSI files(RBB, RCR, RRT).
How and where can I get the CSK and DB file needed to sign apps on PhoneGap?
First you need to install the blackberry SDK (as part of Eclipse if you're using this IDE, otherwise get the standalone java one).
Then follow these steps.
Basically this will store your key locally, then you create a backup of it in the form of a .csk+.db files.
Adobe® PhoneGap™ Build currently provides a default BlackBerry development version for all users, which provides an Over-The-Air install for your PhoneGap applications. However, to distribute your own BlackBerry applications, you will need to register with RIM for your own keys, and then import those keys into PhoneGap Build.
To register, fill out the form on RIM's site , and, once you receive your keys, follow the installation process locally.. using the steps mentioned here

Resources