Closed quochuy closed 5 years ago
I've found the solution. In webpack.config.js, I've added libraryTarget and library properties to output:
output = {
path: __dirname,
filename: '[name].js',
libraryTarget: 'var',
library: 'EntryPoint'
};
This allows calling a JS function inside the app.js from the Swift file.
From AppDelegate.swift I then call context.evaluateScript("EntryPoint.deepLinkDiveIn('(URLString)')")
And inside the app.js
module.exports = {
deepLinkDiveIn: function (url) {
// Process the URL and call ATV.Navigation.navigate()
}
}
When using Menu Pages like the boilerplate, how can I handle deeplinking from the app Top Shelf? I'd like to check if the "options" parameter of onLaunch has the "DEEPLINK" property and load the movies page directly without loading the Home page.