From 1186523cc94dbcc3d44b059e5109cd5883262771 Mon Sep 17 00:00:00 2001
From: Igor Bezlepkin
Date: Wed, 9 Feb 2022 14:35:16 +0300
Subject: [PATCH] Update README.md
The solution to the malformed document problem. First element should be
---
README.md | 400 +++++++++++++++++++++++++++---------------------------
1 file changed, 203 insertions(+), 197 deletions(-)
diff --git a/README.md b/README.md
index 89d2e9b..e1a4e33 100644
--- a/README.md
+++ b/README.md
@@ -1,53 +1,53 @@
-
-
-@nativescript-community/universal-links
-
+
+
+
@nativescript-community/universal-links
+
-
-
-
-
- Universal links (IOS) and App Links (Android) support for NativeScript.
-
-
-
-
-
-
-When a user clicks a link to a website, it opens in the default web browser (Safari/Chrome). Universal linking allows your app to open instead of the web browser.
-
-Apple calls this _Universal Links_ and Google calls it _App Links_, but they mean the same thing.
-
-|
|
|
-| --- | ----------- |
-| iOS Demo | Android Demo |
-
+
+
+
+
+ Universal links (IOS) and App Links (Android) support for NativeScript.
+
+
+
+
+
+
+When a user clicks a link to a website, it opens in the default web browser (Safari/Chrome). Universal linking allows your app to open instead of the web browser.
+
+Apple calls this _Universal Links_ and Google calls it _App Links_, but they mean the same thing.
+
+|
|
|
+| --- | ----------- |
+| iOS Demo | Android Demo |
+
[](#table-of-contents)
[](#table-of-contents)
-## Table of Contents
-
+## Table of Contents
+
* [Installation](#installation)
* [Implementing Universal Links](#implementing-universal-links)
* [iOS](#ios)
@@ -57,187 +57,193 @@ Apple calls this _Universal Links_ and Google calls it _App Links_, but they mea
* [Setup](#setup)
* [Build](#build)
* [Demos](#demos)
-* [Questions](#questions)
-
+* [Questions](#questions)
+
[](#installation)
[](#installation)
-## Installation
-Run the following command from the root of your project:
-
-`ns plugin add @nativescript-community/universal-links`
-
+## Installation
+Run the following command from the root of your project:
+
+`ns plugin add @nativescript-community/universal-links`
+
[](#implementing-universal-links)
[](#implementing-universal-links)
-## Implementing Universal Links
-
-Both iOS (9.0 and newer) and Android (all versions) provide good APIs for universal linking.
-
-### iOS
-
-Apple introduced a new deep linking API in iOS 9.0 called “Universal Links”. It provides a better user experience than the hacky deep linking options that existed in iOS 8.0 and below.
-
-First step is to add a file to the root of your website called `apple-app-site-association`. This is a JSON file and it looks like this:
-
-```javascript
-{
- "applinks": {
- "apps": [],
- "details": [
- {
- "appID": "TEAM_ID.BUNDLE_ID", // ex: "9JA89QQLNQ.com.apple.wwdc"
- "paths": [ "/blog/*"]
- }
- ]
- }
-}
-```
-
-- This file will be downloaded automatically by every single user that installs or upgrades your iOS app.
-- It **_MUST_** be served over HTTPS with a valid SSL certificate. If you need to test this, I recommend using https://ngrok.io.
-- This file is only fetched once when the user first installs or upgrades the app. It must live on your website before your app is released. This also means that you can’t add new deep linking url patterns to your app until you push out a new app update to force users to refresh the file.
-- I suggest using this [Apple App Site Association (AASA) Validator](https://branch.io/resources/aasa-validator/) to confirm your `apple-app-site-association` is correct.
-
-Check out [Apples' docs](https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW2) for more info.
-
-Next, you need to add the Associated Domains to your IOS project, either using XCode or manually adding the following code to your `App_Resources/IOS/app.entitlements` file. Please note the `applinks:` prefix, it won't work without it.
-
-```xml
-com.apple.developer.associated-domains
-
- applinks:www.example.com
-
-```
-
-### Android
-
-In Android, universal linking is implemented using Intent Filters. By adding a BROWSABLE intent filter, you are saying that your app can be started by a user clicking on a website url.
-
-You don't need any server side changes for Android, only modify your app to add the Intent Filter.
-Add this code to your `App_Resources/Android/src/main/AndroidManifest.xml` file:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
+## Implementing Universal Links
+
+Both iOS (9.0 and newer) and Android (all versions) provide good APIs for universal linking.
+
+### iOS
+
+Apple introduced a new deep linking API in iOS 9.0 called “Universal Links”. It provides a better user experience than the hacky deep linking options that existed in iOS 8.0 and below.
+
+First step is to add a file to the root of your website called `apple-app-site-association`. This is a JSON file and it looks like this:
+
+```javascript
+{
+ "applinks": {
+ "apps": [],
+ "details": [
+ {
+ "appID": "TEAM_ID.BUNDLE_ID", // ex: "9JA89QQLNQ.com.apple.wwdc"
+ "paths": [ "/blog/*"]
+ }
+ ]
+ }
+}
+```
+
+- This file will be downloaded automatically by every single user that installs or upgrades your iOS app.
+- It **_MUST_** be served over HTTPS with a valid SSL certificate. If you need to test this, I recommend using https://ngrok.io.
+- This file is only fetched once when the user first installs or upgrades the app. It must live on your website before your app is released. This also means that you can’t add new deep linking url patterns to your app until you push out a new app update to force users to refresh the file.
+- I suggest using this [Apple App Site Association (AASA) Validator](https://branch.io/resources/aasa-validator/) to confirm your `apple-app-site-association` is correct.
+
+Check out [Apples' docs](https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW2) for more info.
+
+Next, you need to add the Associated Domains to your IOS project, either using XCode or manually adding the following code to your `App_Resources/IOS/app.entitlements` file. Please note the `applinks:` prefix, it won't work without it.
+
+```xml
+
+
+
+
+ com.apple.developer.associated-domains
+
+ applinks:www.example.com
+
+
+
+```
+
+### Android
+
+In Android, universal linking is implemented using Intent Filters. By adding a BROWSABLE intent filter, you are saying that your app can be started by a user clicking on a website url.
+
+You don't need any server side changes for Android, only modify your app to add the Intent Filter.
+Add this code to your `App_Resources/Android/src/main/AndroidManifest.xml` file:
+
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
[](#usage)
[](#usage)
-## Usage
-
-Call the `registerUniversalLinkCallback` somewhere in the startup of your app. This Angular example puts it in the AppComponent's ngOnInit method to provide a callback method which will receive an Universal Link object every time your app is opened by a website link:
-
-```js
-import { Component, OnInit } from "@angular/core";
-import { registerUniversalLinkCallback } from "@nativescript-community/universal-links";
-
-@Component({
- selector: "my-app",
- template: ""
-})
-export class AppComponent {
- constructor() {}
-
- ngOnInit() {
- registerUniversalLinkCallback(ul => {
- // use the router to navigate to the screen
- });
- }
-}
-```
-
-The universal link object has the following structure:
-
-```JSON
-{
- "href": "https://www.example.com/blog?title=welcome",
- "origin": "https://www.example.com",
- "pathname": "/blog",
- "query": "?title=welcome"
-}
-```
-
-There is also a `getUniversalLink()` method that will return the last universal link which opened the app. This is useful in scenarios where your app is protected by a login screen. Check if the user is authenticated and then navigate to the desired path.
-
-```js
-import { getUniversalLink } from "nativescript-plugin-universal-links";
-
-const ul = getUniversalLink();
-```
-
-
+## Usage
+
+Call the `registerUniversalLinkCallback` somewhere in the startup of your app. This Angular example puts it in the AppComponent's ngOnInit method to provide a callback method which will receive an Universal Link object every time your app is opened by a website link:
+
+```js
+import { Component, OnInit } from "@angular/core";
+import { registerUniversalLinkCallback } from "@nativescript-community/universal-links";
+
+@Component({
+ selector: "my-app",
+ template: ""
+})
+export class AppComponent {
+ constructor() {}
+
+ ngOnInit() {
+ registerUniversalLinkCallback(ul => {
+ // use the router to navigate to the screen
+ });
+ }
+}
+```
+
+The universal link object has the following structure:
+
+```JSON
+{
+ "href": "https://www.example.com/blog?title=welcome",
+ "origin": "https://www.example.com",
+ "pathname": "/blog",
+ "query": "?title=welcome"
+}
+```
+
+There is also a `getUniversalLink()` method that will return the last universal link which opened the app. This is useful in scenarios where your app is protected by a login screen. Check if the user is authenticated and then navigate to the desired path.
+
+```js
+import { getUniversalLink } from "nativescript-plugin-universal-links";
+
+const ul = getUniversalLink();
+```
+
+
[](#demos-and-development)
[](#demos-and-development)
-## Demos and Development
-
-
-### Setup
-
-To run the demos, you must clone this repo **recursively**.
-
-```
-git clone https://github.com/@nativescript-community/universal-links.git --recursive
-```
-
-**Install Dependencies:**
-```bash
-npm i # or 'yarn install' or 'pnpm install'
-```
-
-**Interactive Menu:**
-
-To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
-
-### Build
-
-```bash
-npm run build
-
-npm run build.angular # or for Angular
-```
-
-### Demos
-
-```bash
-npm run demo.[ng|react|svelte|vue].[ios|android]
-
-npm run demo.svelte.ios # Example
-```
+## Demos and Development
+
+
+### Setup
+
+To run the demos, you must clone this repo **recursively**.
+
+```
+git clone https://github.com/@nativescript-community/universal-links.git --recursive
+```
+
+**Install Dependencies:**
+```bash
+npm i # or 'yarn install' or 'pnpm install'
+```
+
+**Interactive Menu:**
+
+To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
+
+### Build
+
+```bash
+npm run build
+
+npm run build.angular # or for Angular
+```
+
+### Demos
+
+```bash
+npm run demo.[ng|react|svelte|vue].[ios|android]
+
+npm run demo.svelte.ios # Example
+```
[](#questions)
[](#questions)
-## Questions
-
-If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
\ No newline at end of file
+## Questions
+
+If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).