簡體   English   中英

使用gmail應用邀請iOS打開應用

[英]Open app using gmail app invite iOS

我正在將Gmail App邀請集成到我的應用中。 即時通訊成功接收到邀請電子郵件,該電子郵件提供了用於安裝/打開應用程序的“安裝”鏈接。但是,當我單擊安裝鏈接時,盡管我的應用程序已安裝在設備上,但它始終會在瀏覽器中打開iTunes。 我指的是此鏈接“ https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html ”。 任何幫助將不勝感激。 注意:我的應用程序尚未啟用,但iTunes上沒有該應用程序。

請嘗試在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://

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM