Basic browser detection and setting as query param in deeplink#746
Basic browser detection and setting as query param in deeplink#746esune merged 12 commits intoopenwallet-foundation:mainfrom
Conversation
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@gmail.com>
Pull Request Test Coverage Report for Build 14137165330Details
💛 - Coveralls |
|
Note passing Also this wouldn't cover a case where a calling app (like the Google app) doesn't have it's own UA app identifier. IE on that what, from what I can tell, you'd just get "Chrome" and not know to deeplink back to the Google search app. Maybe this limited support for major browsers would be fine...? |
|
https://github.com/bhagyas/app-urls and https://medium.com/@contact.jmeyers/complete-list-of-ios-url-schemes-for-third-party-apps-always-updated-5663ef15bdff seem to cover some of the possible schemas |
I don't think the mapping should live in VC-AuthN since the browsers support is ultimately dependent on the app and which browsers are on the device. |
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@gmail.com>
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@gmail.com>
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@gmail.com>
|
Get an error trying the deep link on the wallet Probably the encoded space but we likely shouldn't be passing that display name anyhow since it won't mean anything to the wallet, the wallet will have to know the custom URI for every browser it can go back to with this pattern anyways, so it would need to maintain some mapping (unless it's determined that URI mapping should be done in VCAuth but I don't think it's appropriate for the browser to be handling that). So if we go with this solution I would just use the key instead of the value of that mapping object (IE |
|
Ya as far as I know we are going to have to wait on this one to be supported by the wallet for it to work. I agree the mapping would likely be better just using the enum entry rather than the string. Due to the interdependence I still question if this is the best approach but don't have any better solution as of now |
|
Ok regardless of that we can't do the display name with a space in it I don't think, is there a way to access the key from that object instead of the value? "SAFARI_MOBILE" instead of "Mobile Safari", if I try that it doesn't blow up the wallet, it's just an unused parameter. |
|
Sure thing I'll change that now |
|
For thought later... since this is a specific pattern we are trying with BC implementation (might not be standard?) we could consider only putting this code in the BC gov template page and not the basic generic VCAtuth version, as someone can run VCAuth with a different deep link prefix that doesn't call the BC Wallet. |
That is a good point. The benefit of pushing it out in this repo is that we are more likely to get visibility/feedback from other users who may be facing (and resolving) the same problem already? |
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@google.com>
|
I could not get the object from UAParser since it is not in the minified js, but I was able to replicate what is needed to get the browser. I removed the mobile info since, as of now, it seems unnecessary. I also added the info to the debugging element |
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@google.com>
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@google.com>
|
found an edge case with Opera Mobile but it is fixed now. If any identifiers will contain a space we now simply go for the first word |
esune
left a comment
There was a problem hiding this comment.
I think this works, we'll have to do more testing in conjunction with the wallet team to validate
|
@loneil Any idea what the user agent was? |
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@google.com>
This happens on anything iOS, the URL format is invalid URL with the 2 |
Signed-off-by: Gavin Jaeger-Freeborn <gavinfreeborn@google.com>
There was a problem hiding this comment.
Think this looks good now. Opening in the BC Wallet it just sends the new unused browser query param around and it doesn't cause any errors. I forced a exception in the handling code and it worked as expected.
So think we can add this to the BC Gov template and deploy that to the dev env. Can coordinate with the BC Wallet team to see what can happen with that param.
esune
left a comment
There was a problem hiding this comment.
👍🏻 let's do some extra testing once merged!


This is intended to resolve help resolve #731
It simply appends a query param
browserto the deeplink giving the name of the current browser. Here is an example where the name wasMobile SafariWe can also integrate the new ua parser to detect the browser type as either mobile or desktop if we decide to go forward with this approach
Here are all the user options we can support matching against https://github.com/faisalman/ua-parser-js/blob/af8acf9078e5952a496d395464af8178ad55ccaf/src/enums/ua-parser-enums.js#L10-L163