为 Galaxy Store 执行应用内评论时出错
Error while performing in-app Review for Galaxy Store
我第一次尝试对我的 Galaxy Store 应用进行应用内弹出式评论。根据 Galaxy Developer (https://developer.samsung.com/galaxy-store/customer-review/galaxy-store-review-broadcast.html) 提供的文档,我按照每个步骤进行操作,但在激发项目时遇到了这个错误。
这是我在里面实现的代码 MainActivity.java:
ApplicationInfo ai =
getPackageManager().getApplicationInfo("com.sec.android.app.samsungapps",
PackageManager.GET_META_DATA);
int inappReviewVersion = ai.metaData.getInt("com.sec.android.app.samsungapps.review.inappReview", 0);
if (inappReviewVersion > 0){
// if inappReviewVersion is larger than zero, Galaxy Store supports in-app review function
} else {
// else, Galaxy Store does not support in-app review function
}
// 1. Check your review authority by Galaxy Store package
Intent intent = new Intent("com.sec.android.app.samsungapps.REQUEST_INAPP_REVIEW_AUTHORITY");
intent.setPackage("com.sec.android.app.samsungapps");
intent.putExtra("callerPackage", com.protecgames.htmleditor); // targetPacakge : your package name
sendBroadcast(intent);
Intent intent = new Intent();
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
startActivity(intent);
这是我得到的错误:
1. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ")" to complete MethodInvocation
----------
2. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ")" to complete MethodInvocation
----------
3. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ";" to complete Statement
----------
3 problems (3 errors)
我使用的语言是Java
您应该将数据添加为字符串而不是包或我们所说的任何内容。
尝试这样设置数据:
intent.setData(Uri.parse("samsungapps://AppRating/com.protecgames.htmleditor"));
我第一次尝试对我的 Galaxy Store 应用进行应用内弹出式评论。根据 Galaxy Developer (https://developer.samsung.com/galaxy-store/customer-review/galaxy-store-review-broadcast.html) 提供的文档,我按照每个步骤进行操作,但在激发项目时遇到了这个错误。
这是我在里面实现的代码 MainActivity.java:
ApplicationInfo ai =
getPackageManager().getApplicationInfo("com.sec.android.app.samsungapps",
PackageManager.GET_META_DATA);
int inappReviewVersion = ai.metaData.getInt("com.sec.android.app.samsungapps.review.inappReview", 0);
if (inappReviewVersion > 0){
// if inappReviewVersion is larger than zero, Galaxy Store supports in-app review function
} else {
// else, Galaxy Store does not support in-app review function
}
// 1. Check your review authority by Galaxy Store package
Intent intent = new Intent("com.sec.android.app.samsungapps.REQUEST_INAPP_REVIEW_AUTHORITY");
intent.setPackage("com.sec.android.app.samsungapps");
intent.putExtra("callerPackage", com.protecgames.htmleditor); // targetPacakge : your package name
sendBroadcast(intent);
Intent intent = new Intent();
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
startActivity(intent);
这是我得到的错误:
1. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ")" to complete MethodInvocation
----------
2. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ")" to complete MethodInvocation
----------
3. ERROR in /storage/emulated/0/.sketchware/mysc/603/app/src/main/java/com/protecgames/htmleditor/MainActivity.java (at line 184)
intent.setData(Uri.parse(samsungapps://AppRating/com.protecgames.htmleditor)); // deeplinkUri, included in response intent
^
Syntax error, insert ";" to complete Statement
----------
3 problems (3 errors)
我使用的语言是Java
您应该将数据添加为字符串而不是包或我们所说的任何内容。 尝试这样设置数据:
intent.setData(Uri.parse("samsungapps://AppRating/com.protecgames.htmleditor"));