Define file association in Mac with Electron - electron

I am trying to create a simple electron app, that opens Google office files from Google Drive, reads the link file and creates a new window containing that google doc page.
I can make it work, if I edit info.plist after building with electron-builder to make the app accept the file extensions '.gdoc, .gsheets and .gslides'.
Is there a smarter way that doesn't involve manually editing info.plist?

Electron-builder is supposed to be able to do that through specifying the FileAssociation. I've read of various issues with this but haven't needed it myself yet– if it works for you, please report back.
There is also the Windows only electron-regedit node module:
"File associations, file icons & open with... for electron apps
This module allows you to register your app in the windows registry,
manipulate context menus & handle native open, edit, print, preview
actions ect."
However for Google drive you might be looking at registering a protocol and url scheme. There is support for that electron-packager
protocol
Array of Strings
The URL protocol scheme(s) to associate the app with. For example,
specifying myapp would cause URLs such as myapp://path to be opened
with the app. Maps to the CFBundleURLSchemes metadata property. This
option requires a corresponding protocol-name option to be specified.
protocol-name
Array of Strings
The descriptive name(s) of the URL protocol scheme(s) specified via
the protocol option. Maps to the CFBundleURLName metadata property.

Related

Android: one app for multiple uses via parameters in AndroidManifest

It is possible to register one (Delphi) app for multiple uses, with more than one icon in App Chooser? For instance like this:
register app to open some file types (I know how to do that)
register to open/acces to any file, but App Chooser should show icon different than main app icon, and different text, not the app name - for instance "Base 64 encode/decode file"
same thing, for text files or other documents/images compatible with operation - "Convert to pdf"
All functionality is built in the same app, but operation, and icon in the App Choser, should depend of parameter passed in intent, as EXTRA_TEXT for instance. For instance, if EXTRA_TEXT is "b64enc" the app should auto encode the file on intent EncodedPath, then save base 64 encoded file in app documents folder, notify user "conversion complete", then close itself.
For example, app can use file extension to choose what to do with the file, but this is not enough for functionality I need.
I have seen this answer
Multiple Application Files in one Android app
and it is OK as some kind of guidance, but not really an answer on this question :-)
In Windows the same application can register itself in Win context menu for multiple purposes with different icons and different context menu text, and same program can do different operations on the file, depends on parameter passed to the program.
So, it is possible in Android, maybe via AndroidManifest, or I shoud use different approach? And if I must, is it possible to have multiple activities in Delphi app for Android?
Edit: I have found this blog
https://blog.andreamagni.eu/2019/02/how-to-add-android-app-shortcuts-to-a-fmx-application/
and looks like maybe it is possible by using shortcuts

Document provider inconsistency

I am using the new document provider functionality to try to export files to third party cloud services:
UIDocumentMenuViewController* activity = [[UIDocumentMenuViewController alloc] initWithURL:writer.file
inMode:UIDocumentPickerModeExportToService];
When I run this, I see iCloud, Google Drive and Dropbox as an option (and they appear to work). What I don't see, even though I have the app installed, is Box.
What's more odd is that when I use UIDocumentPickerModeOpen, Box does appear, along with iCloud, but Dropbox and Google Drive are missing. I can't open the file from either provider, though; it won't let me select my custom document type. In another app where I just export a CSV file is seems to work without issue to all providers.
The file uses a custom file type, which I'm guessing is part of the problem. There are other questions here about that and I believe I've correctly followed the instructions.
Did I miss a step when adding a the custom file type? Are there other options when creating the document menu? Are there bugs in the document providers? (I note that it works in all cases with iCloud Drive.)
At this moment only iCloud Drive supports all four modes: import, export, open and move. Dropbox and Google Drive don't support open. Box does support open. I don't think there is much we developers can do except waiting for all the cloud providers to support all modes.
I am also using a custom UTI, and this setting is working for me. I can select a .qvlibrary file from iCloud Drive, and open it with a security-scoped URL. Remember to call -[NSURL startAccessingSecurityScopedResource] before accessing the files or directories.

Component configuration file in xcode?

Lets say i want to develop an RSS Reader reusable component for iOS with a configuration file which can me updated by user. So my wish list is as follow:
Add the component to a new project in single click. Just like adding framework.
I also want that my source files are NOT visible to other user (developer).
And yes if there are resources associated with it should also seamlessly be added to new project.
And most importantly I want the developer to be able to adjust few parameters for my component eg specifying the URL for my RSS Reader.
In short after i am done all i want the developer to see are my header files and configuration file. Any ideas ?
You should use a fake framework as described here.

Config file to change values within an app

I'm having a problem meeting a requirement for an Java app I'm developing. My client must be able to deploy the app to multiple BES servers without the need to resign the code (or have any interaction with the developers). Currently the web address of one of their BES servers is hard coded into the app but they require the ability to change this value at will prior to deployment. (it can be assumed they will administrate any BES server the app is deployed from)
I've tried attaching a text file to the project which is read by the app but this is packaged along with the app, meaning it can't be manually edited (as far as I'm aware), I've also tried having a custom property in the JAD file but this needs resigned after any change.
Am I doing any of these approaches wrong or is there a better solution I'm missing?
Also, is it possible to deploy a simple text file to a BlackBerry via the BES to a specific file location? If so I could have my app read this file which would solve the problem?
Thanks,
Implement custom attachment handler in your application.
And send email with an attached xml-config file to BlackBerry device.
User opens the received message and selects the custom menu item provided by attachment handler.
And you can parse this xml config and act accordingly.
An easier way is to use a user defined ItPolicy to provide the configuration information you need.

How to list my application when you try to open a PDF in email?

I wanted to list my application in the list of other readers installed in the iphone when I try to open the PDF from the email. What settings do I need to do on my project so that my application is also listed in it.
Are you looking for Implementing Support for Custom File Formats?
Applications that are able to
open specific document or file formats
may register those formats with the
system. When the system or another
application needs to open a file, it
can hand that file off to your
application to do so. In order to
support custom file formats, your
application must:
Register the file types your
application supports with the system.
Implement the proper methods to open
files (when asked to do so by the
system).

Resources