BigSur open command does not handle message:// URLs anymore, workarounds? - url

In macOS you can obtain (explained here how) the URL to a specific email. So that if you click to the that URL, or you paste it into a browser search bar, that specific email will open in Mail.app.
Such a URL looks like this message://<CALoR5A+vANPG9eCcHRHnO#mail.gmail.com>
In Catalina I could use the command open to reach such a URL from the command line, by typing
open -a "Mail.app" "message://<CALoR5A+vANPG9eCcHRHnO#mail.gmail.com>"
But with BigSur if I try that I get the following error
The file /Users/macbook/message:/<CALoR5A+vANPG9eCcHRHnO#mail.gmail.com> does not exist.
This behavior seems to be related to a bug in BigSur.
Two question
Do you know if the open command can still be used for that task somehow?
Alternatively, I am looking for a workaround. It must be possible to achieve the behavior I am expecting because if you past a message:// URL in Chrome, Safari or in a rich text editor which supports hyperlinks, it is correctly handled.
I have tried, unsuccessfully many approaches.
Swift script
import AppKit
NSWorkspace.shared.open(URL(string: "message://<CALoR5A+vANPG9eCcHRHnO#mail.gmail.com>")!)
The URL is nil.
Apple Script
tell application "Mail"
activate
open location "message://<CALoR5A+vANPG9eCcHRHnO#mail.gmail.com>"
end tell
I am not sure if the above code would have worked in Catalina, I just know that in my case it just opens the Mail app without doing anything else.
Using Chrome
If you paste a message:// URL in Chrome it asks you to confirm that you want to open it in the Mail app. This can be overridden with the following command:
defaults write com.google.Chrome URLWhitelist -array 'message://*'
Asking Chrome to open a URL for you looks like a easier task, but still the command
open -a "Google Chrome" "message://<CALoR5A+vANPG9eCcHRHnO#mail.gmail.com>"
fails with an error similar to the one shown before:
LoR5A+vANPG9eCcHRHnO#mail.gmail.com>"
The file /Users/macbook/message:/<CALoR5A+vANPG9eCcHRHnO#mail.gmail.com> does not exist.
Any ideas?

I found the reason why the open command does not work anymore: the angular brackets need to be escaped.
The following command does not work
open -a "Google Chrome.app" "message:<CALoR5A+vANPG9eCcHRHnO_fNTrzgbMpX666oBGxHWsRaXb5#mail.gmail.com>"
The following one opens the Mail app, which will complain that the URL is broken
open -a "Google Chrome.app" "message:CALoR5A+vANPG9eCcHRHnO_fNTrzgbMpX666oBGxHWsRaXb5#mail.gmail.com>"
Finally, by escaping the URL, it works:
open -a "Google Chrome.app" "message:%3CCALoR5A%2BvANPG9eCcHRHnO_fNTrzgbMpX666oBGxHWsRaXb5%40mail.gmail.com%3E"
Note, you can make the URL start with message: or message://, it does not matter.

Related

Angular route is not working with Cordova iOS

I'm facing an issue with Cordova, Cordova-ios 6.2.0 and Angular 12.0.
When I'm building my app with Cordova and launch it in an emulator (or with a device), I'm arriving to a white screen.
I did some research and try some "fix" but nothing worked.
Finlly, I've find that it could be because of the balise.
So, I tried to play with the tag and modify the href with ., ./, / but nothing worked.
I've tried without and it worked, but without routing.
Has someone already had this problem?
The Angular router needs the app to be hosted on a "proper" HTTP scheme and does not work with file: URLs. You can check how your app runs, if you open the JavaScript console for your app running on an iOS device with Chrome and typing location.href. If you see file: you need to set up a custom scheme.
Please checkout the documentation and this announcement https://cordova.apache.org/announcements/2020/06/01/cordova-ios-release-6.0.0.html

ios Firebase Dynamic Link not opening installed app

I've looked at other previous questions about this topic, and I haven't found the solution for my problem.
I've followed this Getting started with Firebase Dynamic Links on iOS, however if I click on the universal link for testing, https://appName.page.link, I get the following message:
Invalid Dynamic Link
Requested URL (https://appName.page.link/) must be a parsable and complete DynamicLink.
If you are the developer of this app, ensure that your Dynamic Links domain is correctly configured and that the path component of this URL is valid
The previous message makes me think that the created page created by Firebase is created yet, however when I visit the page:
https://appName.page.link/apple-app-site-association, I get the following data:
{"applinks":{"apps":[],"details":[{"appID":"TeamID.com.example.appName","paths":["NOT /_/*","/*"]}]}}
This means that the page has been successfully created.
I have verified that the TeamID has been set properly set in the Firebase settings, and also that the TeamID is the same from XCode and from the Apple developer account.
The URLSchemes, set in Xcode is com.example.appName and inside the Signing & Capabilities in the Associated Domains has the domain: applinks:appName.page.link
Is there anything that I'm missing to configure?
I ran into this issue as well following the video. If you continue in the video he mentions that there is a bug for iOS where you might need to completely uninstall the app, restart your device, and then reinstall the app.
for reference:
https://youtu.be/KLBjAg6HvG0?t=532
Did you created dynamic link here? Firebase > Dynamic Links > New Dynamic Link. Your link should looks like https://AppName.page.link/shareLink
I think this behavior is expected, clicking on the URL prefix (https://appName.page.link) without any path will not take the user to the app since the configurations (deep linking, campaign tracking, platform behavior, etc) is not set up yet.
But once you create a new link along with the prefix (e.g. https://appName.page.link/createdLink), it should work properly.
The bit that tripped me up was that I added "Associated Domains" to the "Release" tab instead of the "All" tab. So when I was running on my app, I'd also get the Invalid Dynamic Link error.

AirPrint Simulator - Unable to find server credentials

I'm unable to print to my printer simulator...
Here's what I've done:
Found Printer Simulator
https://developer.apple.com/download/more/?=for%20Xcode
download and install Additional Tools for Xcode (Latest non-beta version)
Open the resulting Hardware folder and then the Printer Simulator
Try printing to one of the printer simulators while watching the printer log (I used my mac)
I got an error when trying to print.
[05/Feb/2018:09:24:38 -0600] [Client 1] Unable to encrypt connection from 192.168.10.108: Unable to find server credentials.
I looked at this question but no luck.
Tried removing /private/var/tmp/printd
I didn't have printd in the directory
Ensured I only have one network connection (wireless)
I found at least a workaround:
Because the log of the print simulator says, there was a problem with something about encryption, I looked out for a print option without encryption. And there is!
When you add the printer, you can select which type of communication protocol or whatever you'd like to take. Default is "Secure AirPrint". However, you can select "AirPrint" (You can even select special drivers. Probably, you won't have any problems with the right ones, but I didn't try). And that works!
There's one bad thing: I got on this problem while testing printing from the iOS Simulator. There, you can't (or it seems like you can't) choose between "Secure AirPrint" and "AirPrint". So I'm still looking for the final solution....

How to open iTunes link with ionic inappbrowser?

So I am using the following code to try and open an app from inside my ionic app.
$cordovaInAppBrowser.open('itms-apps://itunes.apple.com/us/app/pages/id333903271?mt=8', '_system', 'location=yes');
I am trying on an iPad Air2 as well as simulator and no matter what I do I cannot get anything to happen, I do not get a url not found just nothing, no app opens. I have console logs above and below so I know the event is firing and no errors are happening. Also note that if I change the URL to be a google play link and I build for android this works fine. Any ideas on what could be going on?
Issue was in how I was calling the event, for whatever reason when switching the string to double quotes it worked over single quotes. Plugin must be specific.
Update your plugin more than version 1.3

Direct Update with custom URL not working on iOS 7.1.2

Since my upgrade to WL 6.2 direct update isn't working anymore on iOS.
What I'm trying to achieve is to get direct update working with the iPad and my windows machine. This way I can develop on my windows machine and use direct update to push my changes to the iPad (iOS 7.1.2). Following scenario describes my problem.
Create a new WL project in worklight studio on Mac (just installed the latest WL plugin today (platformVersion=6.2.0.00.20140724-2139). Add iOS as environment and replace the main.js with the following code:
function wlCommonInit(){
WL.Client.connect({
onSuccess: onConnectSuccess,
onFailure: onConnectFailure
});
}
function onConnectSuccess() {
WL.Logger.debug("Connect success.");
}
function onConnectFailure() {
WL.Logger.debug("Connect failed.");
}
Run the project as an Xcode project and use Xcode to deploy the application to an iPad. Now follow the following steps to reproduce the issue:
Make a modification in the index.html
Redeploy the app on your local worklight server in eclipse
Kill your app and restart it again
The direct update is working and your changes are reflected in your app. Yeah!
Now as a very basic next step, try to use the direct update with a Custom Server URL. Thick the Use custom URL checkbox in your iPad settings and change the Custom server URL to the URL of your local server.
When I now retry step 1 to 3, the direct update fails. On startup the app informs me an update is available, and when I click update the downloading progress bar appears but stays at 0% forever. In the custom server URL I only changed the IP to the IP of my macbook and removed the dash after the project name. I also tried changing the URL to the URL of my windows development machine (also with the latest WL eclipse plugin), but this results in the same behaviour.
One last remark; I would expect that when I disable the Use custom URL checkbox; direct update would work again. But this is not the case.
I've tried this and I cannot confirm it not working.
Added your code snippet to main.js
Enabled worklightSettings in application-descriptor.xml
Run on Worklight Development Server
Open project in Xcode
Run
Make a change and re-deploy
Verify Direct Update is received
Quit app
Make a change and re-deploy
Open myapp settings via Settings.app and enable Custom Server URL. The URL is already pointing to my (same) server
Open app
Verify Direct Update is received
You mentioned in the comments that once enabling the Custom Server URL option you also need to change the server address to another - I suggest to double-check you are indeed inputting the correct address. Maybe you have several network cards or alike.
Reinstalling eclipse resolved the problem. After reinstalling eclipse I also get the correct IP for the custom server URL in the server connectivity settings.

Resources