onepf / OpenIAB

Open In-App Billing for Google Play, SlideMe, Amazon Store, Nokia Store, Samsung Apps, Yandex.Store, Appland, Aptoide, AppMall and Fortumo.
http://onepf.org/openiab/
Apache License 2.0
475 stars 171 forks source link

SamsungApps Store testing (Unity, Android) #172

Open cmdeviant opened 10 years ago

cmdeviant commented 10 years ago

I'm successfully tested OpenIAB Unity 0.9.4 plugin with Yandex.Store, Amazon, Google and Apple AppStore but missing something with SamsungApps IAB testing.

My setup steps are:

<!-- SamsungApps section -->        
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.sec.android.iap.permission.BILLING" />

<!-- OpenIAB section -->        
<activity android:name="org.onepf.openiab.UnityProxyActivity"
    android:launchMode="singleTask"
    android:screenOrientation="sensorLandscape"
    android:label="@string/app_name"
    android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
options.prefferedStoreNames = new string[] {OpenIAB_Android.STORE_SAMSUNG};
OpenIAB.mapSku("my.regular.sku.id", OpenIAB_Android.STORE_SAMSUNG, "100000103209/000001016706");
adb -d install -r -i com.sec.android.app.samsungapps /path/to/my-samsung.apk 

Also I'm already signed in SamsungApps application with the same account ID as I have on Seller and Developer Portal, but don't know if it necessary for testing workflow.

Then when launching the application first thing I see is a black screen with "Ожидание..." (eng: Waiting...) spin as part or Samsung IAP Activity I guess. After that nothing happens and I should press hardware back button to resume loading of my game.

logcat:

I/Unity   (12385): ********** Android OpenIAB plugin initialized **********
I/Unity   (12385):  
I/Unity   (12385): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54)
I/Unity   (12385): 
E/Watchdog(  298): !@Sync 892
D/OpenIAB-UnityPlugin(12385): createBroadcasts
D/OpenIAB-UnityPlugin(12385): Starting setup.
E/OpenIabHelper(12385): bindService() failed for com.yandex.store
E/OpenIabHelper(12385): java.lang.SecurityException: Not allowed to bind to service Intent { act=org.onepf.oms.openappstore.BIND cmp=com.yandex.store/.service.YandexStoreService }
E/OpenIabHelper(12385):     at android.app.ContextImpl.bindService(ContextImpl.java:1120)
E/OpenIabHelper(12385):     at android.content.ContextWrapper.bindService(ContextWrapper.java:370)
E/OpenIabHelper(12385):     at org.onepf.oms.OpenIabHelper.discoverOpenStores(OpenIabHelper.java:497)
E/OpenIabHelper(12385):     at org.onepf.oms.OpenIabHelper$1.run(OpenIabHelper.java:342)
E/OpenIabHelper(12385):     at java.lang.Thread.run(Thread.java:1020)
W/ActivityManager(  298): Permission Denial: Accessing service ComponentInfo{com.yandex.store/com.yandex.store.service.YandexStoreService} from pid=12385, uid=10102 requires org.onepf.openiab.permission.BILLING

Inventory was not recieved after plugin initialization and raised no events. What I'm doing wrong?

Test environment: Unity 4.2.2, OpenIAB Unity 0.9.4 plugin, Galaxy Tab 8.9 with Google Play, SamsungApps and Yandex.Store installed

oorlov commented 10 years ago

Looks like problem in Yandex.Store, not in Samsung impl

Two suggestions:

 <uses-permission android:name="org.onepf.openiab.permission.BILLING" />