As you already know, App Indexing has become very important for iOS in the past months, as Google can now include content for these apps directly in the search engines. But for this we first have to allow the indexing of our app and associate it with our web page.
For all of you who follow our blog, you might have already read our article about App Indexing on Android, where you can find all the information to implement it.
How do I implement App Indexing on iOS devices?
First of all, you have to bear in mind that Google services began supporting universal links for iOS since October, 2015. It is only available for iOS 9 or later versions, which means that app indexing is much more developed for Android devices.
The first thing we have to check is whether our app is compatible with HTTP deep linking. If you followed the advice from Apple about compatibility with universal links when developing the app, you can skip this step. If you did not, follow these steps to start app indexing on iOS:
- Enable UIApplicationDelegate protocol for Apple developers to allow the management of universal links on your app.
- Add an authorization “
com.apple.developer.associated-domains"to XCode with a numbered list of the domains that your app uses, e.g. universal links.
- Create a file “
apple-app-site-association"for each of the previous domains where you associate the content of each app to each domain. These will host the JSON with the URLs that your app is using.
- Upload the file “
apple-app-site-association"to your web’s root-level and to your HTTPS server. As Google indicates, the domain has to allow HTTPS/TLS, even if the HTTP deep linking is not supported through HTTPS.
- Update your app so that it responds correctly to the requests from the object NSUserActivity. These are indexable and can be made available for users when they search from mobile devices.
Next, we have to associate each app’s deep link to the URL of our corresponding web page. Follow these steps to do so:
- Use CocoaPods to install Google SDK.
- Include “
pod 'GoogleAppIndexing'"under the configuration menu for your Podfile.
- To create the work environment and save future implementations, use the command “
pod install",which will generate a file with the name “
- Add the heading
GoogleAppIndexingto the new work environment, located right over
- Register the app on Google’s system. “
[[GSDAppIndexing sharedInstance] registerApp:your iTunes ID];"
To learn more about each procedure and develop this, I include the official App Indexing for iOS 9 link for developers.
As I was saying, these iOS functionality is very recent and we cannot check the deep linking behaviour with the XCode simulator. Although Google says that in the next months we will have the URI reference information for deep links on iOS available, in the meantime it encourages us to check this manually to ensure that the links redirect to the actual content of the app.
Another important aspect is that, contrary to Android, we cannot use Google Webmaster Tools to measure the performance of this implementation, which means that we should expect news about this.
If you want to know more details or you want more help with this implementation, visit the support page for developers created by Google: App indexing on iOS.
Difficulty level: medium hard, requires previous knowledge about apps development.