- Before you start
- Getting Started
- Sample app
- Unity supported versions
- SDK supported platforms
- SDK calls to API Reference
- Troubleshooting
- Pay or receive Quarters throws Transaction Error
- Pay or receive Quarters throws Missing refresh token
- Pay throws Your app must be verified to transfer Quarters from users
- Pressing
Authorize
in Android mobile doesn't redirect to the app. - Pressing
Authorize
in iOS mobile doesn't redirect to the app. - Making a transaction (pay or receive) shows
Transaction error: Debit and credit address cannot be the same.
- Including QuartersSDK generates error while building
- After click Authorize button receive
Invalid redirect_uri
- FAQ
In order to have a full integration with QuartersSDK you must follow this steps:
- Register your APP following the steps in poq-docs.
- It's mandatory to verify your app before your app can take Quarters from users. Please follow these steps:
- Join our
PoQ Game Devs
discord server - Send us a message to our public channel 💡┋api-and-integration where we are going to handle your request.
- Join our
Also if you want you can join Pocketful Of Quarters
main discord server to be updated with the latest news and meet the rest of the community.
-
Open Unity package manager
-
Add the package depending on your Unity version:
-
For
Unity 2021.3.2 or higher
-
Enter QuartersSDK package git URL
https://github.com/weiks/poq-unity-package-manager.git
and press Add button. Unity Package Manager will pull Quarters Unity SDK package and all of its dependencies to the project.
-
For older Unity versions:
-
Download the Asset file you need (
zip
ortar.gz)
from QuartersSDK package for Unity 2019 -
Unzip the package on your local folder
-
Select the
package.json
file inside the folder where you unzippedQuartersSDK package for Unity 2019
.
-
-
-
Add the following prefab to your first loaded scene
Packages/Quarters Unity SDK/Runtime/QuartersSDK/Prefabs/QuartersInit
- Press Open App Dashboard button. The web browser will open URL to create new Quarters app. Press Save button after populating the form.
- Back in Unity
QuartersInit
component copy the values from app dashboard to the inpector tab ofQuartersInit
Component:APP_ID
->client_id
APP_UNIQUE_IDENTIFIER
-> It needs to beApp URL
sub-domain (ex. in this case exampleapp as in the image below). For more information about this field please readInvalid redirect_uri
troubleshooting section.Is IOS Safari Webview
-> It works only for iOS it will open a Webview browser (for auth or buy flow) and not the mobile default browser. Please check the addiotional values you can set in the Unity inspector tab:Environment
-> selectProduction
if your app was registered in production apps environment otherwise selectSandbox
.Default scope
-> select the 5 scopes (Identity
,Email
,Transactions
,Events
andWallet
).Currency config
-> set it inQuartersCurrency
In order to make the setup you will need to create your game following the steps in PoQ docs "Creating APP".
Quarters Unity SDK contains a basic sample app presenting major SDK functionality like
- Sign In with Quarters
- Sign Out
- Spend (Pay Quarters menu option): need to register your app manually contacting us on any channel as described in Before Start section. For this transaction you won't be able to use the same account that you used as a developer to register your app.
- Receive (Receive Quarters menu option) Quarters. For this transaction you won't be able to use the same account that you used as a developer to register your app.
- Buying (Buy Quarters menu option) Quarters through the website portal
To import the sample scene select Sample Import from Unity Package Manager
SamplePreview1.mov
Unity 2019.4+
- For Unity 2019.X and 2020.X use release version 3.2.2019
- For Unity 2021.X and above use release version 3.2.2021
- iOS
- Android: API 29 and above
- Unity Editor: due to limitations of Unity Editor on Windows external browser is used to authorize user you can check sign-in-with-quarters for details.
In order to make all the operations/transactions with Quarters you will be able to interact with the SDK calls that consumes an API. See that calls fully documented with methods and examples in this README-Api file. Here we will list a quick review of the API operations:
Once QuartersInit
is completed configured you will be able to sign in.
You will find the method to use and an example in fully documented SDK calls documentation .
Please note that due to limitations of Unity Editor on Windows external browser is used to authorize user. After successful authorisation please copy and paste the browser url to unity game view and press Authorize.
You can charge users Quarters by sending a negative price value parameter, which will deduct Quarters from the user's account.
In case you want to reward your users with Quarters, your game will need to be granted permissions. Please, ask for permissions in our Discord channel 💡┋api-and-integration. Once your game is granted permission, you can use the transaction endpoint to send Quarters as rewards to your users by sending a positive price value.
Please go to the SDK calls to API documentation for method description and a code example.
User can also purchase Quarters by using the credit card or other methods.
Please note that real money transactions are performed outside the application in the browser to adhere to Apple and Google's guidelines.
Please go to the SDK calls to API documentation for method description and a code example.
To sign out current Quarters users call.
Please go to the SDK calls to API documentation for method description and a code example.
Currently you cannot make a transfer between your app and your developer account. To test your app, you need to create a secondary test account on https://www.poq.gg/. For more information about transfers you can check our API documentation.
When you try to Pay or receive Quarters you get Transaction Error: Debit and Cretit address cannot be the same. You cannot test your app when you are logged into your developer account to fix it:
- Sign Out.
- Sign In with a registered user that is has not developer rights.
When you try to Pay or receive Quarters you get Missing refresh token to fix it:
- Sign Out.
- Sign In again with the same account.
When you try to Pay or receive Quarters you get Your app must be verified to transfer Quarters from users to fix it:
- Verify your app contacting us.
If you are not a developer you can jump to step B.
When you Sign In
with the sample app you are not redirected to the app after pressing Authorize
button in your browser.
You need to:
In your Unity Project
set your Android manifest.xml
settings to open your app url
Open your Android manifest file and add these lines to enable the link redirection option in your app:
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="#YOUR_APP_LINK.games.poq.gg" android:pathPattern=".*" />
</intent-filter>
Then check in your Unity Player Settings
inside Publishing Settings/Build
the option Custom Main Manifest
Save your manifest and rebuild your app (important: just to be sure please delete your build output folder before rebuild) to generate the new installer that you will use.
Some mobile internet browsers (like Samsung default browser) don't redirect to the app inmediatly.
In case you want to be redirected inmediatly to the app change your default internet mobile browser:
- On your Android phone, tap
Settings
. - Then tap
Apps & Notifications
(or in old Android versionsApp Management
) and finallyDefault Apps
- There on the option
Browser App
you will be able to change your default mobile browser
Now enable support to web addresses in your app
- On your Android phone, tap
Settings
. - Then tap
Apps & Notifications
(or in old Android versionsApp Management
)Default Apps/Openning links
- Choose your app (ex
Quarters SDK
) there you will be able to enableOpen supported links
. - Open
Supported web links
to check that the link of your app is in that list.
You can follow the steps in this video:
PoQ-Enable.supported.links.-.Made.with.Clipchamp.mp4
The steps would be similar to Samsung Devices
.
- Configure your
Default apps
(setChrome
as default browser) and their correspondingRedirect URLs
Screenrecorder-2022-12-14-11-11-56-381.mp4
- App configuration (check for 3 permissions granted):
Screenrecorder-2022-12-14-10-58-18-131.mp4
If after performing steps A (for developers) and B the problem persists, please read the following troubleshooting case Still not redirecting to the app after pressing the Authorize
button
In the project target, “Signing & Capability” tab check that 'Associated Domains' is enabled with the right domain.
Enter to your Apple Developer Certificates, Identifiers & Profiles
Find your identifier and enable Associated Domains
Add your app domain
Besides trying the steps in "Pressing Authorize
in Android mobile doesn't redirect to the app" the issue still happens please contact us.
PoQ dev team decided not to create a possible solution because it would apply to an end user and all the alternatives could expose them to phishing.
For example lets suppose this case where you set up a game called Original Authorized game
:
- You verified it and has access to user's wallets.
- Published it to
App Store
andGoogle Play
. - Another app realizes that anyone can just get the troubleshooting link with validation code (generated by us for this issue) and paste it into any app, so they reuse the same link as your game (because they easily can, it's a public link).
- Then when the user is redirected back and since your real
Original Authorized game
is not installed nothing opens and it shows the link with the code, whether encrypted or not. - User then goes to the fake app and pastes the code
- The fake app calls our API with the code and gets an access token on behalf of
Original Authorized game
. - The fake app can do whatever
Original Authorized game
can do without any restrictions, and as PoQ we can't stop them.
Making a transaction (pay or receive) shows Transaction error: Debit and credit address cannot be the same.
When you create an app with your developer account supposse X@domain.com
you login to the integration app using that developer account if you try to make a transaction (as long as it's pay or receive) you will get this message error:
To fix it:
- Log out from the integration app.
- Login to the integration app with a different account than the one you used to create the app (
X@domain.com
).
Some plugins or packages (such as Google Play SDK
) can interfere with QuartersSDK
and when you try to build your project it generates error like:
ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
Could not load type of field 'Microsoft.Extensions.DependencyInjection.OptionsBuilderConfigurationExtensions+<>c__1`1[TOptions]:<>9__1_0' (1) due to: Could not load file or assembly 'Microsoft.Extensions.Configuration.Binder, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies.
Could not load type of field 'Microsoft.Extensions.DependencyInjection.OptionsBuilderConfigurationExtensions+<>c__DisplayClass3_0`1[TOptions]:configureBinder' (1) due to: Could not load file or assembly 'Microsoft.Extensions.Configuration.Binder, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies.
Could not load type of field 'Microsoft.Extensions.DependencyInjection.OptionsConfigurationServiceCollectionExtensions+<>c__1`1[TOptions]:<>9__1_0' (1) due to: Could not load file or assembly 'Microsoft.Extensions.Configuration.Binder, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies.
Could not load type of field 'Microsoft.Extensions.Options.NamedConfigureFromConfigurationOptions`1+<>c[TOptions]:<>9__0_0' (1) due to: Could not load file or assembly 'Microsoft.Extensions.Configuration.Binder, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies.
Could not load type of field 'Microsoft.Extensions.Options.NamedConfigureFromConfigurationOptions`1+<>c__DisplayClass1_0[TOptions]:configureBinder' (1) due to: Could not load file or assembly 'Microsoft.Extensions.Configuration.Binder, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies.
System.Reflection.Assembly.GetTypes () (at <e40e5a8f982c4b618a930d29f9bd091c>:0)
Google.Android.AppBundle.Editor.Internal.BuildAndRunner+<>c.<GetExtensions>b__4_0 (System.Reflection.Assembly assembly) (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/BuildAndRunner.cs:102)
System.Linq.Enumerable+SelectManySingleSelectorIterator`2[TSource,TResult].MoveNext () (at <ad4a992768794363ade575f9e564f6e6>:0)
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () (at <ad4a992768794363ade575f9e564f6e6>:0)
System.Linq.Enumerable+<CastIterator>d__34`1[TResult].MoveNext () (at <ad4a992768794363ade575f9e564f6e6>:0)
System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].ToList () (at <ad4a992768794363ade575f9e564f6e6>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <ad4a992768794363ade575f9e564f6e6>:0)
Google.Android.AppBundle.Editor.Internal.BuildAndRunner.GetOverridingExtensions () (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/BuildAndRunner.cs:97)
Google.Android.AppBundle.Editor.Internal.BuildAndRunner.BuildAndRun () (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/BuildAndRunner.cs:39)
Google.Android.AppBundle.Editor.Internal.AppBundleEditorMenu.BuildAndRun () (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/AppBundleEditorMenu.cs:72)
If that is the case please follow this steps:
- Go to the folder of
Quarters SDK
imported package. - Inside
Plugins
folder delete all thedlls
(only thedlls
inside that folder) - Go to your
Asset
project folder - Search for
package.config
file in case you don't create it. - Open your
package.config
and check if your file you has all this packages refernces (in case not add them):
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" />
<package id="Microsoft.Extensions.Configuration" version="6.0.0" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="6.0.0" />
<package id="Microsoft.Extensions.Configuration.Binder" version="6.0.0" />
<package id="Microsoft.Extensions.Configuration.FileExtensions" version="6.0.0" />
<package id="Microsoft.Extensions.Configuration.Json" version="6.0.0" />
<package id="Microsoft.Extensions.DependencyInjection" version="6.0.1" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="6.0.0" />
<package id="Microsoft.Extensions.FileProviders.Abstractions" version="6.0.0" />
<package id="Microsoft.Extensions.FileProviders.Physical" version="6.0.0" />
<package id="Microsoft.Extensions.FileSystemGlobbing" version="6.0.0" />
<package id="Microsoft.Extensions.Logging" version="6.0.0" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="6.0.0" />
<package id="Microsoft.Extensions.Logging.Configuration" version="6.0.0" />
<package id="Microsoft.Extensions.Logging.Console" version="6.0.0" />
<package id="Microsoft.Extensions.Options" version="6.0.0" />
<package id="Microsoft.Extensions.Options.ConfigurationExtensions" version="6.0.0" />
<package id="Microsoft.Extensions.Primitives" version="6.0.0" />
<package id="System.Buffers" version="4.5.1" />
<package id="System.Diagnostics.DiagnosticSource" version="6.0.0" />
<package id="System.Text.Encodings.Web" version="6.0.0" />
<package id="System.Memory" version="4.5.4" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" />
<package id="System.Text.Encodings.Web" version="6.0.0" />
<package id="System.Text.Json" version="6.0.0" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" />
</packages>
After tapping/clicking Authorize button we get:
If that is the case please check that the app URL generated by the slugify proccess in your app dashboard it is exactly the same to the parameter redirect_uri
passed in the authorize link. If it is not the same change it:
- Go to PoQ Apps dashboard
- Search for your app and click
Manage
button - Check that field
App Uri
is the same to the one you sent onredirect_uri
parameter
Quarters are an in-game utility token that are cross-game and cross-platform. Quarters use blockchain technology for full interoperability.
The API is still valid and you can make your integration just using the API. In case that you are using Unity SDK
we are working with the dev team on giving support to PC/Desktop games but if you need it right now you will need to add extra code by your side.
The App_Key
and the Client_Secret
are the same keys.
Absolutely! Please reach out to us on our PoQ Game Devs
discord server, and we will provide you with Quarters
to use for testing.
Transactions take a little longer in the Unity editor. Rest assured that transactions should be faster in the build version of your game.