首页 > 解决方案 > 火力基地动态链接

问题描述

我对该功能有疑问

我正在使用 Xamarin.android

当我打开 url 时,应用程序打开很好,但我的任务是我在应用程序上重置密码表单我将通过电子邮件地址将 url 发送给用户,当用户单击链接时打开特定页面(reset_password形式)

我在清单中使用的

  <activity android:name="com.companyname.petrol_stations_in_egypt">
     <intent-filter>
       <action android:name="android.intent.action.VIEW"/>
     <category android:name="android.intent.category.DEFAULT"/>
     <category android:name="android.intent.category.BROWSEABLE"/>
     <data android:host="publicservices.page.link/resetpassword" android:scheme="https"/>
     <data android:host="publicservices.page.link/resetpassword" android:scheme="http"/>
     </intent-filter>
  </activity>

谢谢大家

标签: c#xamarinxamarin.android

解决方案


我已经创建了自己的解决方案,但我问是否有其他方法谢谢:) 当我第一次打开应用程序时,它将通过此​​代码

if (Intent.DataString == "https://publicservices.page.link/resetpassword")
{
    Intent intent = new Intent(this, typeof(Reset_Password));
    StartActivity(intent);
}

当用户单击 url 链接时,它将在意图数据字符串中获取 url 路径,因此我输入 if 条件,然后将传递给另一种形式


推荐阅读