浏览代码

update

/main
siyao 4 年前
当前提交
be3e1c04
共有 23 个文件被更改,包括 1209 次插入34 次删除
  1. 3
      Assets/HuaweiHms/src/hms/Wrapper/appmessage/AGConnectAppMessaging.cs
  2. 2
      Assets/HuaweiHmsDemo/Scripts/test.meta
  3. 9
      Assets/HuaweiHmsDemo/Scripts/test/appmessage/AppMessageListener.cs
  4. 14
      Assets/HuaweiHmsDemo/Scripts/test/appmessage/AppMessageTest.cs
  5. 6
      Assets/HuaweiHmsDemo/Scripts/ui/TestView.cs
  6. 2
      Assets/Plugins/Android/AndroidManifest.xml
  7. 9
      Assets/Plugins/Android/agconnect-services.json
  8. 2
      Assets/Plugins/Android/baseProjectTemplate.gradle
  9. 2
      Assets/Plugins/Android/launcherTemplate.gradle
  10. 2
      Assets/Plugins/Android/HmsActivity.java.meta
  11. 22
      Assets/HuaweiHms/src/hms/Wrapper/appmessage/AGConnectAppMessagingOnErrorListener.cs
  12. 11
      Assets/HuaweiHms/src/hms/Wrapper/appmessage/AGConnectAppMessagingOnErrorListener.cs.meta
  13. 8
      Assets/HuaweiHms/src/hms/Wrapper/crash.meta
  14. 931
      Assets/HuaweiHmsDemo/Scenes/HmsCrashSampleScene.unity
  15. 7
      Assets/HuaweiHmsDemo/Scenes/HmsCrashSampleScene.unity.meta
  16. 95
      Assets/HuaweiHmsDemo/Scripts/test/location/CrashTest.cs
  17. 11
      Assets/HuaweiHmsDemo/Scripts/test/location/CrashTest.cs.meta
  18. 22
      Assets/Plugins/Android/HmsActivity.java
  19. 49
      Assets/HuaweiHms/src/hms/Wrapper/crash/AGConnectCrash.cs
  20. 11
      Assets/HuaweiHms/src/hms/Wrapper/crash/AGConnectCrash.cs.meta
  21. 25
      Assets/Plugins/Android/HmsAnalyticActivity.java
  22. 0
      /Assets/Plugins/Android/HmsActivity.java.meta

3
Assets/HuaweiHms/src/hms/Wrapper/appmessage/AGConnectAppMessaging.cs


public void addOnDismissListener(AGConnectAppMessagingOnDismissListener arg0) {
Call("addOnDismissListener", arg0);
}
public void addOnErrorListener(AGConnectAppMessagingOnErrorListener arg0) {
Call("addOnErrorListener", arg0);
}
}
}

2
Assets/HuaweiHmsDemo/Scripts/test.meta


fileFormatVersion: 2
guid: f252de948b7c74c8d95640b7180e16e8
guid: 990f8e5d27790714c8a217d67d25d135
folderAsset: yes
DefaultImporter:
externalObjects: {}

9
Assets/HuaweiHmsDemo/Scripts/test/appmessage/AppMessageListener.cs


}
}
public class OnErrorListener : AGConnectAppMessagingOnErrorListener
{
public override void onMessageError(AppMessage arg0)
{
TestTip.Inst.ShowText("message errors");
}
}
public class CustomDisplayView : AGConnectAppMessagingDisplay
{
public override void displayMessage(AppMessage arg0, AGConnectAppMessagingCallback arg1)

arg1.onMessageDismiss(arg0, AGConnectAppMessagingCallback.DismissType.BACK_BUTTON);
arg1.onMessageDisplay(arg0);
arg1.onMessageError(arg0);
}
}

14
Assets/HuaweiHmsDemo/Scripts/test/appmessage/AppMessageTest.cs


public override void RegisterEvent(TestEvent registerEvent)
{
registerEvent("Show/Hide App Message", ShowAppMessage);
registerEvent("Show/Hide App Message State", ShowAppMessageState);
registerEvent("Enable/Disable Fetch Message", EnableFetchMessage);
registerEvent("Enable/Disable Fetch Message State", EnableFetchMessageState);
registerEvent("App Message State", ShowAppMessageState);
registerEvent("Enable/Disable Fetch", EnableFetchMessage);
registerEvent("Fetch Message State", EnableFetchMessageState);
registerEvent("Add Error Listener", AddErrorListener);
registerEvent("Register Custom view", RegisterCustomView);
registerEvent("Remove Custom view", RemoveCustomView);
registerEvent("Set Display Location", SetDisplayLocation);

DisplayListener listener = new DisplayListener();
appMessaging.addOnDisplayListener(listener);
TestTip.Inst.ShowText("Add on display listener success");
}
public void AddErrorListener()
{
OnErrorListener listener = new OnErrorListener();
appMessaging.addOnErrorListener(listener);
TestTip.Inst.ShowText("Add on error listener success");
}
public void RegisterCustomView()

6
Assets/HuaweiHmsDemo/Scripts/ui/TestView.cs


public bool RemoteConfigEnabled;
public bool AppLinkingEnabled;
public bool AppMessageEnabled;
public bool CrashEnabled;
public Transform btnParent;
public GameObject btnPrefab;
public TestTip testTip;

if (AppMessageEnabled)
{
AppMessageTest.GetInstance().RegisterEvent(RegistEvent);
}
if (CrashEnabled)
{
CrashTest.GetInstance().RegisterEvent(RegistEvent);
}
}

2
Assets/Plugins/Android/AndroidManifest.xml


<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<application>
<activity android:name="com.hms.hms_analytic_activity.HmsAnalyticActivity"
<activity android:name="com.hms.hms_activity.HmsActivity"
android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

9
Assets/Plugins/Android/agconnect-services.json


"url":"connect-drcn.hispace.hicloud.com"
},
"client":{
"appType":"1",
"project_id":"736430079244517154",
"package_name":"com.huawei.codelabpush.huawei",
"api_key":"CV8RH7NYfqtuD6wnMA4dCXkfxFHUcibkk+1LTjQaXIHfxnAe6URLNBfFwBizFx0grkvKkNs2lEF3R7bWp4omnH966CO3"
"api_key":"CV8RH7NYfqtuD6wnMA4dCXkfxFHUcibkk+1LTjQaXIHfxnAe6URLNBfFwBizFx0grkvKkNs2lEF3R7bWp4omnH966CO3",
"package_name":"com.huawei.codelabpush.huawei"
},
"service":{
"analytics":{

},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn"

2
Assets/Plugins/Android/baseProjectTemplate.gradle


// See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.huawei.agconnect:agcp:1.2.1.301'
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
**BUILD_SCRIPT_DEPS**
}
}

2
Assets/Plugins/Android/launcherTemplate.gradle


implementation 'com.huawei.hms:location:5.0.0.302'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.huawei.hms:hianalytics:5.0.0.301'
implementation 'com.huawei.agconnect:agconnect-crash:1.4.1.300'
implementation 'com.huawei.agconnect:agconnect-core:1.4.1.300'
}
apply plugin: 'com.huawei.agconnect'
android {

2
Assets/Plugins/Android/HmsActivity.java.meta


fileFormatVersion: 2
guid: d07c86026503742f58a09ca7d655250c
guid: 056d90404b78f4ead8df892e346421ef
PluginImporter:
externalObjects: {}
serializedVersion: 2

22
Assets/HuaweiHms/src/hms/Wrapper/appmessage/AGConnectAppMessagingOnErrorListener.cs


using UnityEngine;
using System.Collections.Generic;
namespace HuaweiHms
{
public class AGConnectAppMessagingOnErrorListenerData : IHmsBaseListener
{
public string name => "com.huawei.agconnect.appmessaging.AGConnectAppMessagingOnErrorListener";
public string buildName => "";
}
public class AGConnectAppMessagingOnErrorListener : HmsListener<AGConnectAppMessagingOnErrorListenerData>
{
public virtual void onMessageError(AppMessage arg0) {
Call("onMessageError", arg0);
}
public void onMessageError(AndroidJavaObject arg0){
onMessageError(HmsUtil.GetHmsBase<AppMessage>(arg0));
}
}
}

11
Assets/HuaweiHms/src/hms/Wrapper/appmessage/AGConnectAppMessagingOnErrorListener.cs.meta


fileFormatVersion: 2
guid: 4f3e90e4936b64ff897f683376033823
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/HuaweiHms/src/hms/Wrapper/crash.meta


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

931
Assets/HuaweiHmsDemo/Scenes/HmsCrashSampleScene.unity


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &899329435
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 899329436}
- component: {fileID: 899329439}
- component: {fileID: 899329438}
- component: {fileID: 899329437}
m_Layer: 5
m_Name: Viewport
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &899329436
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 899329435}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1003105949}
m_Father: {fileID: 1823491354}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &899329437
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 899329435}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
--- !u!114 &899329438
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 899329435}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &899329439
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 899329435}
m_CullTransparentMesh: 0
--- !u!1 &954514470
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 954514471}
- component: {fileID: 954514474}
- component: {fileID: 954514473}
- component: {fileID: 954514472}
m_Layer: 5
m_Name: Viewport
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &954514471
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 954514470}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1857610422}
m_Father: {fileID: 1280761467}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &954514472
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 954514470}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
--- !u!114 &954514473
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 954514470}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &954514474
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 954514470}
m_CullTransparentMesh: 0
--- !u!1 &1003105948
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1003105949}
m_Layer: 5
m_Name: Content
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1003105949
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1003105948}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 899329436}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 720}
m_SizeDelta: {x: 0, y: 2880}
m_Pivot: {x: 0.5, y: 1}
--- !u!1 &1094165586
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1094165589}
- component: {fileID: 1094165588}
- component: {fileID: 1094165587}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1094165587
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1094165586}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &1094165588
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1094165586}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &1094165589
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1094165586}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1140621359
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1140621363}
- component: {fileID: 1140621362}
- component: {fileID: 1140621361}
- component: {fileID: 1140621360}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1140621360
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1140621359}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1140621361
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1140621359}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!223 &1140621362
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1140621359}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &1140621363
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1140621359}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1823491354}
- {fileID: 1280761467}
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &1280761466
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1280761467}
- component: {fileID: 1280761470}
- component: {fileID: 1280761469}
- component: {fileID: 1280761468}
m_Layer: 5
m_Name: sv:tip
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1280761467
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1280761466}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 954514471}
m_Father: {fileID: 1140621363}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 60}
m_SizeDelta: {x: -360, y: 360}
m_Pivot: {x: 0.5, y: 0}
--- !u!114 &1280761468
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1280761466}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Content: {fileID: 1857610422}
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135
m_ScrollSensitivity: 1
m_Viewport: {fileID: 954514471}
m_HorizontalScrollbar: {fileID: 0}
m_VerticalScrollbar: {fileID: 0}
m_HorizontalScrollbarVisibility: 2
m_VerticalScrollbarVisibility: 1
m_HorizontalScrollbarSpacing: -3
m_VerticalScrollbarSpacing: -3
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1280761469
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1280761466}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1280761470
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1280761466}
m_CullTransparentMesh: 0
--- !u!1 &1371331545
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1371331548}
- component: {fileID: 1371331547}
- component: {fileID: 1371331546}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1371331546
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1371331545}
m_Enabled: 1
--- !u!20 &1371331547
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1371331545}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1371331548
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1371331545}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1823491353
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1823491354}
- component: {fileID: 1823491358}
- component: {fileID: 1823491357}
- component: {fileID: 1823491356}
- component: {fileID: 1823491355}
m_Layer: 5
m_Name: sv:view
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1823491354
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823491353}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 899329436}
m_Father: {fileID: 1140621363}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 210}
m_SizeDelta: {x: -270, y: -480}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1823491355
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823491353}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c3ea94a9d52ef41e4b664616c38e4895, type: 3}
m_Name:
m_EditorClassIdentifier:
AdsEnabled: 0
AnalyticEnabled: 0
PushEnabled: 0
LocationEnabled: 0
RemoteConfigEnabled: 0
AppLinkingEnabled: 0
AppMessageEnabled: 0
CrashEnable: 1
btnParent: {fileID: 1003105949}
btnPrefab: {fileID: 5079351762955741576, guid: d221bb8c0c7b8476294abb3b987699b9,
type: 3}
testTip: {fileID: 1857610424}
start: 0
space: 100
--- !u!114 &1823491356
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823491353}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Content: {fileID: 1003105949}
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135
m_ScrollSensitivity: 1
m_Viewport: {fileID: 899329436}
m_HorizontalScrollbar: {fileID: 0}
m_VerticalScrollbar: {fileID: 0}
m_HorizontalScrollbarVisibility: 2
m_VerticalScrollbarVisibility: 2
m_HorizontalScrollbarSpacing: -3
m_VerticalScrollbarSpacing: -3
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1823491357
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823491353}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1823491358
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1823491353}
m_CullTransparentMesh: 0
--- !u!1 &1857610421
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1857610422}
- component: {fileID: 1857610426}
- component: {fileID: 1857610425}
- component: {fileID: 1857610424}
- component: {fileID: 1857610423}
m_Layer: 5
m_Name: tip
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1857610422
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1857610421}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 954514471}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1857610423
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1857610421}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 0
m_VerticalFit: 2
--- !u!114 &1857610424
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1857610421}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d2e3734de11284ada8356989220882e2, type: 3}
m_Name:
m_EditorClassIdentifier:
text: {fileID: 1857610425}
--- !u!114 &1857610425
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1857610421}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!222 &1857610426
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1857610421}
m_CullTransparentMesh: 0

7
Assets/HuaweiHmsDemo/Scenes/HmsCrashSampleScene.unity.meta


fileFormatVersion: 2
guid: bbdc48b629211a94597bbf97050e2d5a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

95
Assets/HuaweiHmsDemo/Scripts/test/location/CrashTest.cs


using System.Security.Cryptography;
using HuaweiHms;
using UnityEngine;
using System;
using UnityEngine.Diagnostics;
using Exception = System.Exception;
namespace HuaweiHmsDemo
{
public class CrashTest : Test<CrashTest>
{
public const int DEBUG = 3;
public const int ERROR = 6;
public const int INFO = 4;
public const int WARN = 5;
public override void RegisterEvent(TestEvent registerEvent)
{
registerEvent("enableCrashCollection(boolean enable)", () => SetCrashCollection(true));
registerEvent("testIt", SetTestIt);
registerEvent("setUserId(String userId)", () => SetUserId("TestUserId"));
registerEvent("setCustomKey(String key, String value)", () => SetCustomKey("stringKey", "world"));
registerEvent("setCustomKey(String key, boolean value)", () => SetCustomKey("booleanKey", false));
registerEvent("setCustomKey(String key, double value)", () => SetCustomKey("doubleKey", 1.1));
registerEvent("setCustomKey(String key, float value)", () => SetCustomKey("floatKey", 1.1f));
registerEvent("setCustomKey(String key, int value)", () => SetCustomKey("intKey", 0));
registerEvent("setCustomKey(String key, long value)", () => SetCustomKey("longKey", 11L));
registerEvent("log(String message)", () => Setlog("set info log"));
registerEvent("log(int level, String message)", () => Setlog(DEBUG, "set debug log."));
}
public void SetCrashCollection(bool isCollection)
{
if (isCollection)
{
AGConnectCrash.getInstance().enableCrashCollection(true);
TestTip.Inst.ShowText("upload crash collection");
}
else
{
AGConnectCrash.getInstance().enableCrashCollection(false);
TestTip.Inst.ShowText("do not upload crash collection");
}
}
public void SetTestIt()
{
AGConnectCrash.getInstance().enableCrashCollection(true);
TestTip.Inst.ShowText("create crash");
Application.ForceCrash(0);
}
public void SetUserId(string userid)
{
AGConnectCrash.getInstance().setUserId(userid);
TestTip.Inst.ShowText($"set user id: {userid}");
}
public void SetCustomKey(string key, string value)
{
AGConnectCrash.getInstance().setCustomKey(key, value);
TestTip.Inst.ShowText($"set key: {key}," + $"set string value: {value}");
}
public void SetCustomKey(string key, bool value)
{
AGConnectCrash.getInstance().setCustomKey(key, value);
TestTip.Inst.ShowText($"set key: {key}," + $"set bool value: {value}");
}
public void SetCustomKey(string key, double value)
{
AGConnectCrash.getInstance().setCustomKey(key, value);
TestTip.Inst.ShowText($"set key: {key}," + $"set double value: {value}");
}
public void SetCustomKey(string key, float value)
{
AGConnectCrash.getInstance().setCustomKey(key, value);
TestTip.Inst.ShowText($"set key: {key}," + $"set float value: {value}");
}
public void SetCustomKey(string key, long value)
{
AGConnectCrash.getInstance().setCustomKey(key, value);
TestTip.Inst.ShowText($"set key: {key}," + $"set long value: {value}");
}
public void Setlog(string log)
{
AGConnectCrash.getInstance().log(log);
TestTip.Inst.ShowText($"log message: {log}");
}
public void Setlog(int level, string log)
{
AGConnectCrash.getInstance().log(level, log);
TestTip.Inst.ShowText($"set log lever: {level}," + $"log message: {log}");
}
}
}

11
Assets/HuaweiHmsDemo/Scripts/test/location/CrashTest.cs.meta


fileFormatVersion: 2
guid: 132181f76e01a5d4585c49b89251aa17
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

22
Assets/Plugins/Android/HmsActivity.java


package com.hms.hms_activity;
import android.os.Bundle;
import com.huawei.hms.analytics.HiAnalytics;
import com.huawei.hms.analytics.HiAnalyticsTools;
import com.unity3d.player.UnityPlayerActivity;
import com.huawei.agconnect.appmessaging.AGConnectAppMessaging;
import com.huawei.hms.aaid.HmsInstanceId;
public class HmsActivity extends UnityPlayerActivity {
private AGConnectAppMessaging appMessaging;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
HiAnalyticsTools.enableLog();
HiAnalytics.getInstance(this);
appMessaging = AGConnectAppMessaging.getInstance();
}
}

49
Assets/HuaweiHms/src/hms/Wrapper/crash/AGConnectCrash.cs


using UnityEngine;
using System.Collections.Generic;
namespace HuaweiHms
{
public class AGConnectCrash_Data : IHmsBaseClass{
public string name => "com.huawei.agconnect.crash.AGConnectCrash";
}
public class AGConnectCrash :HmsClass<AGConnectCrash_Data>
{
public AGConnectCrash (): base() { }
public static AGConnectCrash getInstance() {
return CallStatic<AGConnectCrash>("getInstance");
}
public void enableCrashCollection(bool arg0) {
Call("enableCrashCollection", arg0);
}
public void testIt(Context arg0) {
Call("testIt", arg0);
}
public void setUserId(string arg0) {
Call("setUserId", arg0);
}
public void setCustomKey(string arg0, bool arg1) {
Call("setCustomKey", arg0, arg1);
}
public void setCustomKey(string arg0, long arg1) {
Call("setCustomKey", arg0, arg1);
}
public void setCustomKey(string arg0, int arg1) {
Call("setCustomKey", arg0, arg1);
}
public void setCustomKey(string arg0, string arg1) {
Call("setCustomKey", arg0, arg1);
}
public void setCustomKey(string arg0, double arg1) {
Call("setCustomKey", arg0, arg1);
}
public void setCustomKey(string arg0, float arg1) {
Call("setCustomKey", arg0, arg1);
}
public void log(int arg0, string arg1) {
Call("log", arg0, arg1);
}
public void log(string arg0) {
Call("log", arg0);
}
}
}

11
Assets/HuaweiHms/src/hms/Wrapper/crash/AGConnectCrash.cs.meta


fileFormatVersion: 2
guid: 7b998fde644bd8a4fb6931cf4c25feb4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

25
Assets/Plugins/Android/HmsAnalyticActivity.java


package com.hms.hms_analytic_activity;
import android.os.Bundle;
import com.huawei.hms.analytics.HiAnalytics;
import com.huawei.hms.analytics.HiAnalyticsTools;
import com.unity3d.player.UnityPlayerActivity;
import com.huawei.agconnect.appmessaging.AGConnectAppMessaging;
import com.huawei.hms.aaid.HmsInstanceId;
public class HmsAnalyticActivity extends UnityPlayerActivity {
private AGConnectAppMessaging appMessaging;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
HiAnalyticsTools.enableLog();
HiAnalytics.getInstance(this);
appMessaging = AGConnectAppMessaging.getInstance();
appMessaging.setFetchMessageEnable(true);
appMessaging.setDisplayEnable(true);
appMessaging.setForceFetch();
}
}

/Assets/Plugins/Android/HmsAnalyticActivity.java.meta → /Assets/Plugins/Android/HmsActivity.java.meta

正在加载...
取消
保存