我正在努力使用文件中的<data>元素AndroidManifest.xml来使我的URI匹配工作.我想匹配以下URI:
但不是
我得到它主要是与合作
<data android:scheme="http"
android:host="example.com"
android:pathPattern="/..*" />
<data android:pathPattern="/..*/" />
Run Code Online (Sandbox Code Playgroud)
但它仍然匹配http://example.com/something/else.
我该如何排除这些?
我已经集成了branch.io SDK用于深层链接.
我的深度链接的流程是当我点击URL时它将打开我的应用程序,如果它已经安装在用户手机中,否则它将重定向到用户可以安装应用程序的Play商店.
如果我使用Chrome浏览器浏览链接,但如果我使用任何其他浏览器应用程序进行浏览,如UC,Opera或三星默认浏览器,此流程无效,无论哪种方式,它都会重定向到Play商店.
任何人都有解决方案请告诉我!
谢谢你的帮助!
我在哪里可以查看完整的应用列表及其相应的"深层链接"URI方案?(例如,Twitter是twitter://和Facebook的fb://.)
还有谁监督这些注册?
我已成功实现了对我的应用程序的深层链接,但我遇到了问题.
<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:host="*.example.com"
android:scheme="https"/>
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
此意图过滤器处理所有链接,但我不想捕获某个URL即ie
https://www.example.com/hello/redirect/
Run Code Online (Sandbox Code Playgroud)
到目前为止我尝试了什么:
我尝试输入我想要手动捕获的所有网址
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/m/">
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/c/">
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/p/">
...
Run Code Online (Sandbox Code Playgroud)
但是我的主页网址https://www.example.com不起作用.
如果我使用
android:pathPrefix="/"
Run Code Online (Sandbox Code Playgroud)
然后这将开始再次捕获所有URL,包括我想省略的URL.
我也尝试过使用android:pathPattern,但它无法理解这样复杂的正则表达式^((?!redirect).)*$,当我在字符串和所有字符串中尝试它时,它可以正常工作.
有谁知道如何省略某些网址?
更新:
正如@PLNech 在这里建议的那样,我添加了我需要捕获的所有URL android:pathPrefix并用于android:path: "/"捕获我的主页的URL,即https://www.example.com/
<data
android:host="*.example.com"
android:scheme="https"
android:path="/"/>
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/m/">
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/c/">
<data
android:host="*example.com"
android:scheme="https"
android:pathPrefix="/p/">
Run Code Online (Sandbox Code Playgroud) 我已经阅读了有关Android应用程序的App Indexin g和Deep Linking的信息.
据我所知,两者都是相同的,深度链接更容易,因为它只需要在Manifest.xml文件中添加一个intent过滤器.
那么为什么我需要使用应用程序索引?
是什么让它与深层链接不同?
需要一种不同的编码方式(android)来实现
Fire Base应用程序索引
这是一个指导Fire Base应用程序索引的链接:
https://firebase.google.com/docs/app-indexing/
这有必要吗?
我有一个Web应用程序,由于PWA标准,它可以作为独立应用程序安装在主屏幕中。
当用户忘记密码时,将向其发送一封电子邮件,其中包含用于重置密码的链接。
问题是:
我可以深链接到已安装的独立版本,而不是chrome浏览器中的Web应用程序吗?我想实现以下行为:
提前致谢!
干杯
我想要的是:我想向用户发送推送通知。当用户点击该通知时,用户应导航到特定活动。
我做了什么:我在Firebase控制台中创建了一个深层链接。我也实现了FirebaseInstanceIdService和FirebaseMessagingService。我能够捕获从Firebase控制台发送的Firebase消息。
问题是什么:我无法捕获在Firebase控制台中创建的动态链接。
我的代码如下。
MyFirebaseInstanceIDService.java
public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService {
private final String TAG = "MyFirebaseInstanceID";
@Override
public void onTokenRefresh() {
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.e(TAG, "Refreshed token: " + refreshedToken);
}
}
Run Code Online (Sandbox Code Playgroud)
MyFirebaseMessagingService.java
public class MyFirebaseMessagingService extends FirebaseMessagingService {
private final String TAG = "MyFbaseMessagingService";
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
String message = remoteMessage.getNotification().getBody();
Log.e(TAG, "\nmessage: " + message);
sendNotification(message);
}
private void sendNotification(String message) {
Intent intent = new …Run Code Online (Sandbox Code Playgroud) deep-linking firebase firebase-cloud-messaging firebase-dynamic-links android-push-notification
我正在使用链接库处理我的 Expo.io ReactNative 项目中的深层链接,它运行良好,允许我打开应用程序并通过 URL 传递一些路由数据。但是,如果该应用程序未安装在设备上,则它根本无法运行。
我知道延迟深层链接可以通过 App Store 安装来保存数据。使用 ReactNative 或专门使用 Expo 应用程序执行此操作的最佳方法是什么?
我正在构建一个具有react-native和react-navigation库的移动应用程序,用于管理我的应用程序中的导航。现在,我的应用看起来像这样:
App [SwitchNavigator]
Splash [Screen]
Auth [Screen]
MainApp [StackNavigator]
Home [Screen] (/home)
Profile [Screen] (/profile)
Notifications [Screen] (/notifications)
Run Code Online (Sandbox Code Playgroud)
我已经将“深层链接”与上述屏幕Home,Profile和的模式集成在一起Notifications,并且按预期工作。我面临的问题是使用深层链接时如何管理用户的身份验证。现在,无论何时打开深层链接(myapp://profile例如),无论我是否通过身份验证,该应用程序都会将我带到屏幕上。我想要它做的是先检查AsyncStorage是否有一个userToken,如果没有,或者它不再有效,然后在Auth屏幕上重定向。
我以与此处所述几乎完全相同的方式设置了身份验证流程。因此,当我的应用程序启动时,Splash屏幕会检查用户电话中是否存在有效令牌,然后将其发送到Auth屏幕或Home屏幕上。
我目前想出的唯一解决方案是将每个深层链接指向,对Splash用户进行身份验证,然后解析该链接以导航至正确的屏幕。例如,当用户打开时myapp://profile,我打开应用程序Splash,验证令牌,然后解析url(/profile),最后重定向到Auth或Profile。
这是这样做的好方法,还是反应导航提供了更好的方法?他们网站上的“ 深层链接”页面有点亮。
谢谢您的帮助 !
即时实现深层链接是iOS。我已经在 Project-Setting->Info->Url type URL Schemes 中配置了 URL Schemes : carwash role:Viewer
当我输入 carwash://something 时,浏览器要求打开应用程序,但在应用程序中没有调用我处理应该发生的操作。
苹果文档说你应该在 AppDelegate 中覆盖 application(open url) 但深层链接不调用它并且应用程序在最后状态打开
application:openURL:options:' 未被调用
这是我的代码并且不起作用
func application(_ app: UIApplication, open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
fatalError()
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
if let url = launchOptions?[UIApplication.LaunchOptionsKey.url] as? URL {
/// some
fatalError()
}
GMSServices.provideAPIKey("")
return true
}
Run Code Online (Sandbox Code Playgroud)
swift 5 模拟器:iOS 13
deep-linking ×10
android ×4
react-native ×2
android-xml ×1
branch.io ×1
firebase ×1
ios ×1
mobile ×1
progressive ×1
regex ×1
swift ×1
uri ×1
url-scheme ×1
web ×1