Use Google Play Billing inside Unity? - unity3d

Just curious, can I use Google Play Billing functionality inside Unity? I see only Java & Kotlin examples, but maybe there is some plugin for Unity?

I can recommend the prime31 In App Billing Plugin, which is used for several years now. https://prime31.com/docs#androidIAB
Unity provides also an IAP Module them self, which i have not used yet:
https://docs.unity3d.com/Manual/UnityIAP.html
Update September 2020:
I now have used the Unity IAP module for a project on iOS and Google Play and it worked like a charm.

[2020] Google have released the Google Play billing plugin for Unity, which as per the Unity Package Manager description, "provides all of the features available in the current Java and Kotlin versions." It is an extension of UnityIAP.
You can review their documentation, including installation instructions, here.
The documentation for the plugin doesn't include much in the way of examples like the Java and Kotlin documentation, but it is open-source, so you can review the files themselves to see what you are able to implement.

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

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

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.

Difference between two similar Goodle Unity Ads plugins

Tere is a two plugins for Unity from Google for having Ads in your app.
First, based on firebase and provided via google play services:
https://github.com/googleads/googleads-mobile-unity
Second one, also well-updated, used by some people plugin for similar purposes as as well as first plugin.
https://github.com/unity-plugins/Unity-Admob
I am new in Ads in Unity3d, and I want to make it clear, what is the difference between them ?
I think someone can give a proper answer.
Maybe this can help.
Should we prefer AdMob in Google Play services compared to "old" AdMob SDK
But I think to read more their docs and choose, is best solution to choose.
I checked https://github.com/unity-plugins/Unity-Admob project and as you may check also in the doc there is no way for you to set the applicationID.
Google Ads cannot play without that ID. Also that plugin would try to take storage and WiFi access and as we know this is not needed for Admob.
I suggest you better use https://github.com/googleads/googleads-mobile-unity which is a official plugin at the moment.

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.

Google Analytics with MonoTouch crashes on device

I am trying to use Google Analytics with a MonoTouch application (iPhone). It works great on the simulator but crashes on startup on an actual iPhone.
This is apparently due to a bug in the XCode linker than doesn't allow libraries with Thumb and non-Thumb instruction sets to be linked together.
http://monotouch.net/Documentation/Troubleshoot
From what I can see, MonoTouch is compiled with non Thumb. The Google Analytics lib is compiled with Thumb.
Has anyone figured out a workaround for this?
Clarification - We are using GA to track the page & event views of our own app. We are not writing an app to query the GA API.
Hello i've done some work with the Analytics API
http://dl.dropbox.com/u/2058130/Analytics.zip
here you are the DLLs i used, this are already monotouch precompiled DLL's you need to import to your project the 3 of them in order to use it
here is the documentation of the dll
http://code.google.com/apis/analytics/docs/gdata/gdataLibraries.html
Hope this helps
Alex
There is no workaround at this time, you should "star" this issue to let Google know its important for you:
http://code.google.com/p/gdata-issues/issues/detail?id=1705
As of version 1.1, the Google Analytics SDK provides a nothumb version of the library.