浏览代码

update demo

/main
siyao 4 年前
当前提交
6abc26de
共有 12 个文件被更改,包括 73 次插入4 次删除
  1. 2
      Assets/HuaweiHmsDemo/demo/test/AnalyticTest.cs
  2. 2
      Assets/HuaweiHmsDemo/demo/test/PushTest.cs
  3. 29
      Assets/HuaweiHmsDemo/demo/test/location/LocationUpdateTest.cs
  4. 24
      Assets/HuaweiHMSCoreAppServices/HuaweiHms/src/hms/JavaCode/javaClass/location/LocationSettingsStates.cs
  5. 5
      Assets/HuaweiHMSCoreAppServices/HuaweiAppGallery/GameService.dll.meta
  6. 8
      Assets/HuaweiHMSCoreAppServices.meta
  7. 7
      Assets/HuaweiHMSCoreAppServices/HuaweiAppGallery/readme.md.meta
  8. 0
      /Assets/HuaweiHMSCoreAppServices/HuaweiHms.meta
  9. 0
      /Assets/HuaweiHMSCoreAppServices/HuaweiHms
  10. 0
      /Assets/HuaweiHMSCoreAppServices/HuaweiAppGallery.meta
  11. 0
      /Assets/HuaweiHMSCoreAppServices/HuaweiAppGallery

2
Assets/HuaweiHmsDemo/demo/test/AnalyticTest.cs


registerEvent("SendProductId",SendProductId);
registerEvent("SendAnalyticEnable",SendAnalyticEnable);
registerEvent("CreateClearCache",CreateClearCache);
registerEvent("Set Favorite Sport",SetFavoriteSport);
registerEvent("set user profile",SetFavoriteSport);
registerEvent("get user profile",getUserProfiles);
registerEvent("Set push token",SetPushToken);
registerEvent("set Min Activity Sessions",setMinActivitySessions);

2
Assets/HuaweiHmsDemo/demo/test/PushTest.cs


public override void onMessageDelivered(string arg0, BaseException arg1)
{
TestTip.Inst.ShowText("onSendError called, message id:" + arg0 + "+ ErrCode:"
TestTip.Inst.ShowText("on message delivered called, message id:" + arg0 + "+ ErrCode:"
+ arg1.getErrorCode() + ", description:" + arg1.getMessage());
}

29
Assets/HuaweiHmsDemo/demo/test/location/LocationUpdateTest.cs


public override void RegisterEvent(TestEvent registerEvent)
{
registerEvent("SetPermission", SetPermission);
registerEvent("check Location Settings", checkLocationSettings);
registerEvent("update with callback-102", () => RequestLocationUpdates(102, CALLBACK));
registerEvent("update with callback-104", () => RequestLocationUpdates(104, CALLBACK));
registerEvent("update with callback-100", () => RequestLocationUpdates(100, CALLBACK));

);
}
public void checkLocationSettings()
{
TestTip.Inst.ShowText("check location settings start");
mFusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(new Context());
mSettingsClient = LocationServices.getSettingsClient(new Context());
mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(5000);
mLocationRequest.setPriority(102);
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
builder.addLocationRequest(mLocationRequest);
LocationSettingsRequest locationSettingsRequest = builder.build();
Task task = mSettingsClient.checkLocationSettings(locationSettingsRequest);
task.addOnSuccessListener(new HmsSuccessListener<LocationSettingsResponse>((LocationSettingsResponse locationSettingsResponse) =>
{
var locationSettingsStates = locationSettingsResponse.getLocationSettingsStates();
TestTip.Inst.ShowText($"isBleUsable: {locationSettingsStates.isBleUsable()}");
TestTip.Inst.ShowText($"isBlePresent: {locationSettingsStates.isBlePresent()}");
TestTip.Inst.ShowText($"isGpsPresent: {locationSettingsStates.isGpsPresent()}");
TestTip.Inst.ShowText($"isGpsUsable: {locationSettingsStates.isGpsUsable()}");
TestTip.Inst.ShowText($"isLocationPresent: {locationSettingsStates.isLocationPresent()}");
TestTip.Inst.ShowText($"isLocationUsable: {locationSettingsStates.isLocationUsable()}");
TestTip.Inst.ShowText($"isNetworkLocationPresent: {locationSettingsStates.isNetworkLocationPresent()}");
TestTip.Inst.ShowText($"isNetworkLocationUsable: {locationSettingsStates.isNetworkLocationUsable()}");
}));
task.addOnFailureListener(new HmsFailureListener((Exception e) => SetSettingsFailuer(e)));
}
public void RequestLocationUpdates(int priority, int requestType)
{
TestTip.Inst.ShowText("RequestLocationUpdatesWithCallback start");

24
Assets/HuaweiHMSCoreAppServices/HuaweiHms/src/hms/JavaCode/javaClass/location/LocationSettingsStates.cs


{
public LocationSettingsStates (): base() { }
public LocationSettingsStates (bool arg0, bool arg1, bool arg2, bool arg3, bool arg4, bool arg5): base(arg0, arg1, arg2, arg3, arg4, arg5) { }
public bool isBlePresent() {
return Call<bool>("isBlePresent");
}
public bool isBleUsable() {
return Call<bool>("isBleUsable");
}
public bool isGpsPresent() {
return Call<bool>("isGpsPresent");
}
public bool isGpsUsable() {
return Call<bool>("isGpsUsable");
}
public bool isLocationPresent() {
return Call<bool>("isLocationPresent");
}
public bool isLocationUsable() {
return Call<bool>("isLocationUsable");
}
public bool isNetworkLocationPresent() {
return Call<bool>("isNetworkLocationPresent");
}
public bool isNetworkLocationUsable() {
return Call<bool>("isNetworkLocationUsable");
}
}
}

5
Assets/HuaweiHMSCoreAppServices/HuaweiAppGallery/GameService.dll.meta


fileFormatVersion: 2
guid: 6f2c742ceda7a4b4fb6dfedf75715a06
timeCreated: 1583743990
licenseType: Free
defineConstraints: []
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:

8
Assets/HuaweiHMSCoreAppServices.meta


fileFormatVersion: 2
guid: c202b2417de6a455f887817255016ff5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

7
Assets/HuaweiHMSCoreAppServices/HuaweiAppGallery/readme.md.meta


fileFormatVersion: 2
guid: ec4e16da02e3e40748ae3ea7c33fcae0
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

/Assets/HuaweiHms.meta → /Assets/HuaweiHMSCoreAppServices/HuaweiHms.meta

/Assets/HuaweiHms → /Assets/HuaweiHMSCoreAppServices/HuaweiHms

/Assets/HuaweiAppGallery.meta → /Assets/HuaweiHMSCoreAppServices/HuaweiAppGallery.meta

/Assets/HuaweiAppGallery → /Assets/HuaweiHMSCoreAppServices/HuaweiAppGallery

正在加载...
取消
保存