Universal link common to both Full App and AppClip - ios-universal-links

I want to use universal link common to both Full App and AppClip ex: https://example.com, and the desired scenario is as follows:
  1. When users install AppClip, scan this link will show AppClip Card
  2. When users install Full App, scan this link will show Full App
This is the content in the file https://example.com/.well-known/apple-app-site-association I have installed:
`{
"applinks": {
"apps": [],
"details": [{
"appID": "teamId.xxx.yyy.Example",
"paths": ["*"]
}]
},
"appclips": {
"apps": ["teamId.xxx.yyy.Example.Clip"]
}
}
`
Here is the Associated Domains setting on the Xcode side:
Full App: applinks:example.com
AppClip: appclips:example.com
But the results are not as expected, when scanning the link, it always shows the AppClip Card with the message: "This app clip is not currently available in your country or region" (even when I don't have AppClip installed), and Every time you test the main app, you will have to use “Clear Experience Cache”
Please help, thanks a lot.

Related

Angular Service Worker stuck in Safari after logout

We have a WebApp developed with Angular 14. It is deployed on Azure Blob Storage (static website).
Authentification is done with the msal library for javascript. Azure AD B2C is used as identity provider.
When we logout we call msalService.logoutRedirect() which works fine for all devices except for iPhones using the Safari browser. On iPhone/Safari it sometimes gets stuck (mostly when we had the phone locked for a few minutes first). Safari then displays a "neverending" network request - but I am convinced that the actual problem is some code in the service worker, as Safari gets completely frozen and you cannot even enter anything in the Console.
We are using Angular Service Worker to provide a PWA and everything is working fine if we serve the app without Service Workers.
I tried to take a look at ngsw/state (which usually works) but as soon as the bug occurs, this site is not reachable (I assume because Safari is stuck).
For me this looks like the service worker code is stuck in some loop (there are no errors shown in the console). When I then manually try to reload the page we get the following errors in the console: .
How can I find out what causes the problem here? I tried to debug the ngsw-worker.js file but it's almost 2k lines, so it's not that easy. Is there any simpler way to debug it?
Update:
This is how the ngsw-config.json looks like:
{
"$schema": "./node_modules/#angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
]
}
We are using google-fonts and fetch it from fonts.googleapis.com.
When we logout and the bug occurs the browser displays that it tries to load the google fonts - it is stuck there. Is it possible that it somehow thinks the google-fonts file should be in cache and it tries to fetch it but since it isn't there, it loads endlessly?
Update: I found a forum post that sounds very similar to the problem we have, unfortunately, it seems they never found a solution: apple forum
You could try to clone the msal library and change the code in the navigation client to always use replace instead of assign. Could be worth a shot since it helped me in the react oidc library i used.

Codemagic builds are not triggered from CodeCommit

I was following the instructions provided by Codemagic to add a WebHook to CodeCommit. Which includes creating a topic, adding to it a subscription and then configuring Notify in repository.
Anyhow, after merging or changing my master directly no build is still triggered.
Here is my setup:
Webhook in Codemagic:
Topic with a subscription:
Notification rule targets:
What I did notice is that notification target status is unreachable. But I have no clue what it actually means.
Does my problem occur because of the unreachable status?
What exactly does it mean then?
do you reference this document? https://docs.codemagic.io/configuration/webhooks/#setting-up-webhooks-for-aws-codecommit
Have you done following steps and can you see any incoming requests from AWS in Codemagic?
6. In the Codemagic UI, navigate to your application and select the Webhooks tab.
7. Under Recent deliveries, choose the most recent webhook, and copy the subscription link under the Results tab to your browser.
Well, apparently the documentation here has been updated:
https://docs.codemagic.io/configuration/webhooks/#setting-up-webhooks-for-aws-codecommit
There is a configuration that you have to update for your topic's access policy:
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "CodeNotification_publish",
"Effect": "Allow",
"Principal": {
"Service": "codestar-notifications.amazonaws.com"
},
"Action": "SNS:Publish",
"Resource": "arn:aws:sns:REGION:ACCOUNT_ID:REPOSITORY"
}
]
}
Make sure to update Resource!
"Resource": "arn:aws:sns:REGION:ACCOUNT_ID:REPOSITORY"
Copy ARN from your topic:
Apart from that(as said above) this step is important:
Under Recent deliveries (in Codemagic -> App -> Webhooks), choose the most recent webhook, and copy the
subscription link under the Results tab to your browser.

Is there a way to integrate an Expo app with firebase dynamic links without detaching?

Is there a way to integrate an Expo app with firebase dynamic links without detaching.
If you need to create new dynamic links on the fly you could use REST API to do it. In the much more likely scenario that you only need your app to open Firebase's dynamic links, you don't need to do anything other than configuring your Expo App to handle universal links (ie: deeplinks using http/https).
The checklist is something like this:
1. Configure your app.json
For Android, add the intentFilters property to your android property:
"android": {
"intentFilters": [
{
"action": "VIEW",
"data": [
{
"scheme": "https",
"host": "<your-domain>",
"pathPrefix": "/"
},
],
"category": [
"BROWSABLE",
"DEFAULT"
],
"autoVerify": true // required to work on newer android versions
}
]
]
For iOS, add the associatedDomains property to ios:
"ios": {
"associatedDomains": ["applinks:<your-domain>"]
}
2. Configure your domain to allow links from it to be handled by the apps
Android and iOS will allow your app to open links from your domain if you serve a configuration file from a specific location:
Android: https://<your-domain>/.well-known/assetlinks.json
iOS: https://<your-domain>/.well-known/apple-app-site-association
assetlinks.json will look something like this:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "<android-package-name>",
"sha256_cert_fingerprints":
["<your-sha256-certificate-fingerprints>"]
}
}]
And the apple-app-site-association like this:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "<your-team-id>.<ios-bundle-identifier>",
"paths": [ "*" ]
}
]
}
}
You can read more about these files here and here.
To obtain the SHA256 fingerprints of your app’s signing certificate you can use the keytool:
keytool -list -v -keystore <your-key-file>
After you enter your keystore password, it will print many of the keystore information including the SHA256 fingerprints.
If your site is hosted on Firebase both assetlinks.json and apple-app-site-association can be generated automatically if you create the Apps on your Firebase's project. Otherwise, just put these files on the root of your domain.
3. Create a Firebase dynamic link
I think this is step is mostly self explanatory but just a few notes:
Set up your short URL link: in the end you will have / that you send to your users
Set up your Dynamic Link: here you define your deelink (the link you want your app to handle)
Define link behavior for iOS: you mostly likely want to click on 'Open the deep link in your iOS App' and select your App from the list (if you haven't yet, create one App for each platform on your project)
Define link behavior for Android: same as previous but with a few more options to select
Configure (or not) campaign tracking and you're done.
Remember that you always should test your deeplinks by clicking instead of by entering directly on the browser. You may send the link to yourself on the WhatsApp or put on some notes app, for example.
Others resources that might be helpful:
https://docs.expo.io/versions/latest/workflow/linking/
https://reactnavigation.org/docs/deep-linking/
In addition to Pedro Andrade's instructions:
1.) Firebase requires the following details under your app > project settings for dynamic links to work.
Android: SHA 256 (App signing key certificate fingerprint) - this can be retrieved via play store > your app > App Integrity > SHA 256
iOS: App ID Prefix (Team ID): developer.apple.com > Certificates, Identifiers & Profiles > your app id > App ID Prefix
Surprisingly, these are mentioned almost nowhere in the docs, but do come up in stackoverflow results and other answers when googling errors that debugging preview links result in:
Android app '<bundle id>' lacks SHA256. AppLinks is not enabled for the app. Learn more.
iOS app '<bundle id>' lacks App ID Prefix. UniversalLinks is not enabled for the app. Learn more.
You can view debugging preview links by adding ?d=1 to your dynamic links.
https://firebase.google.com/docs/dynamic-links/debug
2.) Even if you use a page.link-style domain provided by firebase for your dynamic links, your associatedDomain/intentFilter domains in app.json should still be your actual domain
i.e if you're generating my-app.page.link shortLinks, that are dynamic links to my-app.com, you should use my-app.com in app.json
Pedro Andrade's solution works! Partially...
Explaining:
You must NOT add your dynamic link domain in intentFilters and associatedDomains, because it makes the app to open the link directly in the app, so, the dynamic link is not processed and you don't have access to the link generated by the dynamic link.
It works partially because of this: the dynamic link needs to be opened by the browser (chrome or safari) before being opened in the app.
Example: Open "<your-domain>.page.link/XLSj" in browser, browser will direct to generated link: "<your-domain>.com/params/54" to configured deep link.
I don't know any other way to 'read' the dynamic link by expo in managed workflow.

Alexa configuration deployment (staging and product) practice

Hello I am new to Alexa Skill Kit deployment using ask-cli. I just want to know if there are any deployment practices in place where we have different configurations i.e skills.json and .ask/config
For example, I have a repository some-alexa-skill with 2 branches: staging and production.
staging has this configuration for the skills.json
{
"skillManifest": {
"publishingInformation": {
"locales": {
"en-US": {
"name": "staging"
}
},
"isAvailableWorldwide": true,
"distributionCountries": []
},
"apis": {
"custom": {
"endpoint": {
"uri": "staging",
"sourceDir": "lambda/custom"
}
}
},
"manifestVersion": "1.0"
}
}
while production has this:
{
"skillManifest": {
"publishingInformation": {
"locales": {
"en-US": {
"name": "production"
}
},
"isAvailableWorldwide": true,
"distributionCountries": []
},
"apis": {
"custom": {
"endpoint": {
"uri": "production",
"sourceDir": "lambda/custom"
}
}
},
"manifestVersion": "1.0"
}
}
As I can observe skill.json should be "ignored" in the git respository since it will be replaced whenever merges occur during "release to production". I'm thinking of just ignoring skills.json and just change it when I want to deploy. But I am also considering the ability to allow others to deploy it in their own machines.
Any suggestions on how should I approach this using ask-cli?
Using the API should allow you to control your source and target destinations however you like. Using "profiles" will allow you to keep separate sets of credentials also.
There are 2 different levels of control when using the ask-cli. One is high level, and simplifies creating, cloning, and updating skills. These use the format:
"ask new ..." or "ask clone" to create or copy an existing skill
"ask deploy ..." to update parts or all of the skill.
A lower level API is available that allows more specific control. These use the format "ask api ..." and allow you to specify for example the specific file to upload/download to/from. I've found these better for projects with staging, develop, testing branches, etc.
In all of the ask commands, you can provide a profile that specifies the credentials for the Alexa developer account and the AWS account for the Lambda. Use the "ask init" to set these up. I keep separate profiles for:
my home/hobby projects using my personal accounts
my work related development/debugging
my work client projects accessible by our testers and clients.
The Amazon doc is pretty well written, and explains how to use the ask-cli. It just doesn't go into why you would use multiple profiles, etc.
I hope this helps. Start with the Amazon ask-cli quick start then follow the links to the reference documentation.
One thing to be careful about is to make sure that you are using the latest ask-cli download. As of today it is 1.0.0-beta.4. You can use the "ask -v" command to display your installed version. There were problems with the deploy command in the earlier 1.0.0-beta.1 version.

Apple App Site association not working

App Search API Validation Tool of "Apple" is not validating my domain.
https://search.developer.apple.com/appsearch-validation-tool
I am using universal links but "Link to Application" is showing me "Error".(http://www.awesomescreenshot.com/image/1719847/330979a43c4c6b2766da1e703447ee04)
Here is my "apple-app-site-association" file code.
{"applinks": {"apps": [],"details": {"XXXXXXXXXX.com.streatmanagement.threadshare": {"paths": ["*"]}}}}
Can someone please solve my query or send the sample of "apple-app-site-association" valid code?
Apple's API validation tool compares your website's association file to a store listing. If your app is not yet publicly available the error you listed will be displayed.
Your apple-app-site-association has a small typo where you specify the details (it should be an array). I also assume you're replacing the XXXX's with your app ID.
{
"applinks": {
"apps": [],
"details": [
{
"appID": "APPID.BUNDLEID",
"paths": [ "*" ]
}
]
}
}
Even if you get this error from Apple's validation tool, you can test Universal links. If your Universal Link does not work on your test device you need to inspect the device logs when you fresh install it and make sure your apple-app-site-association is available at the root of your site via https with no redirects. Sometimes there is issue if the content-type is not application/json (but the file name should remain exactly apple-app-site-association).

Resources