-
Notifications
You must be signed in to change notification settings - Fork 149
Redirecting back from third party website app not loaded in app tag #372
Comments
I ran exactly into this error, what I did was that I navigate to the default page/index page and pass params through app linking mechanism and read from the link a param which lets me know were to redirect. Look out for app linking on android and ios using xamarin. To pass or read any param from external apps or website you need tu enable app linking first. |
Thanks i will look into that👍. I am trying to do this now first in Wpf where i navigate to an external payment service that after payment redirects back to a page /orderdetails. When i do this in Webassmbly the page loads fine but in hybrid the page loads but app tag is empty and blank page ia rendered. Is this also what you had exactly? |
Yup, Exactly that, when you redirect back you will need to pass params in the query string of the url, example Remember that hybrid app has his entry point, and from your entry point you force the redirect once you use the applinking mechanism within ur xamarin app. |
Take note what you would need to setup your android and ios project so they react to a website link or app scheme and within that website link or app scheme you can provide params which were here you can give your app a desired action/task. |
Is this also valid for Wpf? In the documentation they only mention IOs and Android. In Wpf I tried to pass in a query sting to the redirect Url like you said but still same problem. |
I haven't try wpf but since they are based on xamarin forms I think they should behave the same. Did you overrided platform app linking and listened to it from xamarin side? |
@arivera12 i didnt because since i didnt read anything in the documentation about Wpf i didnt know exactly how to proceed. I only did the query string part so far. I wil try it tomorrow and see if i can get it to work. Thank you for the guidance👍 |
For example: On Android you need to add intent filter to main activity On top of your main activity
Now with this instruction you android app will react we any link having that uri is pressed. On xamarin side you need to listen for app linking request on your Heres is my implementation
Then on your
You can pass as many params you want but for navigate in this implementation you will need to provide a param with name path so he reacts and navigates properly. |
I haven't yet setup ios or wpf but this works for android, once you hook up platform specific app linking, from xamarin side should be like an auto drive to the desired page. |
@arivera12 Finally i got it to work on Android thank you very much for your help. Its only working when redirecting from external browser like chrome. The system prefered browser does not seem to invoke the intent when redirecting it took me another two days to figure this out😥. I modified the part where you clear all properties to only clear the redirecturl properties so that i dont lose user data because i had issues with saving user data to cookies on android and now i just store them in Application properties but i don't know if this is the right thing to do. But many thanks to you because i couldnt find anything on this on the internet after alot of searching👍 |
@arivera12 i forgot to mention that this doesnt work for Wpf in my case because Wpf is not supported by Xamarin Essentials. At least that's what i understood from searching around |
@Akdimi it took me like a month 😢 to figure this out. Also there is no sample with this full implementation on the internet. I did that merging 2-3 different articles. But wait not so fast! There is a port of xamarin essentials coming to Windows Desktop (WPF)! Take a look of this xamarin/Essentials#1079 |
@Akdimi consider using |
Hi, when you navigate to third party website and then redirect back to the app the page is blank. When looking at the elements in html everything is there except there is nothing inside the app tag. Is there a way to handle this correctly? I tried almost everything like mapfallbacktofile in server startup etc.. i can redirect to the page but the app is not loaded into the app tag and there are no errors.
The text was updated successfully, but these errors were encountered: