Firebase动态链接-Continueuseractivity不返回动态链接URL [英] Firebase dynamic linking - Continueuseractivity not returning dynamic link url

查看:75
本文介绍了Firebase动态链接-Continueuseractivity不返回动态链接URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是处理iOS应用程序上的通用链接.但是动态link.url似乎返回如下错误-

My requirement is to handle universal links on the iOS application. But the dynamic link.url seems to be returning an error as below -

"@"error" : @"unauthorized user: username=social-app-invite methodName=/FirebaseLookupService.LookupAppsSummary protocol=loas securityLevel=integritY"

当我从notes应用程序单击动态链接(https://****.app.goo.gl/****)时,我的ios应用程序将定向到以下回调-> 在此功能中,我有以下代码-

When i click on a dynamic link (https://****.app.goo.gl/****) from the notes app, my ios app will be directed to the following callback -> In this function i have the following code -

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler
{
NSURL *incomingURL = userActivity.webpageURL;
if(incomingURL){
    BOOL handled = [[FIRDynamicLinks dynamicLinks]
                    handleUniversalLink:incomingURL
                    completion:^(FIRDynamicLink * _Nullable dynamicLink,
                                 NSError * _Nullable error) {
                        if (dynamicLink.url){`
                           **HANDLE THE DYNAMIC LINK HERE**
                        }else{
                           **CODE IS RETURNING ERROR** NSLog(@"error %@",error);
                        }
                    }];
    return handled;
}else{
    return false;
}

}

我正确遵循了Firebase文档.请建议这里出了什么问题?

I have followed the firebase documentation correctly. Please suggest what is going wrong here?

推荐答案

我也遇到了这个问题. handleUniversalLink()返回的始终为false.就我而言,我的链接参数不仅包含URL,而且还包含参数.因此,最终的动态链接中包含两个问号.

I also met this issue. handleUniversalLink() returned always false. In my case my link parameter contained not just a URL but also parameters. So the final dynamic link got two question marks in it.

https://app-id.app.goo.gl/?link=https://www.domain.com/resource?someParam=someValue&ibi=com.domain.appname

如果我使用百分比转义符对内部URL(链接参数)进行转义,则可以正常工作.

If I escape the inner URL (link parameter) with percent escapes, it works fine.

https://app-id.app.goo.gl/?link=https%3A%2F%2Fwww.domain.com%2Fresource%3FsomeParam%3DsomeValue&ibi=com.domain.appname

这篇关于Firebase动态链接-Continueuseractivity不返回动态链接URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆