Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 637b73c

Browse files
authored
Merge pull request #60 from dolbyio-samples/Links-Support
Universal link support
2 parents 921a08b + a6f65a9 commit 637b73c

File tree

8 files changed

+47
-15
lines changed

8 files changed

+47
-15
lines changed

examples/mobile/android/app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
package="io.dolby.videocall">
44

55
<uses-permission android:name="android.permission.INTERNET" />
6-
<uses-permission android:name="android.permission.VIBRATE"/>
7-
<uses-permission android:name="android.permission.CAMERA"/>
6+
<uses-permission android:name="android.permission.VIBRATE" />
7+
<uses-permission android:name="android.permission.CAMERA" />
8+
89
<application
910
android:name=".MainApplication"
1011
android:allowBackup="false"
@@ -24,13 +25,16 @@
2425
<action android:name="android.intent.action.MAIN" />
2526
<category android:name="android.intent.category.LAUNCHER" />
2627
</intent-filter>
27-
<intent-filter>
28+
<intent-filter
29+
android:autoVerify="true"
30+
tools:targetApi="m">
2831
<action android:name="android.intent.action.VIEW" />
29-
3032
<category android:name="android.intent.category.DEFAULT" />
3133
<category android:name="android.intent.category.BROWSABLE" />
32-
33-
<data android:scheme="dolbyio" />
34+
<data
35+
android:host="experience.dolby.io"
36+
android:pathPrefix="/videocall"
37+
android:scheme="https" />
3438
</intent-filter>
3539
</activity>
3640
</application>

examples/mobile/ios/DolbyIOVideoCall.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
E8343E44290F877E008FDB2C /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
7676
E8343E45290F877E008FDB2C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7777
E843E390292EF9AA00F8AEA5 /* InternalReleaseSettings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = InternalReleaseSettings.xcconfig; sourceTree = "<group>"; };
78+
E84EF15029511E0000EA0E83 /* DolbyIOVideoCall.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DolbyIOVideoCall.entitlements; sourceTree = "<group>"; };
7879
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
7980
/* End PBXFileReference section */
8081

@@ -206,6 +207,7 @@
206207
E8343E3F290F877E008FDB2C /* DolbyIOVideoCall */ = {
207208
isa = PBXGroup;
208209
children = (
210+
E84EF15029511E0000EA0E83 /* DolbyIOVideoCall.entitlements */,
209211
E8343E40290F877E008FDB2C /* LaunchScreen.storyboard */,
210212
E8343E41290F877E008FDB2C /* AppDelegate.h */,
211213
E8343E42290F877E008FDB2C /* main.m */,
@@ -563,6 +565,7 @@
563565
buildSettings = {
564566
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
565567
CLANG_ENABLE_MODULES = YES;
568+
CODE_SIGN_ENTITLEMENTS = DolbyIOVideoCall/DolbyIOVideoCallDebug.entitlements;
566569
CURRENT_PROJECT_VERSION = 1;
567570
ENABLE_BITCODE = NO;
568571
INFOPLIST_FILE = DolbyIOVideoCall/Info.plist;
@@ -595,6 +598,7 @@
595598
buildSettings = {
596599
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
597600
CLANG_ENABLE_MODULES = YES;
601+
CODE_SIGN_ENTITLEMENTS = DolbyIOVideoCall/DolbyIOVideoCall.entitlements;
598602
CURRENT_PROJECT_VERSION = 1;
599603
ENABLE_BITCODE = NO;
600604
INFOPLIST_FILE = DolbyIOVideoCall/Info.plist;

examples/mobile/ios/DolbyIOVideoCall/AppDelegate.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ - (BOOL)application:(UIApplication *)application
6666
return [RCTLinkingManager application:application openURL:url options:options];
6767
}
6868

69+
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
70+
{
71+
return [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
72+
}
73+
6974
// MARK: Keychain Utility
7075

7176
/// Deletes all Keychain items accessible by this app if this is the first time the user launches the app
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.developer.associated-domains</key>
6+
<array>
7+
<string>applinks:experience.dolby.io</string>
8+
</array>
9+
</dict>
10+
</plist>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.developer.associated-domains</key>
6+
<array>
7+
<string>applinks:experience.dolby.io</string>
8+
</array>
9+
</dict>
10+
</plist>

examples/mobile/ios/DolbyIOVideoCall/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
<key>CFBundleURLTypes</key>
2424
<array>
2525
<dict>
26+
<key>CFBundleTypeRole</key>
27+
<string>Editor</string>
2628
<key>CFBundleURLSchemes</key>
27-
<array>
28-
<string>dolbyio</string>
29-
</array>
29+
<array/>
3030
</dict>
3131
</array>
3232
<key>ITSAppUsesNonExemptEncryption</key>

examples/mobile/src/App.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ import React from 'react';
1010

1111
import {Navigator} from './screens/Navigator';
1212
import fetch from './utils/fetch.util';
13+
import {SHARE_LINK, SHARE_PATH} from './utils/share.util';
1314
import {validateToken} from './utils/validation.util';
1415

15-
export const SHARE_SCHEME = 'dolbyio://';
16-
export const SHARE_PATH = 'conference';
17-
1816
const App = () => {
1917
const linking = {
20-
prefixes: [SHARE_SCHEME],
18+
prefixes: [SHARE_LINK],
2119
config: {
2220
screens: {
2321
UserNameInput: SHARE_PATH,
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import {SHARE_PATH, SHARE_SCHEME} from '../App';
1+
export const SHARE_LINK = 'https://experience.dolby.io/';
2+
export const SHARE_PATH = 'videocall/';
23

34
export const getShareURL = (id: string, token: string) => {
4-
return `${SHARE_SCHEME + SHARE_PATH}?id=${encodeURIComponent(
5+
return `${SHARE_LINK + SHARE_PATH}?id=${encodeURIComponent(
56
id,
67
)}&token=${token}`;
78
};

0 commit comments

Comments
 (0)