0

我正在我的应用程序中集成 Gmail 应用程序邀请。我成功收到邀请电子邮件,其中提供“安装”链接以安装/打开应用程序。但是当我单击安装链接时,尽管我的应用程序已安装在我的设备上,但它总是在浏览器中打开 iTunes。我指的是这个链接“ https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html ”。任何帮助将不胜感激。注意:我的应用没有上线。iTunes 上没有。

4

1 回答 1

0

请在 info.plist 中尝试以下代码

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>com.App</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>app</string>
        </array>
    </dict>
</array>

对于句柄,在您的 appdelegate.m 文件中添加以下代码

if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"app://"]])
{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"app://"]];
}
else
{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"ituneslinkifuhave"]];
}

并用于测试打开您的 Safari 浏览器并运行app://

于 2016-05-09T14:55:32.270 回答