tag:blogger.com,1999:blog-72386855013225666.post7156646927974401043..comments2023-04-18T05:16:02.299-04:00Comments on Simon Mac Donald: PhoneGap Lifecycle EventsSimon MacDonaldhttp://www.blogger.com/profile/14749383583517044214noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-72386855013225666.post-5145738267484482642016-02-02T07:31:02.831-05:002016-02-02T07:31:02.831-05:00In my experience, the unload event does not fire w...In my experience, the unload event does not fire when the app is unloded on Android. Maybe that's why it's not mentioned in the PhoneGap/Cordova docs?an3sshttps://www.blogger.com/profile/02822310946150599487noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-5380967160614547652012-04-25T14:37:45.478-04:002012-04-25T14:37:45.478-04:00Interestingly, unload is still not in the official...Interestingly, unload is still not in the official lifecycle events doc...elsighhttps://www.blogger.com/profile/11188602293633376619noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-55072635283737523652011-09-21T13:36:18.641-04:002011-09-21T13:36:18.641-04:00Ok great - thanks Simon! Sorry for bugging.Ok great - thanks Simon! Sorry for bugging.Greghttps://www.blogger.com/profile/04192686856648748899noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-69573628279099806252011-09-21T13:30:05.917-04:002011-09-21T13:30:05.917-04:00Greg, I'm going to answer your question over o...Greg, I'm going to answer your question over on the PhoneGap Google Group.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-23424828755743741962011-09-21T13:24:20.147-04:002011-09-21T13:24:20.147-04:00Simon,
My question is around the Congfiguration c...Simon,<br /><br />My question is around the Congfiguration changes in PhoneGap Android.<br /><br />I am seeing that when the user closes "goes back to the home screen" and then back into the app, it forces the whole WebView to reload or the config to be reloaded.<br /><br />How can I change this? Is there a config settings in the Maninfest?<br /><br />Thanks,<br />GregGreghttps://www.blogger.com/profile/04192686856648748899noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-27899130727703621972011-09-16T14:06:04.071-04:002011-09-16T14:06:04.071-04:00Folks, for questions that aren't related to th...Folks, for questions that aren't related to the post in question please pop on over the <a href="http://groups.google.com/group/phonegap" rel="nofollow">PhoneGap Google Groups</a> and ask it. I'm just as likely to answer it over there.<br /><br />@ Khalid Ali<br /><br />I can't see why the code would cause you problem. Even the alert dialog wouldn't be a blocking call. It is generally better to use console.log() anyway.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-38963517447755658452011-09-16T13:52:20.050-04:002011-09-16T13:52:20.050-04:00Hi Simon, my question is a newbies question as I h...Hi Simon, my question is a newbies question as I have just started to see how android and phonegap can be used. Here it is.<br />What I am trying to do is read file list from a folder on my phone (or sd card) I saw following code in one of the tutorials from this url<br />http://docs.phonegap.com/phonegap_file_file.md.html#LocalFileSystem<br />However, when use an alert to see if file system is loaded, I always get filesystem object as undefined. Is there a particular permission I need? Thanks in advance for your suggestions.<br /><br />[code]<br /> // Wait for PhoneGap to load<br /> //<br /> document.addEventListener("deviceready", onDeviceReady, false);<br /><br /> // PhoneGap is ready<br /> //<br /> function onDeviceReady() {<br /> window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);<br /> window.resolveLocalFileSystemURI("file:///example.txt", onResolveSuccess, fail);<br /> }<br /><br /> function onFileSystemSuccess(fileSystem) {<br /> console.log(fileSystem.name);<br /> }<br /><br /> function onResolveSuccess(fileEntry) {<br /> console.log(fileEntry.name);<br /> }<br /><br /> function fail(evt) {<br /> console.log(evt.target.error.code);<br /> }<br /><br />[/code]Khalid Alihttps://www.blogger.com/profile/08186301877201784896noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-40231591214881657642011-09-16T09:57:29.626-04:002011-09-16T09:57:29.626-04:00very useful blogvery useful blogAnonymoushttps://www.blogger.com/profile/11977658151491926857noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-22014951307998578852011-06-14T10:03:39.664-04:002011-06-14T10:03:39.664-04:00@John, the unload event is fired when the document...@John, the unload event is fired when the document is unloaded from the web view. This can happen when the web view is terminated or if you move to another page in your app.<br /><br />The pause event happens when your app goes into the background.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-53503127798303470352011-06-14T08:27:19.321-04:002011-06-14T08:27:19.321-04:00When is the UnLoad event fired? I don't unders...When is the UnLoad event fired? I don't understand the difference between my app going into the background (on Pause) and actually being unloaded (terminated by the iOS).<br /><br />Is there any way to programmatically file the unload event?Johnhttps://www.blogger.com/profile/04712984406861315402noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-49313885041601809242011-06-07T11:07:08.611-04:002011-06-07T11:07:08.611-04:00@Bipin
I think you are running into an issue beca...@Bipin<br /><br />I think you are running into an issue because the request you make is async and it is not finishing before the app goes into the background.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-78349398081547358492011-06-01T13:34:27.682-04:002011-06-01T13:34:27.682-04:00Hi Simon,
I have checked Shazron's update to ...Hi Simon,<br /><br />I have checked Shazron's update to issue 84. <br /><br />As per me issue is we are sending 2-3 ajax request to disconnect user. Basically we are using strophe for openfire connection. What we want to do is logout user when app is minimized.<br /><br />Now when app minimize our function is getting called. But as there are 2-3 request going back and forth, so when that request is happening app is minimized and subsequent request is not sent.<br /><br />So, user is still online. I am not sure what is going on. But my primary conclusion is as above.<br /><br />Please let us know if you can provide us more detail on this.<br /><br />Thank you,<br />BipinAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-29868065372391165202011-06-01T11:05:10.664-04:002011-06-01T11:05:10.664-04:00@Bipin
Read up on @Shazron's update to issue...@Bipin <br /><br />Read up on @Shazron's update to issue 84. I think the console.log doesn't fire correctly causing you to think that onPause hasn't been called when it really has been.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-45789349459139698862011-06-01T10:51:35.844-04:002011-06-01T10:51:35.844-04:00Hi,
We have tried all possible solution to get it...Hi,<br /><br />We have tried all possible solution to get it work. but neither of it work.<br /><br />Basically what we want to achieve is as follows:<br /><br />1). When app is minimize we want to fire one function that disconnect user's session from remote server using AJAX.<br /><br />2). When app maximize we want to establish session again.<br /><br />Now, following is happing while app minimize or maximize.<br /><br />1). When app minimize onPause callback function is not calling up. no console log is there.<br /><br />2). When app maximize onPause callback is called, followed by onResume callback.<br /><br />Can you please guide us how i can achieve above thing.<br /><br />Here is my code;<br />function onLoad()<br /> {<br /> document.addEventListener("deviceready",onDeviceReady,false);<br /> <br /> }<br /> <br /> function onDeviceReady()<br /> {<br /> document.addEventListener("pause", onPause, false);<br /> document.addEventListener("resume", onResume, false);<br />}<br /><br />function onPause() {<br /> console.log("On PAUSE");<br /> disconnect();<br /> }<br /><br /> function onResume() {<br /> connect();<br /> }Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-72141016940827448332011-06-01T02:06:50.590-04:002011-06-01T02:06:50.590-04:00Hi All,
I think issue is we were using alert to s...Hi All,<br /><br />I think issue is we were using alert to see if it comes when app minimize and maximize.<br /><br />We will set some variable to see if it work for us or not?<br /><br />ON BEHALF OF SAGAR<br /><br />BipinAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-22504759795300112162011-05-10T07:32:32.061-04:002011-05-10T07:32:32.061-04:00Sweet Shaz, thanks for the update.Sweet Shaz, thanks for the update.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-86292626882852784322011-05-09T20:47:47.340-04:002011-05-09T20:47:47.340-04:00Not a bug, it turns out. See https://github.com/ph...Not a bug, it turns out. See <a href="https://github.com/phonegap/phonegap-iphone/issues/84" rel="nofollow">https://github.com/phonegap/phonegap-iphone/issues/84</a>Shazronhttps://www.blogger.com/profile/04553633294538611825noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-69599340060229532932011-05-05T14:10:47.755-04:002011-05-05T14:10:47.755-04:00Our iOS person has found an issue with the events....Our iOS person has found an issue with the events. Apparently the pause event isn't being fired until the app resumes. It looks like there is a bug. Does someone want to create an issue on <a href="https://github.com/phonegap/phonegap-iphone/issues" rel="nofollow">GitHub</a> for us?Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-33539954883497355682011-05-02T14:01:41.475-04:002011-05-02T14:01:41.475-04:00I've asked the iOS expert to look into what is...I've asked the iOS expert to look into what is going on and will report back when I know more.Simon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-59667261492055610292011-05-02T13:26:14.592-04:002011-05-02T13:26:14.592-04:00If i'm not mistaken, Sagar says that the pause...If i'm not mistaken, Sagar says that the pause and resume event doesn't fired when app was minimize and maximize. But, the event fired when the phone is locked.xiaofenhttps://www.blogger.com/profile/16284684057024781981noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-9097869978896122412011-05-02T11:16:50.453-04:002011-05-02T11:16:50.453-04:00Hi Sagar,
I'm not sure I understand you quest...Hi Sagar,<br /><br />I'm not sure I understand you question. Are you saying the pause and resume events are not fired when the phone is locked? I'm at a loss as to how you would pause an app when the phone is locked.<br /><br />SimonSimon MacDonaldhttps://www.blogger.com/profile/14749383583517044214noreply@blogger.comtag:blogger.com,1999:blog-72386855013225666.post-31760392255131303162011-05-02T04:16:19.350-04:002011-05-02T04:16:19.350-04:00Hi,
I tried to add pause and resume event on iPho...Hi,<br /><br />I tried to add pause and resume event on iPhone app. However if phone is locked at that time only this events fired not on app minimize and maximize. <br /><br />Can you please let us know about this.<br /><br />We are using same code in this post and phonegap js is latest 0.9.5.<br /><br />Thanks,<br />BipinAnonymousnoreply@blogger.com