I want to set up deep linking so that any url of myapp.io is opened by the Android app if installed.
Is this a valid pathPrefix? Or should it be "/*"?
"android": {
"intentFilters": [
{
"action": "VIEW",
"data": [
{
"scheme": "https",
"host": "*.myapp.io",
"pathPrefix": "*"
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
}
]
},
The code above is from my app.json as I'm using Expo, but I think it's clear what React Native values they map to.
It needs to be:
"pathPattern": ".*"
From the docs:
- pathPattern (string): a regex for paths that should be matched by the filter, e.g. ".*"
- pathPrefix (string): a prefix for paths that should be matched by the filter, e.g. "/records/" will match "/records/123"
https://docs.expo.io/workflow/configuration/
Related
im trying to implement universal links, but i cant not get it work, im using expo managed workflow, so heres the app.json config:
"expo": {
"scheme": "myapp",
"ios": {
"associatedDomains": ["applinks:myapp"],
}
},
so the scheme is for example is myapp and my server where is the well-known file is also https://myapp
here is the well-known-file:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "TEAM_ID.BUNDLE_IDENTIFIER",
"components": [
{
"/": "/*",
}
]
}
]
},
"activitycontinuation": {
"apps": [
"TEAM_ID.BUNDLE_IDENTIFIER"
]
},
"webcredentials": {
"apps": [ "TEAM_ID.BUNDLE_IDENTIFIER" ]
},
"appclips": {
"apps": ["TEAM_ID.BUNDLE_IDENTIFIER"]
}
}
everytime i enter to the page or enter that direction in safari it doesnt detect the app, BUUUUT if i do: myapp:// in safari it will ask me if i want to open it in the app, why using the scheme it works? and using https doesnt, need to share it with https so android users can open the app when click on it
I've already searched too many links but my problem still in pending.
According to documentation on https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-android I'm try to integrate Microsoft Account in android where user can SignIn through it, but i'm facing issue to signIn user in app. When I run app it shows me an error com.microsoft.identity.client.exception.msalclientexception: the redirect uri in the configuration file doesn't match with the one generated with package name and signature hash. please verify the uri in the config file and your app registration in azure portal.
My generated MSAL Configuration was
`com.example.microsoftintegrationandroid:host="com.example.microsoftintegration"{
"client_id" : "0fcce5cd-946f-471b-953a-3948dc69d97e",
"authorization_user_agent" : "DEFAULT",
"redirect_uri" : "msauth://com.example.microsoftintegration/A%2FoARUpzRHfPOezOHJootAPRWJ8%3D",
"authorities" : [
{
"type": "AAD",
"authority_url": "https://login.microsoftonline.com/7233866a-c721-44ae-b426-6b0e8386199b"
}
]
}`
but according to documentation my config file should resemble this example:
`{
"client_id" : "0984a7b6-bc13-4141-8b0d-8f767e136bb7",
"authorization_user_agent" : "DEFAULT",
"redirect_uri" : "msauth://com.azuresamples.msalandroidapp/1wIqXSqBj7w%2Bh11ZifsnqwgyKrY%3D",
"account_mode" : "SINGLE",
"authorities" : [
{
"type": "AAD",
"audience": {
"type": "AzureADandPersonalMicrosoftAccount",
"tenant_id": "common"
}
}
]
}`
and in file I've written JSON looks like this
`{
"client_id": "0fcce5cd-946f-471b-953a-3948dc69d97e",
"authorization_user_agent": "DEFAULT",
"redirect_uri": "msauth://com.example.microsoftintegration/A%2FoARUpzRHfPOezOHJootAPRWJ8%3D",
"account_mode": "SINGLE",
"authorities": [
{
"type": "AAD",
"authority_url": "https://login.microsoftonline.com/7233866a-c721-44ae-b426-6b0e8386199b"
}
]
}`
I can't figure out why this is happening because the config file's content was generated by Azure portal and package name, signature hash, and redirect URI match whatever is shown in the portal.
I'd appreciate any suggestions
Universal links on iOS work well.
I have an issue with Android.
Please see assetlinks and intentFilters.
I will appreciate any help.
SDK Version: 35.0.0
assetlinks - https://ocov.us/.well-known/assetlinks.json
"intentFilters": [
{
"action": "VIEW",
"autoVerify": true,
"data": {
"scheme": "https",
"host": "*.ocov.us"
},
"category": [
"BROWSABLE",
"DEFAULT"
]
}]
Playing with data.host helped.
I have a react-native app with multiple environments.
Dev, prod, ... Which means that I have multiple 'copies' of the app installed on the phone App Dev, App Prod.
These are under a different bundle identifier:
com.myapp.dev
com.myapp.prod
I use deep links to open the app, this works perfect on Android because it asks with which app you want to open it, but on iOS it just opens the first app that founds installed 😞 and i can't find the way to, for example:
Launch develop-app://whatever/1 and open it in the Dev app
Launch prod-app://whatever/1 and open it in the Prod app
What am i missing?
This are my defined url types:
Also the apple-app-site-association file looks like this:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234.com.myapp.dev",
"paths": ["*"]
},
{
"appID": "1234.com.myapp.prod",
"paths": ["*"]
}
]
}
}
Update
The first problem that i found was that the apple-app-site-association wasn't using a Content-Type header, so, the app could not recognize the file.
The paths that each environment should recognize should be defined:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234.com.myapp.dev",
"paths": ["/dev/*"]
},
{
"appID": "1234.com.myapp.prod",
"paths": ["/prod/*"]
}
]
}
}
Now i'm able to see the banner on the top of the website Open with App Dev as expected
You have to specify which path is to be opened by which app
For example, your domain is example.com
You have to specify a different path pattern for both dev & prod app in your apple-app-site-association file
For example, you can update your apple-app-site-association file as shown below
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234.com.myapp.dev",
"paths": ["/dev/*"]
},
{
"appID": "1234.com.myapp.prod",
"paths": ["/prod/*"]
},
]
}
}
Now, let us say you click on the urls below, you'll be directed to mentioned app in the comments
https://example.com/dev/123?id=3 // Opens dev app
https://example.com/dev?id=2 // Opens dev app
https://example.com/prod/123 // Opens prod app
https://example.com/prod // Opens prod app
https://example.com/prod/123?name=john // Opens prod app
I've built an App with react-native and expo. Installed it on my Android-TV and my Android-TV emulator.
The app works when I run it through the ES File Explorer app, however when I try to run it regularly by clicking it on the Android-TV app section I get a constant white screen.
Built the apk with expo through $exp build:android.
App.json code:
{
"expo": {
"name": "CommuniTV",
"description": "The future of watching TV is here!",
"slug": "CommuniTV",
"privacy": "public",
"sdkVersion": "26.0.0",
"platforms": ["ios", "android"],
"version": "1.0.4",
"orientation": "landscape",
"entryPoint": "./App.js",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"package": "project.communiTV.com",
"versionCode": 104,
"permissions": [],
"icon": "./AppIcon.png",
"adaptiveIcon": {
"foregroundImage": "./launcherIcon.png" // size is 1024x1024
}
}
}
}
Couldn't find any solution on the web and I'm stuck.
Any suggestions?
First screenshot - I click here I get a white screen
Second screenshot - I'll start it from here the App works fine
After spending some time looking at the native code I managed to solve this issue by adding the proper configuration to app.json:
"android": {
...
"intentFilters": [
{
"action": "MAIN",
"category": [
"LEANBACK_LAUNCHER"
]
}
]
},
More detailed answer can be found here: https://gist.github.com/miazga/2e6449e0c591e3ac8e22185b2edb447d
As recommended in this thread, Go to File -> Setting -> Build,Execution,Deployment -> Instant Run then uncheck the Enable Instant Run if it is checked, then run the project.
Also from this link, when your app starts, it first uses the theme of the launching activity to display the window background. If you don't specify windowBackground in your styles.xml, the default white will be used, and damage the UX.
Matt's answer seems to be oudated as of now, its throwing build time error while reading manifest.
TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at renderIntentFilterDatumEntries (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:33:17)
at /app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:37:70
at Array.map (<anonymous>)
at renderIntentFilterData (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:37:48)
at /app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:25:9
at Array.map (<anonymous>)
at renderIntentFilters (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidIntentFilters.js:22:24)
at runShellAppModificationsAsync (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidShellApp.js:632:115)
at async Object.createAndroidShellAppAsync (/app/turtle/node_modules/#expo/xdl/build/detach/AndroidShellApp.js:392:3)
at async runShellAppBuilder (/app/turtle/build/builders/android.js:95:9)
at async Object.buildAndroid [as android] (/app/turtle/build/builders/android.js:43:28)
at async build (/app/turtle/build/jobManager.js:181:33)
at async processJob (/app/turtle/build/jobManager.js:118:32)
at async Object.doJob (/app/turtle/build/jobManager.js:49:5)
at async main (/app/turtle/build/server.js:66:13)
I updated it with data property, now seems to work fine, tested on expo 39 & 40
Also note that you have to include "LAUNCHER" too in category or else some devices may still show white screen.
"intentFilters": [
{
"action": "MAIN",
"data":{},
"category": [
"LEANBACK_LAUNCHER",
"LAUNCHER"
]
}
]