问题
I'd like to be able to switch between 2 different apps (app1 and app2) using and transition animation. Ideally with the following capabilities 1) App2 is able to recognize that was invoked by App1 2) App1 able to received a callback parameter from App2
回答1:
Unfortunately, no magic for this case. To implement this scenario you need to:
1 Create separate model (AppSettings for example) in both apps and store there App1Url and App2Url correspondingly for each app.
2 To navigate user from App1 to App2 you can use this binding for Link widgets:
@datasources.AppSettings.item.App2Url + '?paramName=paramValue' + '#PageName'
3 In the onAttach event of the 'PageName' page invoke function like this
function loadPageName() {
google.script.url.getLocation(function(location) {
var paramName = location.parameter.paramName;
var datasource = app.datasources.SomeDatasource;
datasource.filters.SomeField._equals = paramName;
datasource.load();
});
}
Please, keep in mind, that to avoid double datasource loading you need to switch it to manual loading mode.
This scenario will cause full page reload.
来源:https://stackoverflow.com/questions/41904477/integration-between-different-google-appmaker-apps