-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Elliot Hesp <[email protected]> Co-authored-by: Salakar <[email protected]>
- Loading branch information
1 parent
d347f4e
commit 9476444
Showing
135 changed files
with
4,589 additions
and
2,617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: Android Dynamic Links Setup | ||
sidebar_label: Android Integration | ||
description: Android requires additional configuration steps to be completed before you can receive dynamic links. | ||
--- | ||
|
||
## Configure your App in the Firebase Console | ||
|
||
Create a SHA-256 fingerprint using these [instructions](https://developers.google.com/android/guides/client-auth) for your app, | ||
and add to your app in your Firebase console. | ||
|
||
Next, go to the following location in your browser `[your-domain]/.well-known/assetlinks.json`. The response will have a target object | ||
containing a "package_name" which ought to have your app's package name. Please do not proceed until you see this, it may take a while to register. | ||
|
||
## AndroidManifest.xml Configuration | ||
|
||
Add your deep link domains to your `android/app/src/main/AndroidManifest.xml` so your app can receive the Dynamic Link data after it is installed/updated | ||
from the Play Store. Refer to the official docs to illustrate [setup](https://firebase.google.com/docs/dynamic-links/android/receive#add-an-intent-filter-for-deep-links). | ||
|
||
For example: | ||
|
||
```xml | ||
<intent-filter> | ||
<action android:name="android.intent.action.VIEW"/> | ||
<category android:name="android.intent.category.DEFAULT"/> | ||
<category android:name="android.intent.category.BROWSABLE"/> | ||
<data | ||
android:host="example.com" | ||
android:scheme="https"/> | ||
</intent-filter> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: iOS Dynamic Links Setup | ||
sidebar_label: Apple Integration | ||
description: iOS requires additional configuration steps to be completed before you can receive dynamic links. | ||
--- | ||
|
||
## Apple Account | ||
|
||
To setup Dynamic Links on iOS, it is a prerequisite that you have an Apple developer account [setup](https://developer.apple.com/programs/enroll/). | ||
|
||
## Configure your App in the Firebase Console | ||
|
||
Add an `App Store ID` & `Team ID` to your app in your Firebase console. If you do not have an `App Store ID` yet, you can put any number in here for now. | ||
Your `Team ID` can be found in your Apple developer console. | ||
|
||
<Image src="dl-apple-configure.jpg" alt="Apple Configuration" /> | ||
|
||
Test the domain (e.g. `https://your-dynamic-link-domain`) you have created in your Firebase console. Go to the following location in your browser `[your domain]/apple-app-site-association`. | ||
The response will have a details array property containing an object that has the property `appID`. That will be your app's app ID (It may take some time for | ||
your domain to register). Please ensure it is registered before proceeding. | ||
|
||
## Apple Developer Console | ||
|
||
Create a provisioning profile for your app. Please ensure you've enabled the `Associated Domain` capability which you should check before proceeding. | ||
|
||
<Image src="dl-apple-provision.jpg" alt="Apple Provisioning Profile" /> | ||
|
||
## Signing & Capabilities | ||
|
||
Open your app under the `TARGETS` header using XCode. Click the `Signing & Capabilities` tab. You will need to ensure your `Team` is registered, and your `Provisioning Profile` field is completed. | ||
Please add the domain you created in your Firebase console to the `Associated Domains` and prefix with `applinks:` | ||
|
||
<Image src="dl-apple-signing.jpg" alt="Signing & Capabilities" /> | ||
|
||
Click the `Info` tab, and add a `URL Type` to your project. The `Identifier` can be called `Bundle Id` or whatever you wish. Add your bundle identifier to the `URL Schemes` property. | ||
|
||
<Image src="dl-apple-urlscheme.jpg" alt="URL Schemes" /> | ||
|
||
## Dynamic Links With Custom Domains | ||
|
||
If you have set up a custom domain for your Firebase project, you must add the dynamic link URL prefix into your iOS project's `Info.plist` file by using the `FirebaseDynamicLinksCustomDomains` key. | ||
You can add multiple URLs as well. | ||
|
||
```xml | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>FirebaseDynamicLinksCustomDomains</key> | ||
<array> | ||
<string>https://custom.domain.io/path1</string> | ||
<string>https://custom.domain.io/path2</string> | ||
</array> | ||
|
||
...other settings | ||
|
||
</dict> | ||
</plist> | ||
``` | ||
|
||
If you don't add this, the dynamic link will invoke your app, but you cannot retrieve any deep link data you may need within your app, as the deep link will be completely ignored. | ||
|
||
## Test Dynamic Links | ||
|
||
To test your dynamic link, you will need to use a real device as it will not work on a simulator. You will also have to run the app in release mode (i.e. `flutter run --release`) as iOS will block you from opening | ||
the app in debug mode from a dynamic link. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
title: Dynamic Links for Firebase | ||
sidebar_label: Overview | ||
--- | ||
|
||
## What does it do? | ||
|
||
Dynamic Links are links that work the way you want, on multiple platforms, and whether or not your app is already installed. | ||
If a user opens a Dynamic Link on iOS or Android, they can be taken directly to the linked content in your native app. | ||
If a user doesn't have your app installed, the user can be prompted to install it; then, after installation, your app starts | ||
and can access the link. | ||
|
||
<YouTube id="LvY1JMcrPF8"/> | ||
|
||
## Installation | ||
|
||
<Tabs | ||
groupId="legacy-or-nullsafe" | ||
defaultValue="legacy" | ||
values={[ | ||
{ label: "Legacy", value: "legacy" }, | ||
{ label: "Null safety", value: "null-safe" }, | ||
]} | ||
> | ||
<TabItem value="legacy"> | ||
</TabItem> | ||
<TabItem value="null-safe"> | ||
|
||
Ensure you're using the Flutter `stable` channel: | ||
|
||
```bash | ||
$ flutter channel stable | ||
``` | ||
|
||
If your app is mixing legacy and null-safe packages, use the `--no-sound-null-safety` flag: | ||
```bash | ||
$ flutter run --no-sound-null-safety | ||
``` | ||
|
||
For legacy package imports, place the following ignore comment to hide Dart analyzer warnings: | ||
|
||
```dart | ||
// ignore: import_of_legacy_library_into_null_safe | ||
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
|
||
### 1. Add dependency | ||
|
||
<Tabs | ||
groupId="legacy-or-nullsafe" | ||
defaultValue="legacy" | ||
values={[ | ||
{ label: "Legacy", value: "legacy" }, | ||
{ label: "Null safety", value: "null-safe" }, | ||
]} | ||
> | ||
<TabItem value="legacy"> | ||
|
||
```yaml {5} title="pubspec.yaml" | ||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
firebase_core: "^{{ plugins.firebase_core }}" | ||
firebase_analytics: "^{{ plugins.firebase_dynamic_links }}" | ||
``` | ||
</TabItem> | ||
<TabItem value="null-safe"> | ||
```yaml {5} title="pubspec.yaml" | ||
dependencies: | ||
flutter: | ||
sdk: flutter | ||
firebase_core: "^{{ plugins.firebase_core }}" | ||
firebase_dynamic_links: "^{{ plugins.firebase_dynamic_links_ns }}" | ||
``` | ||
</TabItem> | ||
</Tabs> | ||
### 2. Download dependency | ||
``` | ||
$ flutter pub get | ||
``` | ||
|
||
### 4. Rebuild your app | ||
|
||
Once complete, rebuild your Flutter application: | ||
|
||
```bash | ||
$ flutter run | ||
``` | ||
|
||
## Platform Integration | ||
|
||
Before using Dynamic Links, ensure you have configured your specific platform: | ||
|
||
- [Android](./android-integration.mdx) | ||
- [Apple](./apple-integration.mdx) | ||
|
||
## Next steps | ||
|
||
Once your platforms have been configured, head over to the [Usage](./usage.mdx) documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.