In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail about iOS general link UniversalLink configuration, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
IOS Universal Link (Universal Link) configuration
What is a universal link?
Universal link is a new feature introduced by iOS9. If your application (app) supports universal link (Universal Link), iOS users can seamlessly redirect to the installed app when clicking on the link to the web page without any additional action. If the corresponding app is not installed, clicking the link will open the web page using Safari. Before iOS9, for all kinds of browsers, we usually could only use scheme to wake up app in Safari.
Why suddenly switch to universal link configuration?
To arouse third-party app in our projects is usually used by configuring the corresponding URL Scheme. The latest version of Wechat SDK, openSDK1.8.6, is adapted in version 1.8.6 due to the security upgrade of Apple iOS 13 system version. Version 1.8.6 supports Universal Links redirection to verify the validity of openSDK sharing and improve security during use.
It is required that universalLink must be passed in when registering Wechat appid, and the previous method can still be used in the old version. So I started to study the configuration of Universal Link.
@ interface WXApi: NSObjectUniverse! @ brief WXApi member function to register third-party applications with Wechat terminal programs. * * it needs to be called every time you start a third-party application. * @ attention make sure that this function * @ param appid Wechat developer ID * @ param universalLink Wechat developer Universal Link * @ return is successfully returned to YES in the main thread, and NO is returned if failure occurs. * / + (BOOL) registerApp: (NSString *) appid universalLink: (NSString *) universalLin
How do I configure universal links?
1. Create an empty file in json format (must be named apple-app-site-association and have no suffix)
The appID here refers to the composition of the TeamID+BundleId (for example: 9JA89QQLNQ.com.apple.test) (TeamID can be viewed in the developer account, and BundleId is the Bundle Identifier of the project). Paths here means: set the list of allowed paths, which can be one or more. The easiest way is to use "*", a wildcard, to indicate that any path under the domain name is allowed. (note: the case in paths is sensitive and must correspond one to one.)
2. Upload the apple-app-site-association file (here you can get the domain name needed for the configuration in app)
(1) send the apple-app-site-association file to the colleague on the server side and upload it to the root directory of the domain name or to the subdirectory of .well-known (the domain name here must be accessible, given by the colleague on the server side).
(2) Web server needs to support https, and the client can access it through https, and does not support redirection.
3. Handle general links in app
(1) add the corresponding domain name (the domain name known above) to Capabilities
Locate Capabilities in the project, find Associated Domains, click the allow button, and add the corresponding domain name to Domains. (the domain name in Domains must start with applinks, and then enter your own domain name. Note: when app starts for the first time, it will automatically download the apple-app-site-association file from your own domain directory. )
Note: you may encounter an error here that Associated Domains is not allowed in your App ID, so you need to enter the developer Center, edit App ID to allow Associated Domains, and regenerate the corresponding visa file and download the installation. In the latest xcode11, this item is added, and the developer account opens automatically under the appId.
(2) implement the implementation method of supporting general links in AppDelegate
-(BOOL) application: (UIApplication *) application continueUserActivity: (NSUserActivity *) userActivity restorationHandler: (void (^) (NSArray * _ Nullable)) restorationHandler {/ / its own implementation code return [WXApi handleOpenUniversalLink:userActivity delegate:self];}
Here, if you are updating the WechatOpenSDK1.8.6 version from the old version, you need to call this method in Wechat in this, and in Xcode, select your project settings, select the "TARGETS" column, and add weixin and weixinULAPI to "LSApplicationQueriesSchemes" in the "info" label. You can modify or add step by step through the steps of connecting documents on the Wechat open platform.
Note: pay attention to the case of the weixinULAPI here. I added a lower case of weixinulapi to it before, but I failed to register, but I couldn't find the reason until I called Wechat's method of printing log. I didn't know that I didn't add the schemes of weixinULAPI, and I didn't distinguish the case.
On the iOS universal link UniversalLink configuration is shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.