在银河商店执行应用内评论时出错



我第一次尝试在Galaxy Store应用内弹出评论。根据银河开发人员(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"));  

最新更新