How to integrate Huawei Mobile Services (HMS) in Unity? - unity3d

I've found a lot of guidelines on how to integrate HMS in my apps. But majority of them are different or using android studio. May I know which one is the latest guidelines to integrate HMS in my apps for Unity.
Also, I want to enable In-App-Purchase (subscription) for my apps as well.
Thanks in advance.
UPDATED
Currently I'm trying to implement In-App-Purchase for huawei. Huawei tech said that users need to signIn first before they can use IAP. But I received this error while testing signIn
How to obtain product info ? here

AFAIK you have two main options:
UDP SDK from Unity, which is the Unity official solution to HMS in Unity. However has been under maintenance for some days now.
Unity HMS Plugin from EvilMinds, an open source alternative that is already functional and includes supports to more HMS kits. Looks pretty promising for the future.
In any case you can still manually access HMS Android SDK directly using Unity SDK Android API.

Unity provides the HMS Plugin here: Unity Asset Store > Huawei HMS Core App Services
The README file contains information about development guides, API references. For more technical questions, please submit a ticket with Unity Customer Service.
Currently Unity does not support the In-App-Purchase (subscription) function. It will be planned in the future.
Update:
For the IAP error:
It is a null pointer. Please check for unassigned objects. If you cannot find anything, please delete project and install again cause sometimes these kind of things happening.

Related

Can I integrate HMS nearby Service and analytics kit into my Unity Game? and How?

I want to add HMS nearby Service and analytics kit into my unity Game, I read through a few Q&As here but those answers are here and there, not complete. Could anyone tell me what I really need to do so to integrate them into my code properly? thanks
For overall procedures as to how to deploy your Unity Game into Huawei App. Gallery, please refer to the official documentation at: https://api-udp.unity.com/guideDoc/HUAWEI
The easiest way to integrate HMS Kits into your unity Game, you can use HMS Unity Plugin. The HMS Unity Plugin is a tool that helps developers to quickly integrate Huawei Mobile Services (HMS) to their games in Unity without worrying about the boilerplate codes that have to be written in the background. All the necessary backend code is dealt with for you, and all you have to do is to focus on your own game and HMS features.
Huawei plugin’s GitHub page is at: https://github.com/EvilMindDevs/hms-unity-plugin/tree/2.0 Please make sure to download the latest version of the plugin for the corresponding Unity version.
To start using the plugin you must go to link, for the readme of the official GitHub page of the plugin and complete the phases, starting from the phase called “1 — Register your app at Huawei Developer” to “4 — Connect your game with any HMS Kit”, so that the AppGallery Connect side of your application is done. HMS requires AppGallery Connect configurations to correctly work with the in-game features you want to implement.
Currently available HMS Kits in Huawei plugin are:
To use any kit, you must import the plugin (downloaded from the releases page) and click on the kits that you want to use. One example:
Configure your manifest
Connect your game with the HMS Managers
Connect the HMS Callbacks with your game

Flutter. Admob ads with mediation

I've integrated https://pub.dev/packages/firebase_admob into my app and implemented rewarded ads. My problem now is that I'd like to use mediation via this plugin. The only thing is that I know (from developing Android apps and also it says in the Admob docs) that one needs to include the mediated networks' SDKs in the app.
Does this plugin even support mediation? I wasn't able to find anything relating to this.
Or does the mediation only come from the admob dashboard, just by setting up the add-unit with mediation and you're not really required to add the SDKs?
I couldn't find any adapters for this plugin, so ... don't really have anything to integrate in the app.
I'm very confused. Does anyone know how to use mediation or if it even works with the current firebase_admob` flutter plugin?
You can use firebase_admob and that dependency supports mediation. You you would like to add mediation there is a guide over here:
Android - https://developers.google.com/admob/android/mediate
iOS - https://developers.google.com/admob/ios/mediate
You can select the ad network you would like to integrate and read the steps on how to do so. Sometimes the documentation can be outdated so just make sure you cross-check the steps with the ad network you want to integrate on their github repo.
If you are integrating it for Android you have to add the dependencies in your app level build.gradle file and it will automatically install that particular ad networks SDK in your Flutter app.
If you are adding the same for iOS just install the Cocoapod for the ad network at the end of your Podfile.

How to integrate admob with google play services?

Can anyone please tell me how to integrate admob plugin with google play services plug in unity.I am struggle since long time to solve this problem .But, I am not able to solve it.
I am using Unity Ads and I have been more than satisfied with it. Unity provides ads so if you use their service, ads showen will be provided by Unity. It is very simple to implement. Really good explained in this video Ads tutorial unity.
You can show ad just with Advertisement.Show() which will show default ad which can be set here.
You could start using the AdMob for Unity.
The Google Mobile Ads SDK is the latest generation in Google mobile advertising featuring refined ad formats and streamlined APIs for access to mobile ad networks and advertising solutions. The SDK enables mobile app developers to maximize their monetization in native mobile apps.
This repository contains the source code for the Google Mobile Ads Unity plugin. This plugin enables Unity developers to easily serve Google Mobile Ads on Android and iOS apps without having to write Java or Objective-C code. The plugin provides a C# interface for requesting ads that is used by C# scripts in your Unity project.
As stated in the related SO post, Google has official support for AdMob on Unity game engine and this is the GitHub for Google Mobile Ads Unity plugin.
Hope this helps.

FIREBASE + UNITY [duplicate]

I am struggling a little bit while trying to implement firebase in unity, firebase do not yet provide a unity sdk and I was considering these options:
1) create native plugins for iOS and Android that wraps the firebase sdk and methods that I need
2) use IKVM to create a dll from the firebase .jar, I know someone has done it but I have not read yet about a 100% working method
3) build everything from scratch on top of the firebase REST api
what do you advice? have you got some experience with the topic, someone out there has made firebase work with unity?? :D
thanks
Firebase has officially Unity supported now.
https://firebase.google.com/docs/unity/setup
Import FirebaseAnalytics.unitypackage(Download From Firebase Website Or direct link https://dl.google.com/firebase/sdk/unity/firebase_unity_sdk_1.0.0.zip)
You can look this beta tool, with this u can build for Android and IOS from Unity.
Each Plugin have firebase fun.
https://github.com/unity-plugins/Firebase-Admob-Unity
Google Firebase Unity Admob Plugin
Google Firebase Unity Admob Plugin provides a way to integrate firebase admob ads in Unity3D Game and u3d app. You can use it for Unity iOS and Android App with the same c# or js code.It support all native firebase admob features such as Native Express Ad
Google Firebase Unity Admob Plugin Features
Platforms supported in one plugin :
Android, Based Admob SDK v9.0 (part of Google Firebase service)
iOS, via SDK v7.8.0
Support all native events
AdRequest targeting methods,such as children target,test mode
Not need change Android package name
Very simple API
Based on FireBase SDK Version
Ad Types:
Banner(All Banner Type and Custom banner sizes)
Interstitial (text, picture, video)
Rewarded Video
Native Express Ad
https://github.com/unity-plugins/google-service-unity
Google Service Unity Plugin
Google Service Unity Plugin is a Unity Plugin For Google Service.Include Google Admob Unity,Firebase Analytic Unity,Google Game API Unity. Login,Achievement,Leaderboard,Event,Quest,Snapshot,RealTimePlayGame,TurnbasedPlayGame API are supported and easy to use with c# or js.
Currently it's very easy to add Firebase to your Unity project as long as you follow specific prerequisites. If you're building for Android or iOS then you're good to go, but the same doesn't happen if you're building for WebGL.
According to the documentation, it can be done following the next steps
Create a Firebase project
Register your app with Firebase
Add Firebase configuration files
Add Firebase Unity SDKs

GameAnalytics, validating in app purchases on Unity

I'm setting up for the first time GameAnalytics in my Unity3D project.
I'm try to figure out if there is a way to validate in app purchases for both android and iOS from it.
In the docs I found http://www.gameanalytics.com/docs/ga-data#business-event. I understood that you need to work with native sdks to get this feature, am I right?
Could it be an option to configure from the dashboard an android and an iOS game and then changing the keys in unity with precompilator instructions? (like #if UNITY_ANDROID)?
I am an SDK developer # GameAnalytics.
Yes.
There is a way to make the GA servers validate Android and iOS IAP purchases in business events. From Unity.
Short story
You need to send the receipt in the business event after the purchase.
You can read our complete Unity tech guide in the Github Repository.
Regarding IAP validation you should read this section.
https://github.com/GameAnalytics/GA-SDK-UNITY/wiki/Business%20Event
About the keys
You should create a game for Android and iOS in our tool at go.gameanalytics.com
Inside the Unity Editor you can add platforms (Android / iOS) and then add specific keys to each.
You can read more about the in-editor settings in the wiki docs as well. Including how to login and select games directly in the editor.
Let me know if you have any issues. You could also file a support case with our friendly support staff.
When you install the Game Analytics unity package, you are essentially installing the native libraries for each platform (Android, iOS, ...) located in the Plugins folder.
If you want to target multiple platforms in your code with an API like Game Analytics, I recommend you use the preprocessor tags as you mentioned since the functions from Game Analytics are platform specific.