Skip to content

Commit

Permalink
fix: always load aca module first on startup (#12219)
Browse files Browse the repository at this point in the history
Fixes TIMOB-28079
  • Loading branch information
build committed Oct 26, 2020
1 parent 29b4116 commit f911623
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
15 changes: 15 additions & 0 deletions common/Resources/ti.internal/aca.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2020 by Axway, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*
* This script is used to load ACA (Axway Crash Analytics).
* This allows ACA to be the first module to load on startup.
*/

try {
import('com.appcelerator.aca');
} catch (e) {
// Could not load module, silently ignore exception.
}
12 changes: 4 additions & 8 deletions common/Resources/ti.main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@
* - Load the app developer's main "app.js" script after doing all of the above.
*/

// Attempt to load crash analytics module.
// NOTE: This should always be the first module that loads on startup.
import './ti.internal/aca';

// Log the app name, app version, and Titanium version on startup.
Ti.API.info(`${Ti.App.name} ${Ti.App.version} (Powered by Titanium ${Ti.version}.${Ti.buildHash})`);

// Attempt to load crash analytics module.
// NOTE: This should be the first module that loads on startup.
try {
require('com.appcelerator.aca');
} catch (e) {
// Could not load module, silently ignore exception.
}

// Load JS language polyfills
import 'core-js/es';
// Load polyfill for async/await usage
Expand Down

0 comments on commit f911623

Please sign in to comment.