Handling deep links to web.dyomedea.add, thus supporting invitations in the app too
This commit is contained in:
parent
c9be4dcc28
commit
aba2ddd907
|
@ -94,10 +94,19 @@ const Map: Component = () => {
|
|||
console.log({ caller: 'Intent receiver', intent });
|
||||
if (intent.action === 'android.intent.action.VIEW') {
|
||||
const url = new URL(intent.data);
|
||||
console.log({ caller: 'Intent receiver', intent, url });
|
||||
if (url.protocol === 'geo:') {
|
||||
const q = url.search;
|
||||
const [, lat, lon] = q.match(/q=([0-9.-]+),([0-9.-]+)/);
|
||||
console.log({ caller: 'Intent receiver', intent, url, lat, lon });
|
||||
findLocation(navigate, [lon, lat]);
|
||||
} else if (
|
||||
url.protocol === 'https:' &&
|
||||
url.hostname === 'web.dyomedea.app'
|
||||
) {
|
||||
location.hash = url.hash;
|
||||
location.pathname = url.pathname;
|
||||
}
|
||||
} else if (intent.action === 'android.intent.action.SEND') {
|
||||
const uri = intent.extras['android.intent.extra.STREAM'];
|
||||
importUrls([uri]);
|
||||
|
|
Loading…
Reference in New Issue