Chore: Apple site association file for deep linking (#805)

This commit is contained in:
Sojan Jose 2020-05-03 12:16:11 +05:30 committed by GitHub
parent db6e3fb43e
commit ba1e0dbda0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 9 deletions

View file

@ -89,6 +89,10 @@ TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET= TWITTER_CONSUMER_SECRET=
TWITTER_ENVIRONMENT= 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 #### This environment variables are only required in hosted version which has billing
ENABLE_BILLING= ENABLE_BILLING=

View 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

View file

@ -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

View file

@ -0,0 +1,11 @@
{
"applinks": {
"apps": [],
"details": [
{
"appID": "<%= ENV['IOS_APP_ID'] %>",
"paths": [ "NOT /super_admin/*", "*" ]
}
]
}
}

View file

@ -154,6 +154,10 @@ Rails.application.routes.draw do
# Routes for testing # Routes for testing
resources :widget_tests, only: [:index] unless Rails.env.production? 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 # Internal Monitoring Routes
require 'sidekiq/web' require 'sidekiq/web'

View 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