Skip to content

Commit 72af9ae

Browse files
committed
New getVersion API
1 parent 5a46980 commit 72af9ae

6 files changed

Lines changed: 65 additions & 61 deletions

File tree

android/build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
ext.kotlin_version = '1.3.72'
4+
ext.poolakey_version = '1.2.2'
45
repositories {
56
google()
67
jcenter()
@@ -36,6 +37,15 @@ android {
3637
versionName "1.0"
3738
}
3839

40+
buildTypes {
41+
debug {
42+
buildConfigField "String", "POOLAKEY_VERSION", '"' + poolakey_version + '"'
43+
}
44+
release {
45+
buildConfigField "String", "POOLAKEY_VERSION", '"' + poolakey_version + '"'
46+
}
47+
}
48+
3949
compileOptions
4050
{
4151
sourceCompatibility JavaVersion.VERSION_1_8
@@ -45,8 +55,8 @@ android {
4555

4656

4757
dependencies {
48-
implementation "com.github.cafebazaar.Poolakey:poolakey:1.2.2"
4958
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
59+
implementation "com.github.cafebazaar.Poolakey:poolakey:$poolakey_version"
5060
}
5161

5262
task deleteJar(type: Delete) {

android/src/main/java/com/farsitel/bazaar/PoolakeyBridge.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import com.farsitel.bazaar.callback.ConnectionCallback;
77
import com.farsitel.bazaar.callback.ConsumeCallback;
8-
import com.farsitel.bazaar.callback.OwnedProductsCallback;
98
import com.farsitel.bazaar.callback.PaymentCallback;
9+
import com.farsitel.bazaar.callback.PurchasesCallback;
1010
import com.farsitel.bazaar.callback.SKUDetailsCallback;
1111

1212
import java.lang.reflect.Field;
@@ -53,6 +53,10 @@ private Activity getCurrentActivity() {
5353
return null;
5454
}
5555

56+
public String getVersion() {
57+
return BuildConfig.POOLAKEY_VERSION;
58+
}
59+
5660
public void connect(String rsaPublicKey, ConnectionCallback callback) {
5761
PoolakeyKotlinBridge.INSTANCE.connect(getCurrentActivity(), rsaPublicKey, callback);
5862
}

unity/Assets/PluginVersion.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

unity/Assets/Poolakey/Demo/DemoScene.unity

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ RectTransform:
364364
m_Children:
365365
- {fileID: 1858509432}
366366
m_Father: {fileID: 1478282524}
367-
m_RootOrder: 6
367+
m_RootOrder: 4
368368
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
369369
m_AnchorMin: {x: 1, y: 0}
370370
m_AnchorMax: {x: 1, y: 0}
@@ -679,85 +679,82 @@ CanvasRenderer:
679679
m_PrefabAsset: {fileID: 0}
680680
m_GameObject: {fileID: 196073118}
681681
m_CullTransparentMesh: 1
682-
--- !u!1 &488007352
682+
--- !u!1 &366028415
683683
GameObject:
684684
m_ObjectHideFlags: 0
685685
m_CorrespondingSourceObject: {fileID: 0}
686686
m_PrefabInstance: {fileID: 0}
687687
m_PrefabAsset: {fileID: 0}
688688
serializedVersion: 6
689689
m_Component:
690-
- component: {fileID: 488007353}
691-
- component: {fileID: 488007355}
692-
- component: {fileID: 488007354}
690+
- component: {fileID: 366028416}
691+
- component: {fileID: 366028418}
692+
- component: {fileID: 366028417}
693693
m_Layer: 5
694-
m_Name: VersionText
694+
m_Name: HeaderImage
695695
m_TagString: Untagged
696696
m_Icon: {fileID: 0}
697697
m_NavMeshLayer: 0
698698
m_StaticEditorFlags: 0
699699
m_IsActive: 1
700-
--- !u!224 &488007353
700+
--- !u!224 &366028416
701701
RectTransform:
702702
m_ObjectHideFlags: 0
703703
m_CorrespondingSourceObject: {fileID: 0}
704704
m_PrefabInstance: {fileID: 0}
705705
m_PrefabAsset: {fileID: 0}
706-
m_GameObject: {fileID: 488007352}
706+
m_GameObject: {fileID: 366028415}
707707
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
708708
m_LocalPosition: {x: 0, y: 0, z: 0}
709709
m_LocalScale: {x: 1, y: 1, z: 1}
710-
m_Children: []
710+
m_Children:
711+
- {fileID: 764090347}
711712
m_Father: {fileID: 1478282524}
712-
m_RootOrder: 1
713+
m_RootOrder: 0
713714
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
714715
m_AnchorMin: {x: 0, y: 1}
715-
m_AnchorMax: {x: 0, y: 1}
716-
m_AnchoredPosition: {x: 723.57, y: -96.5}
717-
m_SizeDelta: {x: 524.87, y: 93}
718-
m_Pivot: {x: 0.5, y: 0.5}
719-
--- !u!114 &488007354
716+
m_AnchorMax: {x: 1, y: 1}
717+
m_AnchoredPosition: {x: 0, y: 0}
718+
m_SizeDelta: {x: 0, y: 144}
719+
m_Pivot: {x: 0, y: 1}
720+
--- !u!114 &366028417
720721
MonoBehaviour:
721722
m_ObjectHideFlags: 0
722723
m_CorrespondingSourceObject: {fileID: 0}
723724
m_PrefabInstance: {fileID: 0}
724725
m_PrefabAsset: {fileID: 0}
725-
m_GameObject: {fileID: 488007352}
726+
m_GameObject: {fileID: 366028415}
726727
m_Enabled: 1
727728
m_EditorHideFlags: 0
728-
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
729+
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
729730
m_Name:
730731
m_EditorClassIdentifier:
731732
m_Material: {fileID: 0}
732-
m_Color: {r: 1, g: 1, b: 1, a: 1}
733+
m_Color: {r: 1, g: 1, b: 1, a: 0.2784314}
733734
m_RaycastTarget: 1
734735
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
735736
m_Maskable: 1
736737
m_OnCullStateChanged:
737738
m_PersistentCalls:
738739
m_Calls: []
739-
m_FontData:
740-
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
741-
m_FontSize: 36
742-
m_FontStyle: 0
743-
m_BestFit: 0
744-
m_MinSize: 3
745-
m_MaxSize: 40
746-
m_Alignment: 0
747-
m_AlignByGeometry: 0
748-
m_RichText: 1
749-
m_HorizontalOverflow: 0
750-
m_VerticalOverflow: 0
751-
m_LineSpacing: 1
752-
m_Text: 'Poolakey :'
753-
--- !u!222 &488007355
740+
m_Sprite: {fileID: 0}
741+
m_Type: 0
742+
m_PreserveAspect: 0
743+
m_FillCenter: 1
744+
m_FillMethod: 4
745+
m_FillAmount: 1
746+
m_FillClockwise: 1
747+
m_FillOrigin: 0
748+
m_UseSpriteMesh: 0
749+
m_PixelsPerUnitMultiplier: 1
750+
--- !u!222 &366028418
754751
CanvasRenderer:
755752
m_ObjectHideFlags: 0
756753
m_CorrespondingSourceObject: {fileID: 0}
757754
m_PrefabInstance: {fileID: 0}
758755
m_PrefabAsset: {fileID: 0}
759-
m_GameObject: {fileID: 488007352}
760-
m_CullTransparentMesh: 0
756+
m_GameObject: {fileID: 366028415}
757+
m_CullTransparentMesh: 1
761758
--- !u!1 &764090346
762759
GameObject:
763760
m_ObjectHideFlags: 0
@@ -787,14 +784,14 @@ RectTransform:
787784
m_LocalPosition: {x: 0, y: 0, z: 0}
788785
m_LocalScale: {x: 1, y: 1, z: 1}
789786
m_Children: []
790-
m_Father: {fileID: 1478282524}
787+
m_Father: {fileID: 366028416}
791788
m_RootOrder: 0
792789
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
793-
m_AnchorMin: {x: 0, y: 1}
794-
m_AnchorMax: {x: 0, y: 1}
795-
m_AnchoredPosition: {x: 50, y: -50}
790+
m_AnchorMin: {x: 0.5, y: 0.5}
791+
m_AnchorMax: {x: 0.5, y: 0.5}
792+
m_AnchoredPosition: {x: -508, y: 0}
796793
m_SizeDelta: {x: 364.2857, y: 93}
797-
m_Pivot: {x: 0, y: 1}
794+
m_Pivot: {x: 0, y: 0.5}
798795
--- !u!114 &764090348
799796
MonoBehaviour:
800797
m_ObjectHideFlags: 0
@@ -1058,12 +1055,12 @@ RectTransform:
10581055
- {fileID: 797998922}
10591056
- {fileID: 46620565}
10601057
m_Father: {fileID: 1478282524}
1061-
m_RootOrder: 5
1058+
m_RootOrder: 3
10621059
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
10631060
m_AnchorMin: {x: 0, y: 0}
10641061
m_AnchorMax: {x: 1, y: 0}
10651062
m_AnchoredPosition: {x: 0, y: 0}
1066-
m_SizeDelta: {x: 0, y: 396}
1063+
m_SizeDelta: {x: 0, y: 480}
10671064
m_Pivot: {x: 0.5, y: 0}
10681065
--- !u!114 &962587539
10691066
MonoBehaviour:
@@ -1164,8 +1161,9 @@ RectTransform:
11641161
m_LocalScale: {x: 1, y: 1, z: 1}
11651162
m_Children:
11661163
- {fileID: 196073119}
1164+
- {fileID: 1587869379504262204}
11671165
m_Father: {fileID: 1478282524}
1168-
m_RootOrder: 2
1166+
m_RootOrder: 1
11691167
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
11701168
m_AnchorMin: {x: 0, y: 1}
11711169
m_AnchorMax: {x: 0, y: 1}
@@ -1479,10 +1477,8 @@ RectTransform:
14791477
m_LocalPosition: {x: 0, y: 0, z: 0}
14801478
m_LocalScale: {x: 0, y: 0, z: 0}
14811479
m_Children:
1482-
- {fileID: 764090347}
1483-
- {fileID: 488007353}
1480+
- {fileID: 366028416}
14841481
- {fileID: 1057151763}
1485-
- {fileID: 1587869379504262204}
14861482
- {fileID: 1587869380155104686}
14871483
- {fileID: 962587538}
14881484
- {fileID: 65512613}
@@ -1604,12 +1600,12 @@ RectTransform:
16041600
m_LocalScale: {x: 1, y: 1, z: 1}
16051601
m_Children:
16061602
- {fileID: 1587869380279135864}
1607-
m_Father: {fileID: 1478282524}
1608-
m_RootOrder: 3
1603+
m_Father: {fileID: 1057151763}
1604+
m_RootOrder: 1
16091605
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
16101606
m_AnchorMin: {x: 1, y: 1}
16111607
m_AnchorMax: {x: 1, y: 1}
1612-
m_AnchoredPosition: {x: -294.96478, y: -297}
1608+
m_AnchoredPosition: {x: 318.03516, y: -94.41983}
16131609
m_SizeDelta: {x: 401.93, y: 231.16}
16141610
m_Pivot: {x: 0.5, y: 0.5}
16151611
--- !u!114 &1587869379504262205
@@ -1767,7 +1763,7 @@ RectTransform:
17671763
m_LocalScale: {x: 1, y: 1, z: 1}
17681764
m_Children: []
17691765
m_Father: {fileID: 1478282524}
1770-
m_RootOrder: 4
1766+
m_RootOrder: 2
17711767
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
17721768
m_AnchorMin: {x: 0, y: 0}
17731769
m_AnchorMax: {x: 1, y: 1}

unity/Assets/Poolakey/Demo/Scripts/PoolakeyExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public class PoolakeyExample : MonoBehaviour
1717
private Dictionary<string, ShopItem> shopItems;
1818
void Start()
1919
{
20-
Log("Poolakey Plugin Version: " + PluginVersion.VersionString);
2120

2221
// TODO: SecurityCheck.Enable("Your RSA key");
2322
SecurityCheck securityCheck = SecurityCheck.Disable();
2423
PaymentConfiguration paymentConfiguration = new PaymentConfiguration(securityCheck);
2524
payment = new Payment(paymentConfiguration);
25+
Log("Poolakey Plugin Version: " + payment.version);
2626

2727
CreateShopItems();
2828
Connect();

unity/Assets/Poolakey/Scripts/Payment.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class Payment
1212
PaymentConfiguration paymentConfiguration;
1313
private AndroidJavaObject poolakeyBridge;
1414
private bool isAndroid;
15+
public string version;
1516

1617
public Payment(PaymentConfiguration paymentConfiguration)
1718
{
@@ -23,6 +24,7 @@ public Payment(PaymentConfiguration paymentConfiguration)
2324
if (pluginClass != null)
2425
{
2526
poolakeyBridge = pluginClass.CallStatic<AndroidJavaObject>("getInstance");
27+
version = poolakeyBridge.Call<string>("getVersion");
2628
}
2729
}
2830
}

0 commit comments

Comments
 (0)