首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为Galaxy执行应用程序内评审时出错

为Galaxy执行应用程序内评审时出错
EN

Stack Overflow用户
提问于 2022-05-02 03:16:42
回答 1查看 126关注 0票数 -1

我正在尝试程序内弹出评论我的银河商店应用程序第一次。根据Galaxy (https://developer.samsung.com/galaxy-store/customer-review/galaxy-store-review-broadcast.html)提供的文档,我执行了每个步骤,并在激发项目时得到了这个错误。

下面是我在MainActivity.java中实现的代码:

代码语言:javascript
复制
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);

以下是我遇到的错误:

代码语言:javascript
复制
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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-02 04:29:49

您应该将数据添加为字符串,而不是包或我们所说的任何内容。尝试以这种方式设置数据:

代码语言:javascript
复制
intent.setData(Uri.parse("samsungapps://AppRating/com.protecgames.htmleditor"));  
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72082026

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档