Each store owner will have their own data and dashboard, I am trying to get the shop name in the dashboard.
The dashboard is an iFrame of my dashboard that I am hosting.
I have tried many many methods of trying to get the parent page's URL and data such as below:
Alternatively I have noticed when the authentication process begins when the user installs the app the domain is collected and stored, is there a way to capture this each time the store-owner is using the app? So I can try this from the server -> dashboard rather than dashboard -> server?
There is a method of using sessions with cookies but if someone clears their cookies I think the app would need to be reinstalled.
any help would be massively appreciated.
var url = (window.location != window.parent.location) ? document.referrer : document.location.href;
That's what the API's are for and with your app being installed by a merchant in their store, they grant you API access to query their store - among which is also store meta data such as the name.
Hope this helps!
same kind i have tried out and this worked for me :