Table of Contents
Folder in Plugins/UnityChannels Must be Deleted if exist! Otherwise Google Play will Ban your application with message AliPay wanna permission to phone number
- PackageManager.
UnityIAP
Update to version4.1.3
- Enable
UnityAnalytics
andUnityIAP
services - Add GooglePlay public key to UnityIAP
- Create UnityIAP Tangles => Obfuscate GooglePublicKey
- Coppy file
.asmdef
fromSamples~/TagleAsmdef~/
to folder with generated Tangles (Assets/Plugins/UnityPurchasing/Generated/) Download package Google IAP plugin => google-play-plugins-1.6.0.unitypackageImport this package to project- If needed Enable #define RECEIPT_VALIDATION
- Drop to scene prefabButton from Samples~ or create your own prefab with script
IAP_Button.cs
- Assign IAP_Data file to button
-
Create IAP_Data file. Has 2 ways:
Keep in mind - All IAP_Data files must be plase in `Resources/IAP/Data/` - IAP_manager must be plase in `Resources/IAP/`
- When
IAP_Buttton
OnEnable => staticIAP_InitializeBroker.TryOnCheck()
; - static
IAP_InitializeBroker
Check internet connection.- If need, in this stage you can block interface by NoInternetConnection
- Only if online static
IAP_InitializeBroker
initilizeIAP_manager
- When user click to
IAP_Button
=> IAP_InitializeBroker.TryOnCheck(callbackwith action for buy if internetON
); - if
networkOn
, static IAP_InitializeBrokerinvoke callback
(where IAP_data object waiting) IAP_data
object invokeIAP_manager
forbuy
item- if
IAP_manager
complete transaction, then invokeIAP_data
forreward
- All
rewards
must be configured inIAP_data
file inUnityEvent
- No_Internet_Message - handled by other package
- No_Internet_callback - handled by other package