docbrown/app/controllers/deep_links_controller.rb
Fernando Valverde 2463ac7194
Expose aasa for non-private Forems (#13729)
* Expose aasa non-private forems + small tweak to aasa

* Tests

* Update spec/requests/universal_links_spec.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Check empty array with be_empty

* Include Universal Links context

Co-authored-by: Michael Kohl <citizen428@dev.to>
2021-05-12 10:13:46 -06:00

24 lines
824 B
Ruby

class DeepLinksController < ApplicationController
def mobile; end
# Apple Application Site Association - based on Apple docs guidelines
# https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
def aasa
# TODO: [@fdoxyz] Replace these hardcoded identifiers with configurations
# creators can use to customize their Forems - `/admin/consumer_apps`
supported_apps = ["R9SWHSQNV8.com.forem.app"]
supported_apps << "R9SWHSQNV8.to.dev.ios" if SiteConfig.dev_to?
render json: {
applinks: {
apps: [],
details: supported_apps.map { |app_id| { appID: app_id, paths: ["/*"] } }
},
activitycontinuation: {
apps: supported_apps
},
webcredentials: {
apps: supported_apps
}
}
end
end