- Home /
Determine which app store is targeted, from code
I am adding an "our other games" screen to my games. I would like to send people directly to the app store if they click on one of the buttons for one of the games.
However, if they are playing on a game that was targeting Amazon, I want to send them to the Amazon app store, vs those playing a game that was targeting google, being sent to Google Play.
Is there any way, in code, to determine which app store was targeted when the app was built?
An help is appreciated. -Larry
I just found that I can load the Billing$$anonymous$$ode.json file from resources, and read the appstore name from there. This will work for me, but if there is a better way to deter$$anonymous$$e this, I would still like to find it ;)
Answer by kaarloew · Apr 16, 2019 at 06:20 AM
One option is to use different package names for different stores. You can read package name during runtime with Application.identifier and do actions based on that https://docs.unity3d.com/ScriptReference/Application-identifier.html
another option is to check vending https://stackoverflow.com/questions/11072079/how-to-know-if-an-app-has-been-downloaded-from-google-play-or-amazon
Your answer
Follow this Question
Related Questions
In game Store to buy levels with real money 2 Answers
Amazon IAP sandbox testing issue 0 Answers
I want my iOS app to check if there is an update available for it on the app store 0 Answers
App Rejected 2.1 All iPhone apps are required to be functional on iPad. 0 Answers
ERROR ITMS-9000: "Invalid Binary. The binary is missing architectures [arm64]." 0 Answers