Search Unity

  1. How can our website serve you better? Give us your feedback. Take our survey and let us know.
    Dismiss Notice

Prime31 Android Plugins Officially Live!

Discussion in 'Android' started by prime31, Jun 6, 2011.

  1. yusufulutas

    yusufulutas

    Joined:
    May 26, 2011
    Posts:
    47
    Hi @prime31

    I entegrated socialnetworkcombo plugin , It doesn't work via facebook app ,otherwise it works i mean with web window
    I am using unity 3.5.7f

    Edit: Fixed
     
    Last edited: Mar 29, 2014
  2. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    I'm using the Android social networking plugin and I noticed that if I am logged into facebook some of my new WWW stop working and return this error:
    Code (csharp):
    1.  
    2.  You are trying to load data from a www stream which had the following error when downloading.
    3.  java.io.FileNotFoundException: http://mobile.DOMAIN.com/loadlevelscores.php
    4.  
    then if I log out of facebook they work fine. This seems to only happen when I am trying to access a php script, but when I do a new WWW for a jpg it works fine.
     
  3. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @unitynewb, that sounds like something you want to report to Unity. The WWW class is part of Unity, not our plugin.
     
  4. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    Yeah I just realized this is my fault because when I am logged into facebook I'm am including the users friends in the POST. I just noticed that it is returning a 500 when I checked the responseHeaders which means theres probably something wrong with my php when reading the friends POST.

    Thanks and sorry for wasting your time on this.
     
  5. Little-Big-Monkey

    Little-Big-Monkey

    Joined:
    Mar 4, 2014
    Posts:
    40
    Hey Prime31, why don't you have an MovieTexture for Android, like the one you have for iOS ? ^^
     
  6. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @little, pulling off a hardware decoded video texture that works on all phones on Android is not an easy task due to the massive hardware fragmentation. We could release a software decoded version but that is just not the kind of quality that we would want to put out there. Software decoding is terribly inefficient.

    @yuri, if you have given it a day or two for the dashboard to update and it still isn't showing all data send a support request to Flurry. We have no access to their servers.
     
  7. MakinStuffLookGood

    MakinStuffLookGood

    Joined:
    Nov 20, 2012
    Posts:
    17
    Hey Prime31,

    I'm having an issue with in app billing. queryInventory returns successfully, but returns an empty list even if the user owns the managed product on their Google Play account. It works locally, on a per install basis. So If I download the app, buy the IAP once, I can see queryInventorySucceededEvent being called and the purchases list is not empty. But changing devices or uninstalling is a no go.

    I'm even able to purchase the same non-consumable product more than once on the same Google account (which I thought was impossible).

    Any suggestions?
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @broxxar, that is something you need to report to Google. The plugin has no power to access or modify Google's private server data. Only they can tell you what is happening on their servers.
     
  9. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    I am having trouble understanding how to properly compile the Google Play Game Services plugin. When I export as a Google Android Project in Build Settings, I get two folders, my project folder, and a folder called "google-play-services-lib". At first, I would try to import the project folder, and that was creating errors in the manifest file, saying that it didn't have an integer value for the "com.google.android.gms.version". Eventually I realized to imp or the other folder as well. This got rid of the errors. I then exported the project, loaded it onto the device, but the google play services don't seem to be working. If I press a button that is supposed to show achievements, nothing happens. When I try to initialize, nothing happens. I don't even get a succeed or failure callback. The scene has two game objects in it, one of them being GPGSEventListener.

    So, can anyone help me with this problem? What steps am i missing here?
     
  10. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @drowning, I am pretty sure Unity doesn't export library projects properly yet. You will need to do a few things manually. Once you export you will need to turn the contents of the google-play-services-lib into a library project. You will then need to open the original project and link it to the library project.
     
  11. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    @prime31 sorry dude I'm relatively dumb when it comes to these compile time problems. Can you give me a little more step by step? If I understood correctly I need to:
    1. open the "g-p-g-s-lib" folder in adt
    2. Compile it as a library project
    3. Close this project, open the game project folder in ADT
    4. Link the gpgs to the game project and export.

    Am I close?
     
  12. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @drowning, I personally don't use Android Studio yet due to it still being beta and incomplete but here is how you would do it in Eclipse:

    - export from Unity
    - create a library project from the gpgs-lib folder (just check Is Library in the project settings)
    - in the Android project settings of the main project (the one Google exported) link the library project you just created
     
  13. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    Why is this not in the instructions? Why am I running into this problem and no one else is? Am I messing something up when I build in Unity?

    OK - Here's where I'm at:

    It turns out ADT auto detected all this stuff, and set GPGS to a library, and referenced it to my project. I double checked everything and everything is set up the way I would find in a google doc. However- I still get no love from the GPGS library.

    I added these four lines to my manifest:
    <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\ 1111111111111" />
    <meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="\ 1111111111111" />
    <meta-data android:name="com.prime31.PlayGameServicesPlugin" android:value="UnityPlayerActivityProxy" />
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

    Where "1111111111111" is my actual APP ID. Are any of these lines? or am i possibly missing something?

    In my scene I have 2 GO's:
    GooglePGSEventListener - w/ Script attached
    and GooglePGSManager - a version of the "PlayGameServicesUI.cs" file you attached in your demo. In this file I call PlayGameServices.authenticate()

    The game never acknowledges in log cat that the PGS library is active in anyway, also I have a button in the main menu that calls: GameCenterBinding.showAchievements();

    I get absolutely no recognition from the library. Not even errors. Thoughts?
     
    Last edited: May 4, 2014
  14. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @drowning, most folks just build directly from Unity. Anyone exporting to Eclipse or Android Studio is an advanced user and knows how to make Android apps in their tool of choice. If you are not doing any modifications after building just build straight to apk.
     
  15. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    If I build an .apk straight up, then it throws an ClassNotFoundException that it can't launch UnityPlayerNativeActivity, and the game crashes on launch.
     
  16. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @drowning, it sounds like you might have some issues with your Java and/or Android SDK install. It might be a good idea to try reinstalling them.
     
  17. phamminhloan

    phamminhloan

    Joined:
    May 5, 2014
    Posts:
    1
    Great article, many thanks. friv
     
  18. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    OK - for anyone wondering, my issues had to do with the fact that i've been using Prime31 plugins since Unity 3.5. I saw this thread in the prime31 forums.

    And after meticulously deleting all the old prime31 plugins, then reinstalling what i needed, I was able to generate a manifest through the prime31 menu, and build and run straight to the machine, instead of having to use ADT.
     
  19. teophilik

    teophilik

    Joined:
    Feb 13, 2013
    Posts:
    11
    @prime31 Hey! I am trying to implement Facebook Plugin in my app. In the first session, when I obtain permission to post on my facebook wall, it works very well. But after I open the app again and hit the login button, I receive the following error in the console: Facebook login failed: Invalid Access Token. I am running it in the demo scene. I am running the app on android 4.2. The plugin version I am using is SocialNetworkingAndroid_2013-07-06. How can I solve this?
     
  20. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @teo, you should not be calling login if you are already logged in. When you call init it will recover any stored session data. If you play with the demo scene and watch the log output you will see every event that gets called and when it gets called. That is the easiest way to learn how Facebook's SDK operates.
     
  21. teophilik

    teophilik

    Joined:
    Feb 13, 2013
    Posts:
    11
    @prime I did take a look at the log output. But still, posting wont work even I don't hit the login button, but will return me the same error when I hit post message or image: "Facebook login failed: Invalid access token". Here is what is displayed in the console when I run the app. First time when I launch de app and obtain permission to publish. I pressed Initialize Facebook, Login, Reauthorize with Publish Permission and Post Image. $Screenshot_2014-04-25-09-06-10.png
    And then, after I restart the app and try to post something.
    $Screenshot_2014-04-25-09-21-15.png
    Now, if I click on Reauthorize with Publish Permission button the app crashes.
    If I hit "Get Session Token" it will return an empty string ("session token: ");
     
  22. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @teo, please include the logcat logs. The Unity logs don't contain anything on the native side.
     
  23. Diori

    Diori

    Joined:
    Jan 20, 2013
    Posts:
    12
    I am using Prime31 In App Billing for google. My apps crashed when try to Test Purchase with Test Product.
    I can see logs when initialise IAB, and returning Query Inventory from google. I tried to purchase my product, I've replaced the product with mine (com.****.15000coins). Then the apps crashed, without leaving any log under tag "Unity".

    *FYI, I already input my products and activate the status in Google Dev console. And Replace my key in Init function of the plugin demo. I also use social networking plugin, is it okay? Because, the IAB plugin cause error in the first time import. Then I have to re import my social networking packages again. And the errors gone.
     
  24. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @diori, we need logs in order to be able to see what is happening. There is no such thing as a crash with no logs on Android. There will *always* be a log with a stack trace for every crash.
     
  25. Denko86

    Denko86

    Joined:
    Jul 19, 2012
    Posts:
    47
    How can I prevent piracy with In-App Billing? I already have everything automatically verifying(I didn't turn it off), I only award items if the purchase has succeeded and I consume the purchase after purchase success. Is there anything else I need to take care of?
     
  26. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @denko, the only way to avoid piracy is to do all receipt verification on a secure server.
     
  27. spiiin

    spiiin

    Joined:
    Nov 21, 2012
    Posts:
    2
  28. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @spiiin, the token is internal to the Play SDK and not exposed by the plugin.
     
  29. congpuca

    congpuca

    Joined:
    May 26, 2014
    Posts:
    1
    In my scene I have 2 GO's:
    GooglePGSEventListener - w/ Script attached
    and GooglePGSManager - a version of the "PlayGameServicesUI.cs" file you attached in your demo. In this file I call PlayGameServices.authenticate() Thank post, I need it friv , kizi
     
  30. Fulke

    Fulke

    Joined:
    Nov 24, 2013
    Posts:
    12
    Hey,

    I managed to get the Android IAB plugin set up and working relatively easily last week, however when I test it now it doesn't seem to be retrieve any of the skus which it had no trouble retrieving last week. The only difference between then and now is that I have imported the Android Social Networking plugin. I'm not sure what went wrong or if it's something out of my control but any help would be appreciated.

    Cheers.
     
  31. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @fulke, like most everything in the programming world if you watch the logs you will often find a clue as to why something is happenning.
     
  32. zcorbs

    zcorbs

    Joined:
    May 27, 2014
    Posts:
    1
    Hi prime31,

    We have a problem with the Prime31 IAB.

    The repo steps :

    Launch a purchase
    When you get the IAP screen, press the HOME button.
    Launch the game by going through your apps (ex. : icon on the desktop).
    Notice the IAP screen is killed.
    Launch another purchase (Prime31-Proxy => "going to end the async operation with null data to clear out the queue"). No purchases can be launched.
    Are the Prime31 activity states killed (or saved) correctly whenever the activity is destroyed by Android (OnPause/OnStop/OnDestroy) ?

    Are the Prime31 activity states killed (or saved) correctly whenever the activity is destroyed by Android (OnPause/OnStop/OnDestroy) ? The service is still running.

    Thanks!
     
  33. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @zcorbs, didnt you just post the exact same question on our support forum minutes ago? Please do not SPAM multiple support outlets with the exact same question. It wastes our time and yours and it makes it impossible for future searchers to find valuable information.
     
  34. Fulke

    Fulke

    Joined:
    Nov 24, 2013
    Posts:
    12
    I'm still not having any luck trying to fix my issue. Inside my queryInventorySucceededEvent I'm just adding sku and purchase names, prices and descriptions to separate lists and assigning them to labels. This is all that logcat is telling me;

    D/Finsky ( 6148 ): [290] InAppBillingUtils.getPreferredAccount: com.Fulke.IABTest: Account from first account - [2zpqhDR9jGpmz3EA7EIrNrF60OE]
    D/Finsky ( 6148 ): [290] InAppBillingUtils.getPreferredAccount: com.Fulke.IABTest: Account from first account - [2zpqhDR9jGpmz3EA7EIrNrF60OE]
    D/Finsky ( 6148 ): [264] InAppBillingUtils.getPreferredAccount: com.Fulke.IABTest: Account from first account - [2zpqhDR9jGpmz3EA7EIrNrF60OE]
    D/Finsky ( 6148 ): [264] InAppBillingUtils.getPreferredAccount: com.Fulke.IABTest: Account from first account - [2zpqhDR9jGpmz3EA7EIrNrF60OE]
    D/Finsky ( 6148 ): [289] InAppBillingUtils.getPreferredAccount: com.Fulke.IABTest: Account from first account - [2zpqhDR9jGpmz3EA7EIrNrF60OE]
    D/Finsky ( 6148 ): [289] InAppBillingUtils.getPreferredAccount: com.Fulke.IABTest: Account from first account - [2zpqhDR9jGpmz3EA7EIrNrF60OE]
    D/Finsky ( 6148 ): [265] InAppBillingUtils.getPreferredAccount: com.Fulke.IABTest: Account from first account - [2zpqhDR9jGpmz3EA7EIrNrF60OE]
    D/Finsky ( 6148 ): [265] InAppBillingUtils.getPreferredAccount: com.Fulke.IABTest: Account from first account - [2zpqhDR9jGpmz3EA7EIrNrF60OE]
    I/Unity (18084): queryInventorySucceededEvent. total purchases: 0, total skus: 0
    I/Unity (18084):
    I/Unity (18084): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
    I/Unity (18084):
    I/Unity (18084): purchases
    I/Unity (18084):
    I/Unity (18084):
    I/Unity (18084): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
    I/Unity (18084):
    I/Unity (18084): skus
    I/Unity (18084):
    I/Unity (18084):
    I/Unity (18084): (Filename: ./artifacts/AndroidManagedGenerated/UnityEngineDebug.cpp Line: 53)
    I/Unity (18084):
    D/dalvikvm(18084): GC_CONCURRENT freed 387K, 5% free 9141K/9564K, paused 10ms+4ms, total 74ms
     
  35. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @fulke, both lists are empty which means you have no purchases with that account and the skus you requested information for could not be located by Google. The skus must match exactly what was entered on Googles website.
     
  36. Fulke

    Fulke

    Joined:
    Nov 24, 2013
    Posts:
    12
  37. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @fulke, there must be a mismatch somewhere in your setup. Either bundle ID, keyhash, skus, etc. If all data does not match exactly Google will not return any products. You can also try turning on high detail logs and see if any clues are printed there.
     
  38. Fulke

    Fulke

    Joined:
    Nov 24, 2013
    Posts:
    12
    Still no luck unfortunately :/ I tried making a blank project with just the plugin but it still wasn't getting any of the skus, the same for any backups of the project.
     
  39. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    39
  40. Fulke

    Fulke

    Joined:
    Nov 24, 2013
    Posts:
    12
    Wow, thanks! I was almost ready to give up on it.
     
  41. unitynewb

    unitynewb

    Joined:
    Feb 22, 2009
    Posts:
    242
    Any idea why the AdmobCombo would throw failedToReceiveAdEvent: 1? It does work part of the time, but not as much as when I use AdmobAndroid.

    It seems like AdmobAndroid works better than AdmobCombo, but I'm not sure why. The only thing I can think of is when i call the add with AdmobAndroid it also calls the ad id which AdmobComb doesn't

    EDIT: I just noticed there is another function I can call with the ad id.
     
    Last edited: May 31, 2014
  42. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    @unitynewb, the combo is exactly the same as the Android version. It is nothing more than the full iOS and full Android plugins in a single package. AdMob does not guarantee 100% ad fill. It is quite normal to not get 100% ad fill.
     
  43. devotionsolutions

    devotionsolutions

    Joined:
    Feb 9, 2013
    Posts:
    39
    Screenshot_2014-06-08-02-08-34.png

    Hi Prime31, I'm having an issue with your InAppBilling plugin.
    I'm using your plugin together with a validation server. Google recommends (http://developer.android.com/training/in-app-billing/purchase-iab-products.html) to provisioning the item once the consume successful method is called. But, in some cases, if the server communication fails, or if the user close the app right after the purchase, the purchased product falls into a limbo. If the user tries to buy the product again, I'm receiving a "Unable to buy item (response: 7:Item Already Owned)". But if I try to consume that exact product I'm receiving a new error message "you cannot consume a project that has not been purchased or if you have not first queried your inventory to retrieve the purchases"..

    Could you provide some help?

    Thanks in advance.
     
    Last edited: Jun 8, 2014
  44. Fulke

    Fulke

    Joined:
    Nov 24, 2013
    Posts:
    12
    Did Google change something again? I'm having the same issue as before..

    EDIT: Nevermind, I was being dumb.
     
    Last edited: Jun 10, 2014
    mariluxi likes this.
  45. refsus

    refsus

    Joined:
    Oct 23, 2012
    Posts:
    6
    @Prime

    in your plugin in app billing there's an example button that IABAndroid.testRefundedProduct();
    How can I know the product have been refunded?
     
  46. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,427
    Google will remove the item from the inventory if it is refunded. Just call queryInventory every so often to check to see what the user has purchased but not refunded.
     
  47. FrankF84

    FrankF84

    Joined:
    Dec 16, 2013
    Posts:
    1
    Hey dai_yx, did you ever resolve this issue? I am currently experiencing the exact same thing.
     
  48. chrisjjones

    chrisjjones

    Joined:
    Aug 4, 2012
    Posts:
    4
    Hi Prime31,

    We are using your Android Etcetera plugin to show the SMS and Email composer. Do you know if there is a way to get the result of the SMS or Email action, whether they just cancelled the window or actually sent a message? The iOS version of the plugin does those things, but I can't seem to find any way, even in native code, to do so for Android. Any assistance you could provide would be much appreciated.

    Also, just wanted to say many thanks for the great plugins. I have been using your products in Unity projects for many years and they always work as advertised!

    Thanks,
    Chris
     
  49. younity

    younity

    Joined:
    Aug 18, 2012
    Posts:
    15
    Hello Prime31,

    We are using Android Chartboost plugin, and we got the following error at runtime:

    Code (CSharp):
    1. AndroidJavaException: java.lang.NoClassDefFoundError: com/chartboost/sdk/impl/ab
    2. I/Unity   (12928):   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
    3. I/Unity   (12928):   at UnityEngine.AndroidJNISafe.CallBooleanMethod (IntPtr obj, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0
    4. I/Unity   (12928):   at UnityEngine.AndroidJavaObject._Call[Boolean] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
    5. I/Unity   (12928):   at UnityEngine.AndroidJavaObject.Call[Boolean] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
    6. I/Unity   (12928):   at ChartboostAndroid.hasCachedInterstitial (CBLocation location) [0x00000] in <filename unknown>:0
    7. I/Unity   (12928):   at ChartBoostController.hasCachedInterstitial (CBLocation location) [0x00000] in <filename unknown>:0
    8.  
    Do you have any clue? Thanks!
     
  50. vickygroups

    vickygroups

    Joined:
    Apr 2, 2014
    Posts:
    16
    Wow - thank you for posting. I have the same error. Which java files do you search for? Did you download from apple or from oracle? Thanks!



     

    Attached Files:

unityunity