Skip to content
Snippets Groups Projects
Commit 493eda7a authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

Merge branch '67-feat-implement-universal-links' into 'main'

feat: implement universal/app links

Closes #67

See merge request !26
parents f0c9fe63 75f1d1ec
No related branches found
No related tags found
1 merge request!26feat: implement universal/app links
...@@ -33,6 +33,27 @@ ...@@ -33,6 +33,27 @@
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="com.vereign.vcm" /> <data android:scheme="com.vereign.vcm" />
</intent-filter> </intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="holder-dev.vereign.com" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="agent.hinpoc.ch" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="issuer-dev.vereign.com" />
</intent-filter>
</activity> </activity>
</application> </application>
<queries> <queries>
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
EDCB2B460766460B81E66726 /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Solid.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf"; sourceTree = "<group>"; }; EDCB2B460766460B81E66726 /* FontAwesome5_Solid.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome5_Solid.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf"; sourceTree = "<group>"; };
EF7CF2CD60574ADD8E0AFAD9 /* TitilliumWeb-SemiBold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "TitilliumWeb-SemiBold.ttf"; path = "../src/assets/fonts/TitilliumWeb-SemiBold.ttf"; sourceTree = "<group>"; }; EF7CF2CD60574ADD8E0AFAD9 /* TitilliumWeb-SemiBold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "TitilliumWeb-SemiBold.ttf"; path = "../src/assets/fonts/TitilliumWeb-SemiBold.ttf"; sourceTree = "<group>"; };
FB0F03C52BA33CA0009B97B1 /* VereignCredentialManager.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = VereignCredentialManager.entitlements; path = VereignCredentialManager/VereignCredentialManager.entitlements; sourceTree = "<group>"; };
FB1934E62AEAAE9F00138B0E /* MailCore.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = MailCore.xcframework; sourceTree = "<group>"; }; FB1934E62AEAAE9F00138B0E /* MailCore.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = MailCore.xcframework; sourceTree = "<group>"; };
FB82ADE32AE7C8F200767A3B /* VereignImapModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VereignImapModule.m; sourceTree = "<group>"; }; FB82ADE32AE7C8F200767A3B /* VereignImapModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VereignImapModule.m; sourceTree = "<group>"; };
FB82ADE52AE7C91600767A3B /* VereignImapModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VereignImapModule.h; sourceTree = "<group>"; }; FB82ADE52AE7C91600767A3B /* VereignImapModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VereignImapModule.h; sourceTree = "<group>"; };
...@@ -138,6 +139,7 @@ ...@@ -138,6 +139,7 @@
13B07FAE1A68108700A75B9A /* VereignCredentialManager */ = { 13B07FAE1A68108700A75B9A /* VereignCredentialManager */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
FB0F03C52BA33CA0009B97B1 /* VereignCredentialManager.entitlements */,
FB82ADE22AE7C8C700767A3B /* VereignImapModule */, FB82ADE22AE7C8C700767A3B /* VereignImapModule */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.mm */, 13B07FB01A68108700A75B9A /* AppDelegate.mm */,
...@@ -588,6 +590,7 @@ ...@@ -588,6 +590,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = VereignCredentialManager/VereignCredentialManager.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11; CURRENT_PROJECT_VERSION = 11;
...@@ -648,6 +651,7 @@ ...@@ -648,6 +651,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO; BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = VereignCredentialManager/VereignCredentialManager.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 11; CURRENT_PROJECT_VERSION = 11;
...@@ -794,7 +798,8 @@ ...@@ -794,7 +798,8 @@
"-ld_classic", "-ld_classic",
"-Wl", "-Wl",
"-ld_classic", "-ld_classic",
"-Wl -ld_classic ", "-Wl",
"-ld_classic",
); );
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos; SDKROOT = iphoneos;
...@@ -891,7 +896,8 @@ ...@@ -891,7 +896,8 @@
"-ld_classic", "-ld_classic",
"-Wl", "-Wl",
"-ld_classic", "-ld_classic",
"-Wl -ld_classic ", "-Wl",
"-ld_classic",
); );
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos; SDKROOT = iphoneos;
......
...@@ -42,4 +42,12 @@ ...@@ -42,4 +42,12 @@
return [RCTLinkingManager application:application openURL:url options:options]; return [RCTLinkingManager application:application openURL:url options:options];
} }
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
@end @end
<?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>com.apple.developer.associated-domains</key>
<array>
<string>applinks:holder-dev.vereign.com</string>
<string>applinks:issuer-dev.vereign.com</string>
<string>applinks:agent.hinpoc.ch</string>
</array>
</dict>
</plist>
...@@ -9,10 +9,12 @@ import MainStack from './MainStack'; ...@@ -9,10 +9,12 @@ import MainStack from './MainStack';
import OnboardingStack from './OnboardingStack'; import OnboardingStack from './OnboardingStack';
import {useRealm} from "@realm/react"; import {useRealm} from "@realm/react";
import notifee, { EventType } from '@notifee/react-native'; import notifee, { EventType } from '@notifee/react-native';
import {Screens, TabStacks} from 'src/type/navigators'; import {Screens, TabStackParams, TabStacks} from 'src/type/navigators';
import { StackNavigationProp } from '@react-navigation/stack';
import { ro } from 'date-fns/locale';
const RootStack: React.FC = observer(() => { const RootStack: React.FC = observer(() => {
const navigation = useNavigation(); const navigation = useNavigation<StackNavigationProp<TabStackParams>>();
const realm = useRealm(); const realm = useRealm();
useEffect(() => { useEffect(() => {
rootStore.agentStore.createAgent(); rootStore.agentStore.createAgent();
...@@ -23,21 +25,45 @@ const RootStack: React.FC = observer(() => { ...@@ -23,21 +25,45 @@ const RootStack: React.FC = observer(() => {
notifee.requestPermission(); notifee.requestPermission();
}, []); }, []);
const handleDeepLinking = (url: string) => {
rootStore.urlStore.setDeepLink(url);
if (rootStore.authenticated) {
rootStore.urlStore.processDeepLinkIfAny();
}
};
//if the app is not opened
useEffect(() => { useEffect(() => {
(async () => { (async () => {
const handleDeepLinking = (url: string) => {
rootStore.urlStore.setDeepLink(url);
};
Linking.addEventListener('url', ({ url }) => handleDeepLinking(url));
const initialUrl = await Linking.getInitialURL(); const initialUrl = await Linking.getInitialURL();
if (initialUrl) {
handleDeepLinking(initialUrl); if(initialUrl) {
const supported = await Linking.canOpenURL(initialUrl);
if(supported) {
handleDeepLinking(initialUrl);
}
} }
})(); })();
}, []); }, []);
//if the app is opened in the background
useEffect(() => {
Linking.addEventListener('url', async ({url}) => {
if(url){
const supported = await Linking.canOpenURL(url);
if(supported) {
handleDeepLinking(url);
}
}
});
return () => {
Linking.removeAllListeners('url');
}
}, []);
// Subscribe to events // Subscribe to events
useEffect(() => { useEffect(() => {
if (!rootStore.authenticated) return; if (!rootStore.authenticated) return;
...@@ -51,7 +77,7 @@ const RootStack: React.FC = observer(() => { ...@@ -51,7 +77,7 @@ const RootStack: React.FC = observer(() => {
if (realmId) { if (realmId) {
navigation.navigate(TabStacks.EmailStack, { navigation.navigate(TabStacks.EmailStack, {
screen: Screens.EmailDetails, screen: Screens.EmailDetails,
params: { realmId: realmId }, params: { realmId: realmId},
}); });
} }
} }
...@@ -67,7 +93,6 @@ const RootStack: React.FC = observer(() => { ...@@ -67,7 +93,6 @@ const RootStack: React.FC = observer(() => {
} }
}, [rootStore.authenticated]); }, [rootStore.authenticated]);
return rootStore.agentStore.agentCreated && rootStore.authenticated ? ( return rootStore.agentStore.agentCreated && rootStore.authenticated ? (
<UserInactivity <UserInactivity
isActive={rootStore.agentStore.active} isActive={rootStore.agentStore.active}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment