Chore: Apple site association file for deep linking (#805)
This commit is contained in:
parent
db6e3fb43e
commit
ba1e0dbda0
6 changed files with 35 additions and 9 deletions
|
@ -89,6 +89,10 @@ TWITTER_CONSUMER_KEY=
|
|||
TWITTER_CONSUMER_SECRET=
|
||||
TWITTER_ENVIRONMENT=
|
||||
|
||||
### Change this env variable only if you are using a custom build mobile app
|
||||
## Mobile app env variables
|
||||
IOS_APP_ID=6C953F3RX2.com.chatwoot.app
|
||||
|
||||
#### This environment variables are only required in hosted version which has billing
|
||||
ENABLE_BILLING=
|
||||
|
||||
|
|
6
app/controllers/apple_app_controller.rb
Normal file
6
app/controllers/apple_app_controller.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class AppleAppController < ApplicationController
|
||||
def site_association
|
||||
site_association_json = render_to_string action: 'site_association', layout: false
|
||||
send_data site_association_json, filename: 'apple-app-site-association', type: 'application/json'
|
||||
end
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
require 'rest-client'
|
||||
require 'telegram/bot'
|
||||
|
||||
class HomeController < ApplicationController
|
||||
skip_before_action :verify_authenticity_token, only: [:telegram]
|
||||
skip_before_action :authenticate_user!, only: [:telegram], raise: false
|
||||
skip_before_action :set_current_user
|
||||
skip_before_action :check_subscription
|
||||
end
|
11
app/views/apple_app/site_association.html.erb
Normal file
11
app/views/apple_app/site_association.html.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"applinks": {
|
||||
"apps": [],
|
||||
"details": [
|
||||
{
|
||||
"appID": "<%= ENV['IOS_APP_ID'] %>",
|
||||
"paths": [ "NOT /super_admin/*", "*" ]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -154,6 +154,10 @@ Rails.application.routes.draw do
|
|||
# Routes for testing
|
||||
resources :widget_tests, only: [:index] unless Rails.env.production?
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Routes for external service verifications
|
||||
get 'apple-app-site-association' => 'apple_app#site_association'
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Internal Monitoring Routes
|
||||
require 'sidekiq/web'
|
||||
|
|
10
spec/controllers/apple_app_spec.rb
Normal file
10
spec/controllers/apple_app_spec.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe '/apple-app-site-association', type: :request do
|
||||
describe 'GET /apple-app-site-association' do
|
||||
it 'renders the apple-app-site-association file' do
|
||||
get '/apple-app-site-association'
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue