【问题标题】:Deep liking does not work on gmail app and works on other browsersDeep likeing 不适用于 gmail 应用程序,但适用于其他浏览器
【发布时间】:2019-02-14 13:21:35
【问题描述】:

https://example.com/public/change_phone?email_recovery_code=F08fjfU39Ea6RSlDzM8ZZJFVwyjAE

<activity android:name=".view.activity.sign_in_new_number.SignInNewNumberActivity">
                <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:scheme="https"
                            android:host="example.com"
                            android:pathPrefix="/public/change_phone"/>
                </intent-filter>
            </activity>

我使用了上面的清单设置,但它不适用于 Gmail 应用程序,该 URL 不会在我的应用程序上重定向我,只需打开 Gmail 应用程序中的链接

【问题讨论】:

    标签: android deep-linking


    【解决方案1】:

    如果启动画面是您应用程序中的第一个屏幕..然后在启动活动的 onCreate() 上使用它:

    首先获取你通过深度链接获得的网址

    Intent intent = getIntent();
    Uri data = intent.getData();
    
    if (!isTaskRoot()) {//this will resume your app from last loaded screen if you pressed home button earlier
            Log.e("splashfin", "hello");
            if (data != null) {
    
      //open that activity through your url or do what ever you want
      }else{}
    
    }else{
    if(data!=null){
            //open that activity through your url or do what ever you want
    
    }
    
     }
    

    【讨论】:

    • 问题不同,您提供的解决方案是针对参数而不是针对应用重定向
    猜你喜欢
    • 2014-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-09
    • 2015-05-05
    • 1970-01-01
    相关资源
    最近更新 更多