浏览代码

add comment

/main
siyao 4 年前
当前提交
f834a031
共有 3 个文件被更改,包括 36 次插入2 次删除
  1. 20
      Assets/HuaweiServiceDemo/Scripts/test/RemoteConfigTest.cs
  2. 5
      Assets/HuaweiServiceDemo/Scripts/test/appmessage/AppMessageListener.cs
  3. 13
      Assets/HuaweiServiceDemo/Scripts/test/appmessage/AppMessageTest.cs

20
Assets/HuaweiServiceDemo/Scripts/test/RemoteConfigTest.cs


public void SetXmlValue()
{
// get instatance of AGConnectConfig
// get config resId of xml file
// Sets a default value for a parameter.
config.applyDefault(configId);
showAllValues();
}

map.put("test3", 222);
map.put("test4", 666.456);
map.put("test5", "fromMap");
// Sets a default value for a parameter.
// fetch cloud setting, add success listener and failure listener
// Applies parameter values
// Checks whether the ConfigValues object contains a requested key.
// Returns the value of type for a key.
TestTip.Inst.ShowText($"configValues as string {configValues.getValueAsString("CloudString")}");
TestTip.Inst.ShowText($"configValues as byte first byte {configValues.getValueAsByteArray("CloudByte")[0]}");
TestTip.Inst.ShowText($"configValues as long {configValues.getValueAsLong("CloudLong").longValue()}");

}));
}
// apply the config value laste fetched
public void GetCloudSettingsWorkNextTime()
{
config = AGConnectConfig.getInstance();

showAllValues();
}
// Fetches latest parameter values from the cloud at a custom interval.
// If the method is called within an interval, cached data is returned.
public void GetCloudSettingsFiveMins()
{
config = AGConnectConfig.getInstance();

showAllValues();
}
// Enables the developer mode,
// in which the number of times that the app fetches data from Remote
// Configuration is not limited, and traffic control is still performed over the cloud.
public void SetDeveloperMode()
{
config = AGConnectConfig.getInstance();

}
// Clears all cached data,
// including the data fetched from Remote Configuration and the default values passed.
public void ClearCache()
{
config = AGConnectConfig.getInstance();

// get all configs, print key and value pair
private void showAllValues()
{
config = AGConnectConfig.getInstance();

}
}
// get all configs, print key and the source of a key.
private void GetAllValueWithSource()
{
config = AGConnectConfig.getInstance();

5
Assets/HuaweiServiceDemo/Scripts/test/appmessage/AppMessageListener.cs


}
}
// call back for message tap
public class ClickListener : AGConnectAppMessagingOnClickListener
{
public override void onMessageClick(AppMessage arg0)

}
// call back for message close
public class DismissListener : AGConnectAppMessagingOnDismissListener
{
public override void onMessageDismiss(AppMessage arg0, AGConnectAppMessagingCallback.DismissType arg1)

}
}
// call back for message display
public class DisplayListener : AGConnectAppMessagingOnDisplayListener
{
public override void onMessageDisplay(AppMessage arg0)

}
}
// call back for message error
public class OnErrorListener : AGConnectAppMessagingOnErrorListener
{
public override void onMessageError(AppMessage arg0)

}
// call back for custom message display
public class CustomDisplayView : AGConnectAppMessagingDisplay
{
public override void displayMessage(AppMessage arg0, AGConnectAppMessagingCallback arg1)

13
Assets/HuaweiServiceDemo/Scripts/test/appmessage/AppMessageTest.cs


registerEvent("trigger", Trigger);
}
// set message display enable state
public void ShowAppMessage()
{
showMessage = !showMessage;

// show message display enable state
public void ShowAppMessageState()
{
var enable = appMessaging.isDisplayEnable();

// set fetch message enable state
public void EnableFetchMessage()
{
fetchMessage = !fetchMessage;

// show fetch message enable state
public void EnableFetchMessageState()
{
var enable = appMessaging.isFetchMessageEnable();

// force fetch message
public void ForceFetch()
{
appMessaging.setForceFetch();

// Adds a listener for message tap events.
public void AddOnClickListener()
{
ClickListener listener = new ClickListener();

// Adds a listener for message closing events.
public void AddDismissListener()
{
DismissListener listener = new DismissListener();

// Adds a listener for message display events.
public void AddDisplayListener()
{
DisplayListener listener = new DisplayListener();

// Adds a listener for message error.
public void AddErrorListener()
{
OnErrorListener listener = new OnErrorListener();

// Adds a custom in-app message.
public void RegisterCustomView()
{
CustomDisplayView view = new CustomDisplayView();

// Deletes custom in-app message
public void RemoveCustomView()
{
appMessaging.removeCustomView();

// Sets the display position of a pop-up or image message
public void SetDisplayLocation()
{
appMessaging.setDisplayLocation(Location.BOTTOM);

// Triggers a custom event
public void Trigger()
{
appMessaging.trigger(EVENTNAME);

正在加载...
取消
保存