首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在网站上制作“在应用程序中打开”IOS栏?

如何在网站上制作“在应用程序中打开”IOS栏?
EN

Stack Overflow用户
提问于 2021-08-23 11:03:46
回答 1查看 40关注 0票数 1

我需要添加相同的栏(顶部的栏,对不起如郎,栏使用的是操作系统语言,无论如何Открыть等于打开) FB example,据我所知,它是原生的,所以我找到了一种添加if的方法,添加到

代码语言:javascript
复制
 <meta name="apple-itunes-app" content="app-id=MyAppId(it exists on app store)">

在下载应用程序并在本地部署网站后,我从iPhone打开它,看到了一个栏(但它看起来不同,我很高兴,做了一个屏幕截图)My screenshot with working bar,但现在它消失了,我不知道为什么。告诉我,可能的问题是什么,为什么这些面板是不同的(对我和facebook),也许我错过了一种方式来使用相同的工具栏作为FB?

EN

回答 1

Stack Overflow用户

发布于 2021-08-23 19:23:34

您需要配置一个智能应用程序横幅,请阅读以下内容:https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners了解完整的详细信息。首先,您需要在希望显示横幅的每个页面的head元素中添加此meta标记:

代码语言:javascript
复制
<meta name="apple-itunes-app" content="app-id=myAppStoreID, app-argument=myURL">

然后在你的应用委托中实现application(_:open:sourceApplication:annotation:),你可以提供逻辑来解释你传递的网址,这是一个来自苹果网站的例子:

代码语言:javascript
复制
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

    // In this example, the URL from which the user came is http://example.com/profile/?12345.

    // Determine whether the user was viewing a profile.
    if ([[url path] isEqualToString:@"/profile"]) {

        // Switch to the profile view controller.
        [self.tabBarController setSelectedViewController:profileViewController];

        // Pull the profile ID number found in the query string.
        NSString *profileID = [url query];

        // Pass the profile ID number to the profile view controller.
        [profileViewController loadProfile:profileID];

    }
    return YES;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68891493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档