0

I have an e-commerce website (+ native mobile app) and redirect my mobile app's users to the website through the in-app browser; for pages like "About us" or "T&C". But some of the users continue purchasing products on the in-app browser, whereas I would like to redirect them back into the mobile app. How can I recognize whether a particular user has come to this page from the native app or already been? Shall I design two separate mobile views for each of them?

EDITED:

Mobile OS = android
Server = .NET core
Website = vue.js
Shahab_HK
  • 29
  • 1
  • 9

1 Answers1

1

Would be great if you can add more details to your requirement. Details like which platform are you targetting. Is it Android or iOS? Are you having a native app from which you redirect the user to Mobile web pages?

Let me suggest something based on my understanding do let me know otherwise. I guess your requirement is that if the user tries to add anything to the cart or any for a set of actions you want them to be redirected to the native app. If that's the case the general approach on the mobile is to use Javascript bridge. Refer to this article

https://medium.com/mobile-app-development-publication/making-android-interacting-with-web-app-921be14f99d8

Idea is the webpages would have logic to identify the platform from which it is called using Http headers, and based on the platform it would react differently. For instance if the add to cart is called from mobile the method would expose a callback which can be parsed from the mobile native code to do relevant actions. I assume this might be vague but the medium article may give better idea.

  • Thanks for your response. I just edited the question and added more details that might help. – Shahab_HK Jul 11 '20 at 12:29
  • Have you had a chance to look at the medium link, it should help. You will have to have a javacript method on your web page and private inner class JavaScriptInterface {} method defined in your native code. Try this stackoverflow response. https://stackoverflow.com/questions/7544671/how-to-call-javascript-from-android/7544818#7544818 – Saravinfotech Jul 11 '20 at 12:50
  • I looked at it, should try it out..guess would be helpful. Thanks again. – Shahab_HK Jul 11 '20 at 13:50