Giter Site home page Giter Site logo

evilminddevs / hms-unity-plugin Goto Github PK

View Code? Open in Web Editor NEW
303.0 18.0 41.0 25.68 MB

The HMS Unity Plugin makes it easy to include Huawei Mobile Services into Unity-based games. Authentication, in-app purchases, push alerts, ads, and interaction with gaming services are just a few of the basic capabilities that this formidable tool makes available to your applications.

Home Page: https://evilminddevs.gitbook.io/hms-unity-plugin/

C# 99.62% Java 0.38%
game-development gamedev hms huawei huawei-mobile-services plugin plugins unity unity-package

hms-unity-plugin's Introduction

Huawei Mobile Services Plugin for Unity

latestV
Official Documentation
Discord

Overview

The HMS Unity plugin helps you integrate the full power of Huawei Mobile Services into your game developed with Unity. Also, you can access other features such as Connect API which provides RESTful APIs that can be used to customize services provided by AppGallery Connect or implement process automation, thereby improving your work efficiency.
Huawei kits and services that our plugin will help you to integrate:

  • Account Kit
  • Ads Kit
  • Analytics Kit
  • App Linking
  • Drive Kit
  • Game Service
  • In-App Purchases
  • Location Kit
  • Nearby Service
  • Push Kit
  • Scan Kit
  • App Messaging
  • APM
  • Auth Service
  • Cloud DB
  • Cloud Storage
  • Connect API
  • Crash Service
  • In-App Comments
  • Remote Configuration
  • 3D Modeling Kit (Beta)

Requirements

Android SDK min 21 Net 4.x

Important

This plugin supports:

  • Unity version 2019, 2020, 2021 - Developed in the master Branch
  • Unity version 2018 - Developed in 2.0-2018 Branch

Make sure to download the corresponding Unity package for the Unity version you are using from the release section

For more information, please refer to the documentation.
Is there something we can help with? You can join our discord channel.

Downloading the plugins

There are 2 different options for obtaining the plugins:

  • Download plugins as .unitypackage file from releases page.

  • git clone master branch (for 2018 -> 2.0-2018 Branch) into the Assets folder of your Unity project.

Installing the plugins

Please refer to Import the plugin into your Unity project.

Account Kit

Account Kit provides you with simple, secure, and quick sign-in and authorization functions. For more About the Service.

Ads Kit

Ads Kit leverages the vast user base of Huawei devices and Huawei's extensive data capabilities to provide you with the Publisher Service, helping you monetize traffic. For more About the Service.

Analytics Kit

Analytics Kit is a one-stop user behavior analysis platform for your games. For more About the Service.

App Linking

App Linking allows you to create cross-platform links that can work as defined regardless of whether a user has installed your game. For more Service Introduction.

Drive Kit

Drive Kit allows you to create games that use HUAWEI Drive capabilities. For more About the Service.

Game Service

Game Service helps you build basic game functions such as achievements, leaderboards, and saved games at low costs. Improve efficiency in testing, managing, and releasing games and keep attracting users with continuous optimization based on game data analysis. For more
About the Service.

In-App purchases

In-App Purchases (IAP) enables you to sell digital products and content directly within your game. For more Service Introduction.

Location Kit

Location Kit provides capabilities for you to obtain the precise user device location quickly, helping you build up global positioning capabilities and expand your global business. For more
About the Service.

Push Kit

Push Kit is a messaging service provided for you to establish a cloud-to-device messaging channel. For more Service Introduction.

Auth Service

Auth Service provides an SDK and backend services, supports multiple authentication modes, and provides a powerful management console, enabling you to easily develop and manage user authentication. For more Service Introduction.

Cloud DB

Cloud DB is a device-cloud synergy database product that provides data synergy management capabilities between the device and cloud, unified data models, and various data management APIs. For more Service Introduction.

Connect API

The AppGallery Connect API provides RESTful APIs that can be used to customize services provided by AppGallery Connect or implement process automation, thereby improving your work efficiency. For more Service Introduction.

Remote Configuration

Remote Configuration provides cloud-based services. By integrating the client SDK, your game can periodically fetch parameter values from the cloud. For more Service Introduction.

App Messaging

You can use App Messaging of AppGallery Connect to send relevant messages to target users actively using your app to encourage them to use key app functions, or send attractive promotion activities to enhance user loyalty. For more Service Introduction.

Crash Service

The AppGallery Connect Crash service provides a powerful yet lightweight solution to game crash problems. With the service, you can quickly detect, locate, and resolve game crashes. For more Service Introduction.

Nearby Service

Nearby Data Communication allows apps to easily discover nearby devices and set up communication channels with them using technologies such as Bluetooth and Wi-Fi. For more Service Introduction.

In-App Comments

The in-app comments service allows you to prompt your users to submit ratings and make comments for your app. For more Service Introduction.

License

This project is licensed under the MIT License

hms-unity-plugin's People

Contributors

alihan98ersoy avatar am1goo avatar andronovo-bit avatar bar1scanhw avatar bunyamineymen avatar bunyamineymenalagoz avatar enes-ozdemir avatar franalma avatar gmyusuf avatar htpck avatar kayahanbaskeser avatar m0skit0 avatar mmontesinos81 avatar murphyne avatar mustafacqn avatar rcspoon avatar sametguzeldev avatar wrobelkrakow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hms-unity-plugin's Issues

Can we call multiple ads requests of same type at once?

This is my code and it throws the following error:

NullReferenceException: Object reference not set to an instance of an object
HuaweiAdsHandler.Awake () (at Assets/Scripts/AdsHandler/HuaweiAdsHandler.cs:40)

My code is:

private List<InterstitalAdManager> interstitialAdsManager  = new List<InterstitalAdManager>();
    public List<string> interstitialIdList=["x","y","z"];
    void Awake()
    {
        if(instance!=null)
        {
            return;
        }
        else
        {
            instance=this;
        }
        for(int i=0;i<interstitialIdList.Count;i++)
        {
            interstitialAdsManager.Add(new InterstitalAdManager());
            InitializeInterstitialAds(i);
        }
    }

    private void InitializeInterstitialAds(int id)
    {
        interstitialAdsManager[id]=InterstitalAdManager.GetInstance();
        interstitialAdsManager[id].AdId=interstitialIdList[id];
        interstitialAdsManager[id].OnAdLoaded=OnInterstitialAdLoaded;
        interstitialAdsManager[id].OnAdClosed=OnInterstitialAdClosed;
        interstitialAdsManager[id].OnAdFailed=OnInterstitialAdFailed;
    }

Clearly there is some error here. Can you please let me know what's the right approach and if it is possible or not?

Auto-Renewable Subscriptions???

Hi Devs.

Thank you for giving us opportunity to combine Unity with Huawei :)

Does this plugin support Huawei subscriptions? If it doesn't do you plan to work on it in some time too?

InterstitialAd can not be show

I build the ads demo, rewarded video is ok, but intersititalAd can not be show, my unity version is 2019.3.3f1, and with mono

is bannerAdManager missing?

i can see interstitial and rewardAd manager in there but i didnt see bannerAd manager. Does banner ad implementation doesnot require bannerAdManager? or is there is any way of implementing banner ads in game if yes how can we do that? hoping to see helpful information from you. Thank you

Custom Ads ID not working

As reported:

We configured Ad Unit id: ”xxxxxxxxx" for interstitials. See all details in the screenshot below.
It does not load or show any interstitials. It still works fine if I use the test unit id ”testb4znbuh3n2”.

Shared AGC configuration looks correctly set up.

I can't sign-in from AccountDemo.unity

I just create a new project, then import the plugin. Then, update the agconnect-services.json and
AndroidManifest.xml. Is there any missing?

2020-07-03 11:16:36.055 13873-13873/ I/Unity: [HMS]: Sign in failedException of type 'HuaweiMobileServices.Utils.HMSException' was thrown.
AccountDemoManager:OnLoginFailure(HMSException)
System.Action1:Invoke(T) System.Action1:Invoke(T)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

2020-07-03 11:16:36.072 14222-14304/? I/InAppTransport: [I/HMSCore/InAppTransport 14222:45904 :95] In-App Request, uri: hwid.inner.getServiceToken, clientIdentity: {appId: 10132067, hostAppID: 10132067, packageName: com.huawei.hwid, sdkVersion: 0, uid: 0, transactionId: , apiLevel: 0, uri: null, kitSdkVersion: 0}
2020-07-03 11:16:36.074 13873-13873/com.kingyou.testhms E/Unity: UnityException: get_isActiveAndEnabled can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
at UnityEngine.UI.Graphic.SetVerticesDirty () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UI.Text.set_text (System.String value) [0x00000] in <00000000000000000000000000000000>:0
at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.AndroidJavaProxy.Invoke (System.String methodName, S

The callback OnAdClosed never called

There is a typo in InterstitialAdsManager, line 29, it should say mAdsManager.OnAdClosed?.Invoke();
and not
mAdsManager.OnAdClicked?.Invoke();

Problems with Rewarded Ads

Hi,
When tested my app with test ad IDs, both interstitials and Rewarded ads worked correctly. So, just removed test IDs and added mine and launched the app, with no more changes. Interstitials work fine, but nothing happened when pressed the button to show a rewarded Ad. My system enables this button if a Rewarded ad is loaded (info from RewardedAdManager included in this plugin), otherwise remains disabled and not interactable. No errors in logcat.

Unity version: 2019.4.0f1
Plugin version (package or commit): I don't know. App was upladed on June 29th, plugin was downloaded that day.
Mono or IL2CPP: IL2CPP
Test device model: Huawei P40 Lite

IapManager doesn't work

Hello,

Thanks for your work, it is very useful.
I have some problems with IapManager. I'm going to explain it.
In the Readme, it said that you can call BuyProduct method just with an argument, a string. Also, in the demo, it called that method with a string (I know that demos are WIP).

Captura de pantalla 2020-05-20 a las 9 28 31

But when I try to call it from my script, it shows an error:

Captura de pantalla 2020-05-20 a las 9 29 37

This is because in IapManager.cs, the method BuyProduct has the argument of type ProductInfo (this has been downloaded from your repository):

Captura de pantalla 2020-05-20 a las 9 28 43

I don't know if this is a recently change or just a mistake. I would like to know if you are thinking in fix it and to use again an string because it is more easy to configure.

Furthermore, when I try to assign the method by UI, it doesn't appear, even been a public method.

Captura de pantalla 2020-05-20 a las 9 29 00

Please, let me know if you knew about that problems and if you are thinking in fix them.
Again, thank you so much for your work.

GetRankingSwitchStatus returns error

I have setup a Leaderboard and when calling IsUserScoreShownOnLeaderboards which calls GetRankingSwitchStatus, it returns Failure with errorcode 0.

Missing script

Hi, I just want to publish game to the app gallery but I cannot understand how to do this. If I follow this guide I can't find HMS manager in package although it need by guide. What I do wrong ?

Not working in Unity 2019

Tested Unity 2019.3.13f
In empty project after importing plugin, I have this errors:

`Unloading broken assembly Assets/Huawei/Dlls/HuaweiMobileServices.dll, this assembly can cause crashes in the runtime

Error: Could not load signature of HuaweiMobileServices.Utils.AndroidAccount:.ctor due to: Could not resolve type with token 0100000d (from typeref, class/assembly UnityEngine.AndroidJavaObject, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) assembly:UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type:UnityEngine.AndroidJavaObject member:(null) signature:`

Problem creating purchase intent

I have this working in other projects but I´m not having any response after
ITask task = iapClient.CreatePurchaseIntent(purchaseIntentReq); in iapManager
purchaseIntentReq info is correct but neither AddOnSuccessListener nor AddOnFailureListener is returned. Any ideas?

EDIT:
Extracts from logcat. Apparently something is wrong with authservice, but at app init i see the correct login popup.
07-29 17:13:58.455: E/AuthService(30699): [E/HMSCore/AuthService 30699:10417 :409] Failed to check the permission, appID: 102607029, errorCode: 6004, permission: com.huawei.android.hms.common.jos.off, checkExpiredTimeFlag: 1

ad this later:
MissingMethodException: Constructor on type 'HuaweiMobileServices.IAP.PurchaseIntentResult' not found.
at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0
at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <00000000000000000000000000000000>:0
at HuaweiMobileServices.Utils.AndroidJavaObjectExtensions.AsWrapper[T] (UnityEngine.AndroidJavaObject javaObject) [0x00000] in <00000000000000000000000000000000>:0
at System.Func`2[T,TResult].Invoke (T arg) [0x00000] in <00000000000000000000000000000000>:0
at HuaweiMobileServices.Base.OnSuccessListenerConve

HMS Manager missing?

Hi,
We made some tests with the previous version of the plugin and are now migrating towards the one available at the Releases section. In this new version, there's no HMSManager script, so we don't know where to add the Key that was required to connect to the IAP system.
We manage to sign in correctly, but whenever we call function ObtainProductInfo we always get the iapAvailable == false. Is there a new way of connecting to the IAP system?
Thanks.

[EDIT]: Ok, just saw the Full Demos release date for 14/05/2020, so we can wait until then for the new way of using the IAP system.

FileNotFoundException AndroidManifest.xml does not exist

When i want to save editor window, I had this error:
`FileNotFoundException: C:\UnityInstalls\2019.3.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\Apk\AndroidManifest.xml does not exist

System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.IO.File.Copy (System.String sourceFileName, System.String destFileName) (at <437ba245d8404784b9fbab9b439ac908>:0)

HuaweiEditor.prepareManifest () (at Assets/Huawei/Scripts/Editor/HuaweiEditor.cs:161)
HuaweiEditor.OnGUI () (at Assets/Huawei/Scripts/Editor/HuaweiEditor.cs:95)`

As workaround I created manifest.xml file in plugins/Android

IapManager : no PurchaseResultInfo inside OnConsumePurchaseSuccess.

A correct moment for reward extradition in only after Successful Consume.
Right now in IapManager there's no way to verify which product was consumed inside OnConsumePurchaseSuccess.

There's a need to add PurchaseResultInfo inside OnConsumePurchaseSuccess. Or at least add <string productID> inside of it.
Now it's impossible to know how to reward after iapManager.ConsumeOwnedPurchases();

here's a demo example
image
but no usage of OnConsumePurchaseSuccess at all!

Do you suggest rewarding the user during a successful purchase without waiting for consummation ? That does look totally broken. Also in this situation iapManager.ConsumeOwnedPurchases() does nothing.

I would be able to consume every 'stuck/frozen' inapp inside iapManager.OnObtainOwnedPurchasesSuccess, but this returns only empty lists. (doesn't work at all).

So we need any clarification about product itself inside OnConsumePurchaseSuccess or working OnObtainOwnedPurchasesSuccess to be able to build a reliable store.

Latest version does not compile

The latest version gets a lot of compiler errors, e.g. AccountManager.cs line 14.
I can see that on May 22, Fran Almeida made a merge that totally corrupted the source code. And all commits after that also fail.

Nothing happens after Pressing BuyProduct

I looked at the products list, there seems to be no issues at all.
But after pressing the BuyProduct button for each product, nothing happens.

I traced it and found out that this line under IapManager.cs is not doing anything.

ITask task = iapClient.CreatePurchaseIntent(purchaseIntentReq);

Sorry, am I missing something that I should put in the scene as well?

Build failure with Scripting Backend IL2CPP

Project builds with MONO Scripting Backend, but fails with the following error message with Scripting Backend set to IL2CPP:


Failed running /Applications/Unity/Hub/Editor/2019.3.0f6/Unity.app/Contents/il2cpp/build/deploy/net471/UnityLinker.exe -out="/Users/manelizzard/Workspace/Huawei/hms-unity-plugin/Temp/StagingArea/assets/bin/Data/Managed/tempStrip" -x="/Users/manelizzard/Workspace/Huawei/hms-unity-plugin/Temp/StagingArea/assets/bin/Data/Managed/../platform_native_link.xml" -x="/var/folders/vs/60k47bcs0jbf2d9t9z702t0r0000gn/T/tmp6410e26a.tmp" -x="/Users/manelizzard/Workspace/Huawei/hms-unity-plugin/Temp/StagingArea/assets/bin/Data/Managed/TypesInScenes.xml" -d="/Users/manelizzard/Workspace/Huawei/hms-unity-plugin/Temp/StagingArea/assets/bin/Data/Managed" --include-unity-root-assembly="/Users/manelizzard/Workspace/Huawei/hms-unity-plugin/Temp/StagingArea/assets/bin/Data/Managed/Assembly-CSharp.dll" --include-unity-root-assembly="/Users/manelizzard/Workspace/Huawei/hms-unity-plugin/Temp/StagingArea/assets/bin/Data/Managed/UnityEngine.UI.dll" --dotnetruntime=il2cpp --dotnetprofile=unityaot --use-editor-options --include-directory="/Users/manelizzard/Workspace/Huawei/hms-unity-plugin/Temp/StagingArea/assets/bin/Data/Managed" --rule-set=Conservative --editor-data-file="/Users/manelizzard/Workspace/Huawei/hms-unity-plugin/Temp/StagingArea/assets/bin/Data/Managed/EditorToUnityLinkerData.json" --platform=Android --enable-engine-module-stripping --engine-modules-asset-file="/Applications/Unity/Hub/Editor/2019.3.0f6/PlaybackEngines/AndroidPlayer/Whitelists/../modules.asset"

stdout:
Fatal error in Unity CIL Linker
System.InvalidOperationException: No action for the assembly HuaweiMobileServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null defined
  at Mono.Linker.AnnotationStore.GetAction (Mono.Cecil.AssemblyDefinition assembly) [0x0002b] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Mono.Linker.Steps.MarkStep.IsFullyPreserved (Mono.Cecil.TypeDefinition type) [0x00033] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00165] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Mono.Linker.Steps.MarkStep.MarkField (Mono.Cecil.FieldReference reference) [0x0005e] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Unity.Linker.Steps.UnityMarkStep.Unity.Linker.Steps.Marking.IMarkStepCallbacks.MarkField (Mono.Cecil.FieldReference reference) [0x00001] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.Steps.Marking.BaseMarkStepExtension.MarkField (Mono.Cecil.FieldReference reference) [0x00001] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.Steps.Marking.MonoBehaviourMarking.MarkNeededFields (Mono.Cecil.TypeDefinition type) [0x0001b] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.Steps.Marking.MonoBehaviourMarking.DoAdditionalTypeProcessing (Mono.Cecil.TypeDefinition type) [0x0003a] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.Steps.UnityMarkStep.DoAdditionalTypeProcessing (Mono.Cecil.TypeDefinition type) [0x000b5] in <0b45145b9a734b509064467c19d93928>:0 
  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x0020c] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Mono.Linker.Steps.MarkStep.MarkField (Mono.Cecil.FieldReference reference) [0x0005e] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Unity.Linker.Steps.UnityMarkStep.Unity.Linker.Steps.Marking.IMarkStepCallbacks.MarkField (Mono.Cecil.FieldReference reference) [0x00001] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.Steps.Marking.BaseMarkStepExtension.MarkField (Mono.Cecil.FieldReference reference) [0x00001] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.Steps.Marking.MonoBehaviourMarking.MarkNeededFields (Mono.Cecil.TypeDefinition type) [0x0001b] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.Steps.Marking.MonoBehaviourMarking.DoAdditionalTypeProcessing (Mono.Cecil.TypeDefinition type) [0x0003a] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.Steps.UnityMarkStep.DoAdditionalTypeProcessing (Mono.Cecil.TypeDefinition type) [0x000b5] in <0b45145b9a734b509064467c19d93928>:0 
  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x0020c] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Mono.Linker.Steps.MarkStep.InitializeType (Mono.Cecil.TypeDefinition type) [0x00064] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Mono.Linker.Steps.MarkStep.InitializeAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00035] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Mono.Linker.Steps.MarkStep.Initialize () [0x00019] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00008] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Unity.Linker.Steps.UnityMarkStep.Process (Mono.Linker.LinkContext context) [0x00058] in <0b45145b9a734b509064467c19d93928>:0 
  at Mono.Linker.Pipeline.ProcessStep (Mono.Linker.LinkContext context, Mono.Linker.Steps.IStep step) [0x0000e] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Unity.Linker.UnityPipeline.ProcessStep (Mono.Linker.LinkContext context, Mono.Linker.Steps.IStep step) [0x00018] in <0b45145b9a734b509064467c19d93928>:0 
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00014] in <0dbc0b3fe9284c9f97315a7dab6f66d4>:0 
  at Unity.Linker.UnityDriver.Run () [0x0009b] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling () [0x00007] in <0b45145b9a734b509064467c19d93928>:0 
  at Unity.Linker.UnityDriver.RunDriver () [0x00002] in <0b45145b9a734b509064467c19d93928>:0 
stderr:

UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:126)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71)
UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:166)
UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String&, String&, IEnumerable`1, UnityLinkerRunInformation) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:159)
UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(UnityLinkerRunInformation) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:301)
UnityEditorInternal.AssemblyStripper:StripAssemblies(String, BaseUnityLinkerPlatformProvider, IIl2CppPlatformProvider, RuntimeClassRegistry, ManagedStrippingLevel) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:178)
UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:327)
UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:65)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

Need Updated Readme

Hi!

We try to implement in app purchases in our Unity Game, but we can't due to lack of information.

Could you please update Readme file in order to make a succesful purchase?

For example, there are in Readme file a method called GetProductDetail(string productID); but by the time I import the plugin in Unity I don't have such method.

image

Build failure: FileNotFoundException

Hi!

We are getting the following build error when building an empty Unity Project with the latest Huawei SDK (downloaded from repo):

FileNotFoundException: Could not find file "UnityProject\Temp\StagingArea\assets\bin\Data\Managed\tempStrip\System.Runtime.dll"
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)

Unity Version: 2018.3.14f1
Scripting Backend: IL2CPP

Any help appreciated.

[solved] IAP demo not working.

[edit] After tinkering (a lot) with the demo scene we have managed to initiate a purchase, even tried the sandbox mode.
IAP demo still not working out of the box, tho. Needs some fixing. Also docs are outdated.

Is this project different from official Unity Assets?

Hi guys,

First of all thanks for your valuable contribution to the HMS ecosystem. I used old version of the plugin so many times. I just wonder that Unity Tech. also published Huawei AppGallery Game Services on their asset store and as I know they will publish assets also for other services but I am not sure. Do you know any detail about this? Is this project team and project totally different, right?

And if it is possible, I really would like to contribute to this project as a member. Could you please share some contribution guide or communication information in README.

Thanks again.

IAPClient.EnvReady crash

Environment:

  • Unity 2019.3.0f6
  • master branch of this repo
  • Using Unity IAP with HuaweiStore
  • Built with IL2CPP

Issue:

IAP does not get fully/properly initialized.

Description:

While trying to make IAP work, I get the following error when I invoke Iap.GetIapClient().envReady:

06-17 10:17:51.963 27735 27735 I HMSSDK_IsEnvReadyTaskApiCall: onResult, success
06-17 10:17:52.011 27735 27735 E Unity   : MissingMethodException: Constructor on type 'HuaweiMobileServices.IAP.EnvReadyResult' not found.
06-17 10:17:52.011 27735 27735 E Unity   :   at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0 
06-17 10:17:52.011 27735 27735 E Unity   :   at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <00000000000000000000000000000000>:0 
06-17 10:17:52.011 27735 27735 E Unity   :   at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0 
06-17 10:17:52.011 27735 27735 E Unity   :   at HuaweiMobileServices.Utils.AndroidJavaObjectExtensions.AsWrapper[T] (UnityEngine.AndroidJavaObject javaObject) [0x00000] in <00000000000000000000000000000000>:0 

It cannot find HuaweiMobileServices.IAP.EnvReadyResult constructor, but seems all the previous process is completed successfully.

Because this initialization fails, IAPClient does not get fully initialized, and AddOnSuccessListener is never called.

error CS0012: The type `System.Object' is defined in an assembly that is not referenced

hi, my unity version is 2017.4.30f when i use this plugin,
scripting runtime version i switch to .net 4.6 equlvalent.
there is an error:Assets/Huawei/Demos/Account/AccountDemoManager.cs(38,32): error CS0012: The type System.Object' is defined in an assembly that is not referenced. Consider adding a reference to assembly System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
i want know what's your unity version?

AccountDemo not working

Hi!

I get the following error when making a build and loading the AccountDemo scene, I am unable to sign in:

MissingMethodException: Constructor on type 'HuaweiMobileServices.Id.HuaweiIdAuthService' not found.
System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) (at <00000000000000000000000000000000>:0)
System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) (at <00000000000000000000000000000000>:0)
System.Activator.CreateInstance (System.Type type, System.Object[] args) (at <00000000000000000000000000000000>:0)
HuaweiMobileServices.Utils.AndroidJavaObjectExtensions.AsWrapper[T] (UnityEngine.AndroidJavaObject javaObject) (at <00000000000000000000000000000000>:0)
HmsPlugin.AccountManager.Start () (at <00000000000000000000000000000000>:0)

Plugin Version 2018.v1.1.1
Unity Version: 2018.3.14f1
Scripting Backend: IL2CPP

Any help appreciated.

Game Service not working

I'm trying to use Game Service but I'm not able to.
With Huawei support I verified that both console and manifest seems to be ok, but when I try to use anything in the game service nothing seems to work (probably it can be helpful to know that IAPs works as expected in sandboxing mode.)

I am attaching a minimal demo so you can see how I try to access to the game service and the relative logcat (the only difference from the files I'm attaching and the ones in my demo is that I removed removing the leaderboard ID from the TestHMS inspector, both because it would not be useful for you to know mine and because I'm not sure if it is a sensible information, to test it you have to insert an ID ok for you and obviously to correctly install the plugin.) If I do something wrong it would be helpful to have some documentation or explanation about how to correctly use the APIs.

HMSSDK_GamesBaseClientImpl: call init method first

I'm making sure to call SignIn() first, then I call the GameManager Init method then I get this error within UnlockAchievements and when I try to show leaderboards. Have I missed something?

Edit: Using 2018 v1.1.1

Functional demo missing

Hi,
the fully functional demo for all available kits was scheduled for yesterday but the last released unity package does not include any demo. I tried to create my IAP system with the given files but the code seems to be unfinished and not functional. Is the old undiscontinued version of Unity HMS plugin working? should I work with that and wait until this new branch is completed?
Thank you!

Attribute collision

image

Hey, I'm stuck on this for 2 days now, trying to add rewarded ads to my project. It worked before with hms plugin 2.6.1:300 provided by huawei, as i used it for IAP, but now we need to implement the ads kit and i used your plugin for that, but i keep getting this error.

Account Demo not working

As reported:

I just tried the Account Demo, and it does not work either. It says ”Error or cancelled Login” when I tap the Log-in button.

Cant load advertisemant

Advertisemant for test blocks work fine, but for created blocks its not working.

Manifest contains correct values com.huawei.hms.client.appid, com.huawei.hms.client.cpid and com.huawei.hms.version.
Blocks ids match with id from console

ads and iap issue

hello there i am trying to implement hms ads and iap to my unity game. I did exactly same as demo scene but no ads being shown on my game. And for iap i tried to uncomment IapDemoManager but i faced lots of error. Is there any way to implement iap in my game? Thank you

unity package

Hi! thank you for your work!

Are you plan to update links to unity package in readme?

Where to place the agconnect-services.json?

I've just uploaded the app to appGallery, but Huawei tells me that the agconnect-services.json might not be configured correct.

I've not placed it in my project yet. Do you have any idea where to place it?
It is used to be placed in the root folder of an Android studio project. Where is the corresponding place in Unity?

This is the file:

{ "client":{ "cp_id":"xxxx", "product_id":"xxxx", "client_id":"xxxx", "client_secret":"xxxx", "app_id":"xxxx", "package_name":"com.company.app", "api_key":"xxxx" }, "configuration_version":"1.0" }

Issue when Obtaining Product info on LoadStore()

Hi,
need help with IAPS. I manage to sign in to the app when installed but next steps are throwing erros. Here is the log:

07-24 19:35:52.063 2319 2319 I Unity : [HMS]: SignedIn
07-24 19:35:52.063 2319 2319 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
07-24 19:35:52.063 2319 2319 I Unity :
07-24 19:35:52.619 2319 2319 I Unity : HMSP: checkIapAvailabity SUCCESS
07-24 19:35:52.619 2319 2319 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
07-24 19:35:52.619 2319 2319 I Unity :
07-24 19:35:52.624 2319 2319 I Unity : [HMS]: LoadStore
07-24 19:35:52.624 2319 2319 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
07-24 19:35:52.624 2319 2319 I Unity :
07-24 19:35:52.738 2319 2319 I Unity : [HMSPlugin]: ERROR Consumable ObtainInfoException of type 'HuaweiMobileServices.Utils.HMSException' was thrown.
07-24 19:35:52.738 2319 2319 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
07-24 19:35:52.738 2319 2319 I Unity :
07-24 19:35:52.739 2319 2319 I Unity : [HMSPlugin]: IAP ObtainProductInfo failed. Exception of type 'HuaweiMobileServices.Utils.HMSException' was thrown.
07-24 19:35:52.739 2319 2319 I Unity : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

I created 3 differrent types iaps(consumable, nonconsumable, and auto-subs type of iaps just for test for now) inside app connect galery. Also added SHA256 to the app galerry console. Imported also agconnect-services.json to unity project replacing that of your plugin. Also I believe android manifest is correctly configured to my app ids.

Am I missing something. Can somebody help? Anything I should do on app gallery connect site.
Thanks in advance.

AndroidJNIModule

Imported latest plugin version: v1.1.2 for 2019
Unity Version: 2019.1.14
Mono

Assets\Huawei\Scripts\Account\AccountManager.cs(18,38): error CS0012: The type 'AndroidJavaObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'UnityEngine.AndroidJNIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

I am getting the same error in RewardAdManager also.
I can't find the AndroidJNI module in package manager which seems to be what it's wanting. Should I use the 2018 version of the plugin instead?

Errors after importing package into project.

I received a few errors after importing the package onto my project and unsure how to fix it. I am using Unity 2019.1.13f1.

I am using the 2019 package as well but for some reason I got the first two errors only when I use the 2018 package.

Assets\Huawei\Scripts\Game\GameManager.cs(46,38): error CS0266: Cannot implicitly convert type 'HuaweiMobileServices.Base.ITask<HuaweiMobileServices.Game.Player>' to 'HuaweiMobileServices.Base.ITask'. An explicit conversion exists (are you missing a cast?)

Assets\Huawei\Scripts\Game\AchievementsManager.cs(70,46): error CS0266: Cannot implicitly convert type 'HuaweiMobileServices.Base.ITask<System.Collections.Generic.IList<HuaweiMobileServices.Game.Achievement>>' to 'HuaweiMobileServices.Base.ITask<System.Collections.Generic.IList>'. An explicit conversion exists (are you missing a cast?)

Assets\Huawei\Scripts\Ads\RewardAdManager.cs(79,28): error CS0012: The type 'AndroidJavaObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'UnityEngine.AndroidJNIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

Assets\Huawei\Scripts\Account\AccountManager.cs(17,38): error CS0012: The type 'AndroidJavaObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'UnityEngine.AndroidJNIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

HMSManager

There is no HMS Manager prefab in my project. where is it?

Problems with Game Services and Plugin Dll not work with il2cpp

Hi, first, thanks for this plugin!, really need!.
I notice that it's impossible to run in il2cpp unity config, that's means only will work to make armv7 builds.

second, I succefull test the login part (using my own game create on huawei gallery app), but after login, I try to connect to game services, I already create achievements and leaderdboards, using that ids, but no matter what I always got an error callback, no errors during the services initialitation (player info works), but when I try to get achivemenents or unlock achievement or got a leaderboard, I always got this callback:
ShowAchievements ERROR Exception of type 'HuaweiMobileServices.Utils.HMSException' was thrown.

someone experienced this? is a plugin problem? or maybe some other thing?

ps: I already try all plugins, the release one, and dowload current build, test with both dlls, 2018, and 2019, over unity 2018.3.7 and 2019.3.0f5 and same results

thanks!

productInfo is null error code: 60001

I am using IAP demo directly. When I try to click product its failure.
Root problem, "productInfo" is null.

"2020-07-09 15:37:51.020 30503-30503/? I/Unity: [HMSPlugin]: IAP ObtainProductInfo failed. Exception of type 'HuaweiMobileServices.Utils.HMSException' was thrown. :: 60001: param error"

image
After clicking buy buton.
image

I am using Unity 2019.4 and lates plugin repo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.