numbersprotocol / capture-lite

A photo-sharing app with only verifiable photos and videos.
https://numbersprotocol.github.io/
GNU General Public License v3.0
25 stars 6 forks source link

[Issue] When the process of "swap NUM" is completed, user still stays on the metamask browser instead of returning Capture App automatically #2834

Open sync-by-unito[bot] opened 1 year ago

sync-by-unito[bot] commented 1 year ago

User story

As a user, I want to be automatically redirected to the Capture App after completing the "Swap NUM" process, so that I can seamlessly continue using the app without the need for manual navigation.

Reproduce step

  1. Go to wallet page & start swap NUM process
  2. When process complete, user will stay on metamask browser

Expectation

When the process of "swap NUM" is completed, user should redirect to Capture App automatically.

Additional information:

┆Issue is synchronized with this Asana task by Unito ┆Created By: Kenny Hung

sync-by-unito[bot] commented 1 year ago

➤ Kenny Hung commented:

Arrange into patch sprint(0619).

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam do you know if its possible to create a deeplink for Capture App?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam do you know if its possible to generate a deeplink for capture app?

i think for this one what we can do is when the transfer is complete we can call the deeplink to navigate back to capture app. but to do that we need to generate one for capture app.

do you happen to know how to do that?

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu,

Regarding

do you know if its possible to generate a deeplink for capture app?

Yes seems like capture app (uses ionic and capacitorjs under the hood) and capacitorjs can do deep links https://capacitorjs.com/docs/guides/deep-links ( https://capacitorjs.com/docs/guides/deep-links )

Regarding

how to do or what can be best approach

I need to check the docs and try

But yes we can do deep links.

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

I will look at this task in details later and see what we can do. 🙏

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam ok great!

if its possible to do deeplink than all we need is to pass in the deeplink url to reopen capture wallet page and this should be good

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, I think to programmatically navigate back to the app we can use deep links as you suggested.

If we want to navigate back automatically to capture app when user is done with metamask thing we need to do the following things:

  1. From bubble side use JavaScript to trigger browser navigation for example window.location.href = 'captureapp://'; (I will tell exact link during development)
  2. Configure capture app to receive/react to deep links (Asana card created [FR] configure capture app to receive deep links ( https://app.asana.com/0/0/1204822013110388 )).

For configuring capture app to receive deep links we need to accomplish few steps ( https://capacitorjs.com/docs/guides/deep-links#create-site-association-file ) and might need some admin permissions.

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam

so for (2) how long will it take to be able to do this one?

also Kenny Hung there is an asana card to make it possible for automatic redirect back to capture app via deeplink. what's the schedule for this one? since its a dependency maybe we can also assign as part of patch sprint?

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, for (2) [FR] configure capture app to receive deep links ( https://app.asana.com/0/0/1204822013110388 ) I estimate 1 day but also deep link configuration ( https://capacitorjs.com/docs/guides/deep-links#creating-site-association-files ) might need admin level permissions so +1 day.

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

ok got it. let me know when you decide to work on it and when it will be ready 🙂 thanks!

also let me know how i can support.

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, I will work on [FR] configure capture app to receive deep links ( https://app.asana.com/0/0/1204822013110388 ) on sprint after PATCH sprint because in PATCH sprint it's better to finish [code-quality] Updating from Capacitor 4 to Capacitor 5 ( https://app.asana.com/0/0/1204798271886976 ) and make sure app works fine after migration.

Once migration to capacitor 5 is done we can safely do [FR] configure capture app to receive deep links ( https://app.asana.com/0/0/1204822013110388 )

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam thanks for the update

Kenny Hung i have drawn the diagram for this one. i will submit as a deliverable but as sam mentioned in his previous comment this cannot be implemented in patch sprint but the next one.

to summarize:

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

SamKenny Hung miro: https://miro.com/app/board/o9J_knEiIYo=/?moveToWidget=3458764557609608655&cot=14 ( https://miro.com/app/board/o9J_knEiIYo=/?moveToWidget=3458764557609608655&cot=14 )

https://miro.com/app/board/o9J_knEiIYo=/?moveToWidget=3458764557609608655&cot=14 ( https://miro.com/app/board/o9J_knEiIYo=/?moveToWidget=3458764557609608655&cot=14 )
sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Kenny Hung see comment.

i think this one will need to arranged in the next sprint.

i think it would be good if the deeplink setup for ionic is arranged in the same sprint.

sync-by-unito[bot] commented 1 year ago

➤ Kenny Hung commented:

Ethan Wu Good! I'll add sub-task for this task.

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam just checking in to see if you will be working on this one and also if you need anything from my end?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam can you let me know what the progress is on this one. depending on the progress we may need to update kenny on the progress and delay to another sprint

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu this task will be added in upcoming sprint (after 07.23). I can start working in 2 days from now

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Pls move this task to 7.23 sprint Kenny Hung

sync-by-unito[bot] commented 1 year ago

➤ Kenny Hung commented:

Push to 0717 sprint

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, which branch I can test it?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam the branches are currently either under code review or just passed qa so its not possible currently to modify the available branches.

maybe a better way to do this is to create a test bubble app and add a workflow with a run javascript step to redirect back to the deeplink

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, understood I think it's also good for isolated testing. I will create sample project and try myself I will share my progress soon. Thank you for clarification.

sync-by-unito[bot] commented 1 year ago

➤ Kenny Hung commented:

Just confirm this task still assign to Ethan? or need to change to Sam?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

It's both of us. You can keep it assigned to me

sync-by-unito[bot] commented 1 year ago

➤ Kenny Hung commented:

Ethan Wu (cc SamTammy Yang) Just want to confirm

If this implement is deployed, but [FR] configure capture app to receive deep links ( https://app.asana.com/0/1201016280880500/1204822013110388 ) doesn't publish yet. Will it affect user?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Kenny Hung no it won't affect users.

basically if ionic hasn't set up deeplink than nothing will happen when the process is complete. users will still need to navigate back manually.

if the ionic has deplink setup than it will automatically navigate back.

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, what domain you expect to use for deep links? For example after user is done with metamask what URL you will open with JavaScript?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam i want to open up the wallet page in capture app

yes i will use JavaScript to call the deeplink url.

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam so the url will be the same as the wallet page that opens normally. with token and refresh-token

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, to set up deep link there are multiple steps. One of them is create Creating Site Association Files ( https://capacitorjs.com/docs/guides/deep-links#creating-site-association-files ).

Basically https://captureappiframe.numbersprotocol.io/.well-known/apple-app-site-association should serve this content

{

"applinks": {

"apps": [],

"details": [

{

"appID": "G7NB5YCKAP.io.numbersprotocol.capturelite",

"paths": [

"*"

]

}

]

}

}

I accomplished this by following this thread comment ( https://forum.bubble.io/t/feature-request-hosting-files-in-the-root-directory/27152/10 ).

Now the thing is we need merge to Main branch before I can continue. Because currently it's https://captureappiframe.numbersprotocol.io/version-18v1/.well-known/apple-app-site-association ( https://captureappiframe.numbersprotocol.io/version-18v1/.well-known/apple-app-site-association ) but it should not contain /version-18v1/ part.

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

image.pngEthan Wu, do you think we can merge it directly or we should go through QA branch merge etc? By the way I checked out from Main branch.

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam do you mean you want to add the main branch contents to your current branch?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam you cannot merge anything directly into main branch bc whatever is there is what tammy will use for code review.

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, I want sam-experiment-deep-links branch to be merged to Main

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam we cannot do that because main branch currently has v230627-capture-app-iframe (re-release)

and it needs to undergo code review.

also unless it is deployed to LIVE all branches will have /version-/

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam do you need to merge it now because you want to test it out?

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, preferably yes. But if can not merge directly then I need to create blocking asana card and ask Kenny to help to arrange it.

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam yeah. so i think what we can do is when i can add your implementation into v230711-capture-app-iframe

which will be up for testing after 230627 re-release.

and after it gets deployed i'll ping you and you can continue your testing.

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, thank you for clarification.

Then I will mark [FR] configure capture app to receive deep links ( https://app.asana.com/0/1201016280880500/1204822013110388/f ) as blocked by ✓ v230711-capture-app-iframe ( https://app.asana.com/0/1201016280880500/1204942805264674/f ) deployment for now and also inform Kenny Hung about that.

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, when approximately v230711-capture-app-iframe will be deployed?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam that im not sure. first 230627 needs to be deployed. than 230711 needs to under code review. after that same weekend it will be deployed. but its not always the case.

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Sam unfortunately i don't have authorization to create another company bubble account.

maybe you can ask tammy and let her know your situation. maybe after hearing your situation she can let you merge your settings to the main branch so that you can start testing sooner.

sync-by-unito[bot] commented 1 year ago

➤ Sam commented:

Ethan Wu, got it 😇.

I found another way. I will use firebase hosting (which is free) to unblock myself and keep working on deep links.

Once my bubble branch will be merged I will just update site URL and hopefully it will work as expected.

sync-by-unito[bot] commented 1 year ago

➤ Kenny Hung commented:

Ethan Wu Just confirm, current qa branch(66b4), the redirect to Capture Cam could work?

sync-by-unito[bot] commented 1 year ago

➤ Ethan Wu commented:

Kenny Hung it depends on if deeplinks are set up on ionic