[TIMOB-24316] Android: Can't get the right URL if app resume by URL for the second time
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-04-21T22:35:45.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.4 |
Components | Android |
Labels | n/a |
Reporter | Shuo Liang |
Assignee | Gary Mathews |
Created | 2017-01-17T01:13:57.000+0000 |
Updated | 2017-04-26T15:11:07.000+0000 |
Description
Reproduce:
1. Run the attached app, (Simple app to check the URL which resumed the app)
2. Close the app.
3. Start test with following steps
4 Start app from the link (banking.meridiancu.ca/test_login) (from URL in email in this test)
5. Navigate to next page
6. Pause the app
7. Resume app using different link (banking.meridiancu.ca/security_login)
8.. Observe app resumes successfully. But when you click Check URL button It shows link with which the app was initially started. (banking.meridiancu.ca/test_login)
Expect
The URL should be the exact one on resume or start the app.
Attachments
This PR should resolve your issue: https://github.com/appcelerator/titanium_mobile/pull/8747 It is currently in review.
HI Gary, Great to hear this. Could you please compile an SDK with this PR so I can test as well? Thanks, Nikita.
[~nradaev], You can check if this fixes your issue with SDK 6.0.3.v20170310122139.
PR : https://github.com/appcelerator/titanium_mobile/pull/8747 & https://github.com/appcelerator/titanium_mobile/pull/8879 has passed FR & been merged. Closing this ticket.
Almost there. This fix only works when the app was originally launched using app icon. It does not work when the app was launched using URL. Here is the test case: 1. Start the app via URL: banking.meridiancu.ca/test_login 2. Pause the app 3. Resume the app via different URL : banking.meridiancu.ca/security_login 4. Pause the app 5. Resume the app using original URL: banking.meridiancu.ca/test_login Observe: no alert thrown, when "Check URL" is clicked banking.meridiancu.ca/security_login is being printed out. Not sure if that helps, but I am opening URL's via email (this is how we intend to use this feature). Thank you, Nikita.
Tested on S7 using SDK 6.1.0.v20170315005008
[~nradaev], The url's in your test can't be accessed. Can you provide other url's which we can access ? I tried with similar
intent-filter
"Followed your steps in your most recent comment & I am opening the URL's from gmail. When I resume the app second time with the original URL, I do get the original URL. My app.js code:
Hi Lokesh, I've tested your example and the reason it appears to be working for you is because 2nd URL never shows up! (OOPS...) If you look closer at my original example you will see that I utilize Alloy.Globals.lauch_url to see which URL is being opened/resumed with. This is because every time I resume/open the app It is being reloaded (except for my buggy case). I am fine with this behavior as long as it is consistent. Furthermore, you do not even need a working URL in order to test my example. Intent-filter intercepts intent request and is supposed to open/resume the app instead of opening URL with the browser. If you insist that this is a working fix, I will need a video demonstration as well as a working project code. Nikita.
Reopening to look further into this issue.
master: https://github.com/appcelerator/titanium_mobile/pull/8897
6_0_X: https://github.com/appcelerator/titanium_mobile/pull/8901
Hi Gary, Here is a short video to display behaviour I am experiencing. https://drive.google.com/file/d/0B_ilPkP8PASfeUpJZmVWaDFRa2s/view?usp=sharing Nikita.
Due to the complexities with Kroll related to intents, we are unable to resolve this for 6.0.3. We tried several commits and test cycles and there were issues with each. So we will move this to a 6.0.4 release, in order to provide a well engineered and well-tested fix.
6_0_X: https://github.com/appcelerator/titanium_mobile/pull/8910
FR Done. Merged 6.0.4 PR waiting for build from CI to close.
Verified the fix in 6.0.4.v20170421153428. Closing.
I've just tried version 6.0.4.v20170425123820 and this solution seems sub-par. The app DOES consistently receive URL intents now, but the way it reloads the app every time seems very wrong. The way it restarts my app (as judged by the splash screen that i see occurring when clicking my custom URL scheme from the android browser) cant be correct. I'd very much like to see a how-to or a testcase in where both the tiapp.xml as the js-implementation is shown on how to properly catch such events. There is a possibility I have something wrong in my code but I really cant tell by looking at the existing guides. Also, the addition of custom tiapp.xml properties like "intent-filter-new-task" blurs the correct implementation even more.