[
https://issues.apache.org/jira/browse/RIPPLE-87?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
sylvain garden updated RIPPLE-87:
---------------------------------
Summary: Ripple plaforms don't fire deviceReady after page changes in
multiple pages application (was: Ripple plaform don't fire deviceReady after
page change in multiple pages application)
> Ripple plaforms don't fire deviceReady after page changes in multiple pages
> application
> ---------------------------------------------------------------------------------------
>
> Key: RIPPLE-87
> URL: https://issues.apache.org/jira/browse/RIPPLE-87
> Project: Apache Ripple
> Issue Type: Bug
> Reporter: sylvain garden
> Labels: initialisation
>
> My cordova app consists in a "portail" of apps calling each other with html
> links or window.location=... calls.
> I spent days trying to understand why cordova plugins didn't load in any page
> but the first visited page of my app.
> It turned out that onDeviceReady was called only for the first app (as told
> in the console actually).
> I failed to understand if the cordova object should survive between pages
> change or not. I guess it shoud not.
> But I found the workaround to my issue at least: there is this sequence of
> code in ripple.js:
> "
> module.exports = bridge.exec;
> module.exports.init = module.exports.init || function() {
> cordova.require("cordova/channel").onNativeReady.fire()
> }
> "
> According to my understanding, the bridge.exec object does survive between
> page changes, so the closure is setted only once and refers to a outdated
> "cordova" in an old (and replaced since) outer closure.
> I removed "module.exports.init ||" in such sequences and now everything works
> as expected.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)