Problems with RateApp Api

I am using the new API option for Rate this App. here is the code i am using:

[lua] local settings =
{
iOSAppId = “573990592”,
nookAppEAN = “2940043931467”,
androidAppPackageName = “com.bluefireventures.flashcardsunitedstates”,
supportedAndroidStores = { “samsung”, “google”, “amazon”, “nook” },
}
native.showPopup(“rateApp”, settings) [/lua]

I used this code i believe in build 929 and it worked. I am now in build 936 and my app got rejected by Amazon for the following reason:

[text]
When pointing to other apps or websites from within your app, including up-sells, ratings, version updates, or upgrades, our published policy calls for the completion of purchase to be from Amazon.

Steps to reproduce this issue as it appears in this app:

1.Install and Launch the app.
2.Tap on “Rate This App”.
3.Links to Google Play.
To point to a specific app, the Download URL must be http://www.amazon.com/gp/mas/dl/android?p=[packagename] (where [package name] is your package name). The link will become active when the app is live in our store. If you want to link to the list of all your applications on Amazon use the URL http://www.amazon.com/gp/mas/dl/android?p=[packagename]&showAll=1.

Please correct the issue(s) we found with your app submission.
[/text]

My App was rejected today. Has anyone else had this problem? [import]uid: 88147 topic_id: 32503 reply_id: 332503[/import]

The reason you got rejected is because the app reviewer’s Android device had both the Google Play and Amazon App store apps installed. Corona has no idea what app store it belongs to when it is installed by hand, so Corona is forced to “guess” based on the app stores installed on the device. In this case, Corona guessed wrong.

Because of this, I recommend to developers to change their [lua]supportedAndroidStores[/lua] setting to target the one app store they are building for. In the case, you should do this…
[lua]supportedAndroidStores = { “amazon” }[/lua]
[import]uid: 32256 topic_id: 32503 reply_id: 129698[/import]

The reason you got rejected is because the app reviewer’s Android device had both the Google Play and Amazon App store apps installed. Corona has no idea what app store it belongs to when it is installed by hand, so Corona is forced to “guess” based on the app stores installed on the device. In this case, Corona guessed wrong.

Because of this, I recommend to developers to change their [lua]supportedAndroidStores[/lua] setting to target the one app store they are building for. In the case, you should do this…
[lua]supportedAndroidStores = { “amazon” }[/lua]
[import]uid: 32256 topic_id: 32503 reply_id: 129698[/import]

I got bit by this today too.
[import]uid: 19626 topic_id: 32503 reply_id: 130074[/import]

I got bit by this today too.
[import]uid: 19626 topic_id: 32503 reply_id: 130074[/import]

Yeah, me too :-/ Issue might just have enough “weight” to put it in the docs? [import]uid: 130908 topic_id: 32503 reply_id: 130412[/import]

Yeah, me too :-/ Issue might just have enough “weight” to put it in the docs? [import]uid: 130908 topic_id: 32503 reply_id: 130412[/import]

Can I just add a subquestion to this, since it’s of a similar nature?

I have a variable called storeName, and prior to building for each app Store I set it to the appropriate value (google/amazon/samsung/nook).
I then have some if statements to check which store this is for, and then only have that store as the supported Android store:

if storeName == "amazon" then  
 local rateOptions =  
 {  
 requestView = "writeReview",  
 nookAppEAN = "1234567",  
 androidAppPackageName = "com.me.myapp",  
 supportedAndroidStores = { "amazon" },  
 }  
 native.showPopup("rateApp", rateOptions)  
  
elseif storeName == "nook" then  
 local rateOptions =  
 {  
 requestView = "writeReview",  
 nookAppEAN = "1234567",  
 androidAppPackageName = "com.me.myapp",  
 supportedAndroidStores = { "nook" },  
 }  
 native.showPopup("rateApp", rateOptions)  
  
elseif storeName == "google" then   
 local rateOptions =  
 {  
 requestView = "writeReview",  
 nookAppEAN = "1234567",  
 androidAppPackageName = "com.me.myapp",  
 supportedAndroidStores = { "google"},  
 }  
 native.showPopup("rateApp", rateOptions)  
  
elseif storeName == "samsung" then   
 local rateOptions =  
 {  
 requestView = "writeReview",  
 nookAppEAN = "1234567",  
 androidAppPackageName = "com.me.myapp",  
 supportedAndroidStores = { "samsung"},  
 }  
 native.showPopup("rateApp", rateOptions)  
  
end  

It’s a bit bulky, but it should do the trick. I tested on a Kindle Fire and it gave me a popup with the option to either go to the Amazon app or silk, and both take me to the correct page.

However, when we tested the Amazon build on a Nexus 7 and a HTC Sensation which have the Amazon store installed, pressing our “rate app” button did nothing, it didn’t show a popup at all.

Is supportedAndroidStores = { "amazon" } configured to only go to the Amazon store on Kindle devices or something? Or is the Amazon store app on other Android devices treated as a different app? [import]uid: 84115 topic_id: 32503 reply_id: 134138[/import]

Supported Stores should work on all android devices. How are you determining the store name?

Also you don’t need to pass the ean on any of them except for the Nook and the androidPackageName is only needed if you need to link to an app other than the one that’s running. [import]uid: 199310 topic_id: 32503 reply_id: 134153[/import]

I’m determining the store name manually i.e:
The build we sent upload to Google play - I set the storeName variable to “google” prior to building.
The build for Amazon, I set it to “amazon”
etc

I’ve also put an assert in so that it can’t be left blank (in case I forget).

Also I’ve just removed the ean and package name, so the only thing in the rateOptions table for Google/Amazon/Samsung is:

local rateOptions =  
 {  
 supportedAndroidStores = { storeName},  
 }  
 native.showPopup("rateApp", rateOptions)  
  

Still doesn’t work. It’s not like it goes to the wrong place, or crashes. It just…does nothing.
As I say, it works on the Kindle and the “google” option works on the other Android devices.
Could it be that the version of the amazon app we have is making some kind of difference? As in maybe it’s not exactly the same as the one you would find on a Kindle? [import]uid: 84115 topic_id: 32503 reply_id: 134157[/import]

native.showPopup() returns a true/false value which you can use to determine if it was able to handle your request.
I’ve noticed that the behavior is different depending on which Android version and device you’re running your app on as well. My two Android devices are a Galaxy S (Android 2.3.6) and a Google Nexus 7 (Android 4.2.1). Both also behave differently depending on which App Store apps I happen to have installed…

To get around this issue I have a URL string for each App Store I support that points to the relevant store page, and use a system.openURL() of that string in case native.showpopup() returns false. [import]uid: 70847 topic_id: 32503 reply_id: 134190[/import]

ingemar,

I’m curious as to what exactly is causing native.showPopup() to return false on you. This is the first I’ve heard about it. If no one tells about these issues, then they’ll never get solved.

I’ve personally tested our “rateApp” API on Android OS 2.2 up to 4.1 and with all 4 app stores. The only time it should return false is if Corona could not find the requested app store on the device. Corona looks for the app store by its package name… except for Nook which we identify by the device model name. If you think you’ve found an edge case, then we’d love to hear about it so that we can improve this API on our end.

On the device this API fails on you, can you please tell us the following:

  • The make and model of the device.
  • The Android OS version.
  • The package name of the app store you are trying to launch.

To find out the app store’s package name, please do the following:

  1. Tap on the “App Store” app to start the process.
  2. Press the Home button to keep it suspended in the background.
  3. Go to the device’s “Settings\Apps\Running” view.
  4. Tapp on the app store in the list.
  5. The package name should be visible there.

Thanks in advance. [import]uid: 32256 topic_id: 32503 reply_id: 134206[/import]

Hi Joshua,

I found this issue a couple of weeks ago when I was updating my code to use the built-in showPopup function instead of my old openURL code I had. This issue is not only related to “rateApp”, it also happens with “appStore”.
Since I’m on a tight Christmas deadline I came up with a solution that worked, and put this issue on a list for reporting to you later…sorry for that.

I do try to report bugs I find quickly, however writing code for a repeatable test-case isn’t always simple, and sometimes requires quite a lot of detective work just to get the test-case showing the problem. Like in this case where I’ve noticed different behaviors depending on which App Store apps that are installed, and which App Store version of my app I’m testing.

The package names of the App Store apps I have installed on both devices are:
Amazon: com.amazon.venezia
Google Play: com.google.process.gapps (this is an assumption taken from the Google Services process since I can’t find an explicit process for the Play Store)

If I remember correctly, the Amazon app store isn’t called on either device. The Google Play appstore is called on my Google Nexus 7, but not on my Samsung Galaxy S Wifi (YP-GB1)

I will make an official bug-report about this issue later. Most likely after Santa has been here :slight_smile:

[import]uid: 70847 topic_id: 32503 reply_id: 134267[/import]

No worries. I understand. Finishing your commitments will of course take priority. I really appreciate the info that you’ve provided me so far.

One question. How are you installing your app on your devices? Are you installing your APK via “adb install” or are you using an app to install your APK.

The reason I ask is that I think I see one flaw in our app store detection code. If the APK is installed by another app, then Corona assumes that it is a marketplace app such as Google Play, Amazon, B&N, etc… in which case Corona does not have to “guess” which marketplace it came from and show the app store that installed your APK. Here is where the possible flaw is. If the app that installed your APK could not be identified as a supported app store, then nothing will be shown. Now, we did this on purpose in case the APK is being distributed by a marketplace that we do not support, in which case returning false is the right thing to do. I’m not sure if this is really a flaw or not, because from one perspective, it makes sense to do this… but it would definitely catch you off guard during testing if you are using a 3rd party app simply to side load your app during testing.
[import]uid: 32256 topic_id: 32503 reply_id: 134270[/import]

I’m installing my apps with “adb install”.

I just want to say that having to write code with a test-case is a good thing, even though it can feel a bit frustrating at times. There have been cases where I thought I found a bug, and while writing a test-case I found that it was my fault, not Corona SDK. It slows down the reporting process somewhat, but at the same time it forces a more accurate picture of the problem.

…now back to coding my million-dollar apps :wink: [import]uid: 70847 topic_id: 32503 reply_id: 134273[/import]

Can I just add a subquestion to this, since it’s of a similar nature?

I have a variable called storeName, and prior to building for each app Store I set it to the appropriate value (google/amazon/samsung/nook).
I then have some if statements to check which store this is for, and then only have that store as the supported Android store:

if storeName == "amazon" then  
 local rateOptions =  
 {  
 requestView = "writeReview",  
 nookAppEAN = "1234567",  
 androidAppPackageName = "com.me.myapp",  
 supportedAndroidStores = { "amazon" },  
 }  
 native.showPopup("rateApp", rateOptions)  
  
elseif storeName == "nook" then  
 local rateOptions =  
 {  
 requestView = "writeReview",  
 nookAppEAN = "1234567",  
 androidAppPackageName = "com.me.myapp",  
 supportedAndroidStores = { "nook" },  
 }  
 native.showPopup("rateApp", rateOptions)  
  
elseif storeName == "google" then   
 local rateOptions =  
 {  
 requestView = "writeReview",  
 nookAppEAN = "1234567",  
 androidAppPackageName = "com.me.myapp",  
 supportedAndroidStores = { "google"},  
 }  
 native.showPopup("rateApp", rateOptions)  
  
elseif storeName == "samsung" then   
 local rateOptions =  
 {  
 requestView = "writeReview",  
 nookAppEAN = "1234567",  
 androidAppPackageName = "com.me.myapp",  
 supportedAndroidStores = { "samsung"},  
 }  
 native.showPopup("rateApp", rateOptions)  
  
end  

It’s a bit bulky, but it should do the trick. I tested on a Kindle Fire and it gave me a popup with the option to either go to the Amazon app or silk, and both take me to the correct page.

However, when we tested the Amazon build on a Nexus 7 and a HTC Sensation which have the Amazon store installed, pressing our “rate app” button did nothing, it didn’t show a popup at all.

Is supportedAndroidStores = { "amazon" } configured to only go to the Amazon store on Kindle devices or something? Or is the Amazon store app on other Android devices treated as a different app? [import]uid: 84115 topic_id: 32503 reply_id: 134138[/import]

Supported Stores should work on all android devices. How are you determining the store name?

Also you don’t need to pass the ean on any of them except for the Nook and the androidPackageName is only needed if you need to link to an app other than the one that’s running. [import]uid: 199310 topic_id: 32503 reply_id: 134153[/import]

I’m determining the store name manually i.e:
The build we sent upload to Google play - I set the storeName variable to “google” prior to building.
The build for Amazon, I set it to “amazon”
etc

I’ve also put an assert in so that it can’t be left blank (in case I forget).

Also I’ve just removed the ean and package name, so the only thing in the rateOptions table for Google/Amazon/Samsung is:

local rateOptions =  
 {  
 supportedAndroidStores = { storeName},  
 }  
 native.showPopup("rateApp", rateOptions)  
  

Still doesn’t work. It’s not like it goes to the wrong place, or crashes. It just…does nothing.
As I say, it works on the Kindle and the “google” option works on the other Android devices.
Could it be that the version of the amazon app we have is making some kind of difference? As in maybe it’s not exactly the same as the one you would find on a Kindle? [import]uid: 84115 topic_id: 32503 reply_id: 134157[/import]

native.showPopup() returns a true/false value which you can use to determine if it was able to handle your request.
I’ve noticed that the behavior is different depending on which Android version and device you’re running your app on as well. My two Android devices are a Galaxy S (Android 2.3.6) and a Google Nexus 7 (Android 4.2.1). Both also behave differently depending on which App Store apps I happen to have installed…

To get around this issue I have a URL string for each App Store I support that points to the relevant store page, and use a system.openURL() of that string in case native.showpopup() returns false. [import]uid: 70847 topic_id: 32503 reply_id: 134190[/import]

ingemar,

I’m curious as to what exactly is causing native.showPopup() to return false on you. This is the first I’ve heard about it. If no one tells about these issues, then they’ll never get solved.

I’ve personally tested our “rateApp” API on Android OS 2.2 up to 4.1 and with all 4 app stores. The only time it should return false is if Corona could not find the requested app store on the device. Corona looks for the app store by its package name… except for Nook which we identify by the device model name. If you think you’ve found an edge case, then we’d love to hear about it so that we can improve this API on our end.

On the device this API fails on you, can you please tell us the following:

  • The make and model of the device.
  • The Android OS version.
  • The package name of the app store you are trying to launch.

To find out the app store’s package name, please do the following:

  1. Tap on the “App Store” app to start the process.
  2. Press the Home button to keep it suspended in the background.
  3. Go to the device’s “Settings\Apps\Running” view.
  4. Tapp on the app store in the list.
  5. The package name should be visible there.

Thanks in advance. [import]uid: 32256 topic_id: 32503 reply_id: 134206[/import]