Skip to content

Commit

Permalink
In app comment callback (#480)
Browse files Browse the repository at this point in the history
* CloudDB update

com.huawei.agconnect:agconnect-cloud-database:1.5.5.300 => 1.9.1.301

* CallbackAdded for InAppComment
  • Loading branch information
alihan98ersoy committed Mar 27, 2024
1 parent c469e86 commit 5f93c81
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 28 deletions.
47 changes: 43 additions & 4 deletions Assets/Huawei/Demos/InAppComment/InAppCommentDemo.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using HuaweiMobileServices.InAppComment;

using UnityEngine;
using UnityEngine.UI;

public class InAppCommentDemo : MonoBehaviour
{

private Button Btn_CreateAppLinkingText;

private const string TAG = "[HMS] InAppCommentDemo";
private void Awake()
{
Btn_CreateAppLinkingText = GameObject.Find("InAppComment").GetComponent<Button>();
Expand All @@ -25,8 +24,48 @@ private void OnDisable()

public void ShowInAppComment()
{
Debug.Log("ShowInAppComment");
Debug.Log($"{TAG} ShowInAppComment");
InAppComment.ShowInAppComment(onResult);
}

private void onResult(int result)
{
Debug.Log($"{TAG} onResult:{result}");
CheckResultMeans(result);
}

InAppComment.ShowInAppComment();
private void CheckResultMeans(int result)
{
switch (result)
{
case 101:
Debug.Log($"{TAG} CheckResultMeans ResultCode:{result}: : The app has not been released on AppGallery.");
break;
case 102:
Debug.Log($"{TAG} CheckResultMeans ResultCode:{result}: : Rating submitted.");
break;
case 103:
Debug.Log($"{TAG} CheckResultMeans ResultCode:{result}: : Comment submitted.");
break;
case 104:
Debug.Log($"{TAG} CheckResultMeans ResultCode:{result}: : The HUAWEI ID sign-in status is invalid.");
break;
case 105:
Debug.Log($"{TAG} CheckResultMeans ResultCode:{result}: : The user does not meet the conditions for displaying the comment pop-up.");
break;
case 106:
Debug.Log($"{TAG} CheckResultMeans ResultCode:{result}: : The commenting function is disabled.");
break;
case 107:
Debug.Log($"{TAG} CheckResultMeans ResultCode:{result}: : The in-app commenting service is not supported. (Apps released in the Chinese mainland do not support this service.)");
break;
case 108:
Debug.Log($"{TAG} CheckResultMeans ResultCode:{result}: : The user canceled the comment.)");
break;
default:
Debug.Log($"{TAG} CheckResultMeans Default ResultCode:{result}");
break;
}
}

}
Binary file modified Assets/Huawei/Dlls/HuaweiMobileServices.dll
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file modified Assets/Huawei/Plugins/Android/app-debug.aar
Binary file not shown.

0 comments on commit 5f93c81

Please sign in to comment.