如何在react-native中获取当前url表单CustomTabs

时间:2018-01-02 09:53:08

标签: react-native

我正在使用react-native app。我正在使用CustomTabs打开外部URL。它工作正常,但我想从CustomTabs中获取当前URL到我的react-native应用程序,并希望自动关闭CutomTabs。 URL“https://www.demo.com”具有表单,并在提交后重定向到另一个页面,并在URL中包含一些参数。我想将这些参数提取到我的应用程序中。 我的代码是: -

url = 'https://www.demo.com';
CustomTabs.openURL(url,{ toolbarColor: '#607D8B',enableUrlBarHiding: true,showPageTitle: true,enableDefaultShare: true,animations: ANIMATIONS_SLIDE}).then((launched: boolean) => {

console.log(`Launched custom tabs: ${launched}`);
}).catch(err => {
console.error(err)

我该怎么做?

});

0 个答案:

没有答案
相关问题